
## 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.
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.