sway/scripts/mdbook-forc-documenter/README.md
Joshua Batty c37dc92952
Some checks failed
CI / cargo-toml-fmt-check (push) Has been cancelled
CI / cargo-fmt-check (push) Has been cancelled
CI / cargo-test-lib-std (push) Has been cancelled
CI / build-sway-lib-std (push) Has been cancelled
CI / build-sway-examples (push) Has been cancelled
Codspeed Benchmarks / benchmarks (push) Has been cancelled
CI / check-forc-manifest-version (push) Has been cancelled
CI / get-fuel-core-version (push) Has been cancelled
CI / check-dependency-version-formats (push) Has been cancelled
CI / build-reference-examples (push) Has been cancelled
CI / forc-fmt-check-sway-lib-std (push) Has been cancelled
CI / forc-fmt-check-sway-examples (push) Has been cancelled
CI / forc-fmt-check-panic (push) Has been cancelled
CI / check-sdk-harness-test-suite-compatibility (push) Has been cancelled
CI / build-mdbook (push) Has been cancelled
CI / cargo-test-sway-lsp (push) Has been cancelled
CI / build-forc-doc-sway-lib-std (push) Has been cancelled
CI / build-forc-test-project (push) Has been cancelled
CI / cargo-build-workspace (push) Has been cancelled
CI / cargo-clippy (push) Has been cancelled
CI / forc-unit-tests (push) Has been cancelled
CI / cargo-run-e2e-test-evm (push) Has been cancelled
CI / forc-run-benchmarks (push) Has been cancelled
CI / forc-pkg-fuels-deps-check (push) Has been cancelled
CI / cargo-test-forc (push) Has been cancelled
CI / cargo-test-workspace (push) Has been cancelled
CI / cargo-unused-deps-check (push) Has been cancelled
CI / pre-publish-check (push) Has been cancelled
github pages / deploy (push) Has been cancelled
CI / verifications-complete (push) Has been cancelled
CI / cargo-run-e2e-test (push) Has been cancelled
CI / cargo-run-e2e-test-release (push) Has been cancelled
CI / cargo-test-forc-debug (push) Has been cancelled
CI / cargo-test-forc-client (push) Has been cancelled
CI / cargo-test-forc-node (push) Has been cancelled
CI / notify-slack-on-failure (push) Has been cancelled
CI / publish (push) Has been cancelled
CI / publish-sway-lib-std (push) Has been cancelled
CI / Build and upload forc binaries to release (push) Has been cancelled
remove archived forc-explore plugin from CI and docs (#7257)
## Description
This repo was [archived ](https://github.com/FuelLabs/forc-explorer )in
July 2024 but was not removed from CI or the docs.
I have update the plugins section of the documentation from forc explore
to `forc-install` which is a
[tool](https://github.com/DarthBenro008/forc-install) from a community
member.

## Checklist

- [x] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2025-06-27 12:53:25 +00:00

2.1 KiB

mdbook-forc-preprocessor

A preprocessor for mdBook to update the Forc commands and plugins section of the Sway book based on the output we get when running forc --help.

This preprocessor is automatically run on every build, as long as the book.toml file contains the preprocessor:

[preprocessor.forc-documenter]

The preprocessor runs with strict mode off by default to enable building the book regardless of errors in the Forc Reference pages. To check if pages should be added or removed, run with the strict environment variable:

MDBOOK_preprocessor__FORC_documenter__STRICT="true" mdbook build docs/book

Usage

Adding a new forc command

Enter a new entry under the Commands section within SUMMARY.md, in this format:

- [forc fmt](./forc_fmt.md)

Adding a new forc plugin

Do the same as the above, with an extra step of adding an installation step within the CI. The preprocessor needs to be aware of the plugin when building the book, since it is calling forc <plugin> --help to generate the documentation. You can add this installation step within ci.yml and gh-pages.yml.

Removing a forc command

Delete the entry from SUMMARY.md.

Removing a forc plugin

Do the same as the above, with an extra step of removing the installation command within ci.yml and gh-pages.yml.

Adding an example

Create a new Markdown file within scripts/mdbook-forc-documenter/examples, named after the desired forc command or plugin in snake case. The preprocessor automatically detects the example if there is a matching forc command or plugin with the same name as the file name, and includes it in the build.

Removing an example

Delete the Markdown file from within the above examples directory.