Skip to content

🐛 fix(docs): auto-generate manpage from CLI parser#3911

Merged
gaborbernat merged 9 commits intotox-dev:mainfrom
gaborbernat:3878
Mar 30, 2026
Merged

🐛 fix(docs): auto-generate manpage from CLI parser#3911
gaborbernat merged 9 commits intotox-dev:mainfrom
gaborbernat:3878

Conversation

@gaborbernat
Copy link
Copy Markdown
Member

The static RST manpage shipped broken section headers — all sections used top-level #### overlines instead of subsection underlines, producing an empty .TH header and missing .SH directives in the generated troff. The manpage also only documented 6 of the 11 available commands and omitted most global options like --colored, --root, --version, and --no-provision. 📄

The manpage RST is now generated at wheel build time from the actual argparse parser via _get_parser_doc(). Commands, aliases, and options are extracted directly from the parser so the manpage stays in sync with the CLI automatically. Static sections (FILES, ENVIRONMENT VARIABLES, SEE ALSO, AUTHOR) remain hand-written since they document things outside the parser. The docutils writer_name parameter was also updated to the non-deprecated writer form.

The static docs/man/tox.1.rst and the unused Sphinx man_pages config have been removed since the wheel build hook now owns manpage generation entirely. 🧪 Tests validate both the troff structure (.TH metadata, .SH sections, Name content) and that every parser command and option appears in the output.

Fixes #3878

The static RST manpage had broken section headers (all top-level `####`
overlines) producing empty `.TH` metadata and missing `.SH` sections.
It also only documented 6 of 11 commands and a subset of options.

Generate the manpage RST from the actual argparse parser at wheel build
time so commands and options stay in sync automatically. Tests validate
troff output structure and verify all parser commands/options appear.
@gaborbernat gaborbernat added bug:normal affects many people or has quite an impact area:documentation labels Mar 30, 2026
The static RST manpage had broken section headers (all top-level `####`
overlines) producing empty `.TH` metadata and missing `.SH` sections.
It also only documented 6 of 11 commands and a subset of options.

Regenerate the RST with proper heading hierarchy from the argparse
parser via `tools/generate_manpage.py`. The build hook reads the static
file (avoiding runtime deps at build time), while tests verify the file
stays in sync with the actual CLI. Added changelog fragment.
@gaborbernat gaborbernat merged commit b232d2d into tox-dev:main Mar 30, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:documentation bot:chronographer:provided bug:normal affects many people or has quite an impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple issues with the new tox manpage

2 participants