Repository navigation
Commit c742694
docs: generate a CLI reference from the cobra command tree
talm's only documentation was the README, which never covered the
command surface: five native commands plus everything wrapped from
talosctl, each with its own flags. Writing that by hand would go stale
on the next Talos bump, since the wrapper re-exports whatever upstream
ships.
Render it instead. TestReferenceDocs walks the live command tree and
compares it against the committed pages, so `go test ./...` fails when
the two drift; `make docs` rewrites them. This follows the golden-file
convention already used for the chart render snapshots.
The pages are rendered per command rather than through
doc.GenMarkdownTree, which hardcodes file names carrying a redundant
talm_ prefix and opens each page at H2, leaving no H1 for a docs site to
title it from. Cobra's auto-generated date stamp is also suppressed on
every command, not just those with a parent, so repeated runs agree.
The test skips on Windows: flag defaults are built with filepath.Join,
so the rendered pages carry backslashes there and a byte comparison
fails for reasons unrelated to drift.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <[email protected]>1 parent 1d571ba commit c742694
87 files changed
Lines changed: 3569 additions & 2 deletions
File tree
- docs/reference
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments