Documentation Generator
Generates or updates documentation pages based on the current specs and codebase. Can target specific sections or regenerate everything.
Argument
$ARGUMENTS specifies what to generate. Examples:
user— regenerate all user guide pagesdev— regenerate all developer guide pagesuser/chart— regenerate chart-related user pagesuser/tools— regenerate drawing tools pagesdev/architecture— regenerate the architecture pageall— regenerate everything- (empty) — show current doc coverage status
Procedure
1. If no argument: show doc coverage
List all pages in docs/src/SUMMARY.md and check which files exist and which are missing or empty.
Report format:
=== DOCUMENTATION COVERAGE ===
User Guide:
✅ user/getting_started.md (exists, 45 lines)
✅ user/chart/navigation.md (exists, 62 lines)
⚠️ user/chart/multi_pane.md (empty or missing)
Dev Guide:
✅ dev/architecture.md (exists, 180 lines)
⚠️ dev/plugin_guide.md (empty or missing)
Coverage: 28/35 pages present (80%)
2. If argument provided: generate pages
For each page in scope:
a. Identify the spec source: find the matching spec file(s) in specs/
b. Read the spec: extract behaviors, states, descriptions
c. Read the current code: understand what's actually implemented
d. Write the doc page:
- User pages: plain language, no code, explain what and how to use. Add
> Spec source: specs/...at the bottom. - Dev pages: technical language, code examples, architecture diagrams. Reference actual crate names and trait names.
e. Verify: run
mdbook build docsto check for broken links or formatting errors
3. Update SUMMARY.md if needed
If new pages were created that aren't in SUMMARY.md, add them in the appropriate section.
4. Final verification
bash1mdbook build docs
Report any build errors.
Rules
- User docs are for non-developers — no Rust code, no technical jargon
- Dev docs are for Rust developers — include code snippets, API references, trait names
- Always reference the spec source at the bottom of user pages
- Language: English only
- Do not invent features — only document what exists in specs or code
- Build must pass after changes