Commit 4b2ff52
authored
docs(commands): autogenerate full command reference from the registry (#402)
* docs(commands): autogenerate a full command reference page
`docs/guide/commands.md` had a "Planned" section promising per-command
pages that never materialized. Since every command already has a structured
entry in the registry (`cmd/command/`) with summary, usage, subcommands,
and examples, generate the reference instead of writing it by hand.
Extend `tools/cmd/gendocs/main.go` (already run by `make docs`) to also
emit `docs/guide/commands.md` from the registry:
- Table of contents grouped by category (in the same display order as
`ggc help`).
- One section per top-level command, showing summary, aliases, usage,
subcommand table, per-subcommand examples, and top-level examples —
only the fields that are actually populated.
This replaces the 36-line stub with ~720 generated lines covering all
visible commands, and keeps the page in sync with the registry on every
`make docs` run.
* docs(commands): simplify writeCommandSection to satisfy lint
Extract alias / usage / subcommand blocks into small helpers so that
writeCommandSection drops below the repo cyclomatic complexity limit.
Also switch the byCategory loop to indexed iteration to avoid
rangeValCopy on Info (152 bytes).1 parent 6672d3c commit 4b2ff52
2 files changed
Lines changed: 821 additions & 17 deletions
0 commit comments