Skip to content

Commit

Permalink
Update sway book README (FuelLabs#3983)
Browse files Browse the repository at this point in the history
Closes FuelLabs#3981

---------

Co-authored-by: Joshua Batty <[email protected]>
  • Loading branch information
gr00vytvniks and JoshuaBatty authored Feb 6, 2023
1 parent bdfe0eb commit 4eb4edd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions docs/book/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ You must also install forc plugins that are already documented within the book.
```sh
cargo install --path ./forc-plugins/forc-fmt
cargo install --path ./forc-plugins/forc-lsp
cargo install --path ./forc-plugins/forc-explore
cargo install forc-explore
cargo install --path ./forc-plugins/forc-doc
```

To build book:

```sh
mdbook build
mdbook build docs/book
```

To build the book on strict mode to check if pages should be removed or added within the Forc Reference:

```sh
MDBOOK_preprocessor__FORC_documenter__STRICT="true" mdbook build docs
MDBOOK_preprocessor__FORC_documenter__STRICT="true" mdbook build docs/book
```

To serve locally:

```sh
mdbook serve
mdbook serve docs/book
```

## Generating documentation for Forc commands/plugins

The `mdbook-forc-documenter` [preprocessor](https://rust-lang.github.io/mdBook/for_developers/preprocessors.html) now automatically handles documenting forc commands and plugins, but some actions have to be taken for the preprocessor to work. Please read the [mdbook-forc-documenter README](../scripts/mdbook-forc-documenter/README.md) before making changes to Forc commands or plugins.
The `mdbook-forc-documenter` [preprocessor](https://rust-lang.github.io/mdBook/for_developers/preprocessors.html) now automatically handles documenting forc commands and plugins, but some actions have to be taken for the preprocessor to work. Please read the [mdbook-forc-documenter README](../../scripts/mdbook-forc-documenter/README.md) before making changes to Forc commands or plugins.

**It is important to note that changing the chapter names `Commands` and `Plugins` will affect the behavior of the preprocessor**. When renaming the chapters, please make the same change [here](https://github.com/FuelLabs/sway/blob/a19681c2165402d289bc6bae7a46a580ef3be5b5/scripts/mdbook-forc-documenter/src/lib.rs#L45,L56).
2 changes: 1 addition & 1 deletion scripts/mdbook-forc-documenter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This preprocessor is automatically run on every build, as long as the `book.toml
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](https://rust-lang.github.io/mdBook/format/configuration/environment-variables.html):

```sh
MDBOOK_preprocessor__FORC_documenter__STRICT="true" mdbook build docs
MDBOOK_preprocessor__FORC_documenter__STRICT="true" mdbook build docs/book
```

## Usage
Expand Down

0 comments on commit 4eb4edd

Please sign in to comment.