Documentation Workflow
The documentation lives in an mdBook located under docs/. Follow this loop to keep it healthy:
- Edit chapters under
docs/src/. UpdateSUMMARY.mdwhenever you add, remove, or move a page so the navigation stays accurate. - Run
mdbook build docsto generate the HTML output locally. The build directory defaults todocs/build/. - Validate code samples with
mdbook test docs. It compiles Rust snippets and catches copy-and-paste errors early. - Lint Markdown links and anchors with
mdbook-lintormdbook-linkcheck. Install them viacargo install mdbook-lint mdbook-linkcheckand wire into CI. - Commit both content and configuration (
docs/book.toml,docs/src/SUMMARY.md). Avoid committing the generatedbuild/output.
When writing pages:
- Prefer short headings and consistent hierarchy to keep the sidebar readable. Break long procedures into numbered lists.
- Use fenced code blocks (
```bash,```toml) so syntax highlighting works in the rendered book. - Hide boilerplate lines with mdBook's extension syntax (
#-prefixed hidden lines,// fn main() { # }, etc.) when the snippet needs to compile but should stay focused on the key lines. - Test external links periodically; mdBook's link checker helps catch outdated URLs during CI runs.
For automated environments, integrate the following into mise or CI job steps:
mdbook build docs
mdbook test docs
mdbook lint docs # provided by mdbook-lint
Running these alongside mise run fmt, mise run lint, and mise run test keeps code and docs aligned.