sphinxcontrib-typer
A Sphinx directive for auto generating docs for Typer (and Click commands!) using the rich console formatting available in Typer. This package generates concise command documentation in text, html or svg formats out of the box, but if your goal is to greatly customize the generated documentation sphinx-click may be more appropriate and will also work for Typer commands.
See the github repository for issue tracking and source code and install from
PyPI with pip install sphinxcontrib-typer
.
For example, commands and subcommands are renderable separately in four different formats:
svg
html
text
png
Usage: example bar [OPTIONS]
This is the bar command.
╭─ Options ────────────────────────────────────────────────────────────────────────────────╮
│ * --names TEXT The names of the items to bar. [default: None] [required] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────╯
The typer
directive has options for generating docs for all subcommands as
well and optionally generating independent sections for each. There are also
mechanisms for passing options to the underlying console and svg generation
functions. See table of contents for more information.