An MkDocs extension to generate documentation for Click command line applications
Low maintenance activity. Last release 20 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install mkdocs-clickmkdocs-click
An MkDocs extension to generate documentation for Click command line applications.
Originally developed by Datadog.
Installation
Install from PyPI:
pip install mkdocs-click
Quickstart
Add mkdocs-click to Markdown extensions in your mkdocs.yml configuration:
site_name: Example
theme: readthedocs
markdown_extensions:
- mkdocs-click
Add a CLI application, e.g.:
# app/cli.py
import click
@click.group()
def cli():
"""Main entrypoint."""
@cli.command()
@click.option("-d", "--debug", help="Include debug output.")
def build(debug):
"""Build production assets."""
Add a mkdocs-click block in your Markdown:
# CLI Reference
This page provides documentation for our command line tools.
::: mkdocs-click
:module: app.cli
:command: cli
Start the docs server:
mkdocs serve
Tada! 💫

Usage
Documenting commands
To add documentation for a command, add a mkdocs-click block where the documentation should be inserted.
Example:
::: mkdocs-click
:module: app.cli
:command: main
For all available options, see the Block syntax.
Multi-command support
When pointed at a group (or any other multi-command), mkdocs-click will also generate documentation for sub-commands.
This allows you to generate documentation for an entire CLI application by pointing mkdocs-click at the root command.
Tweaking header levels
By default, generates Markdown headers starting at for the root command section. This is generally what you want when the documentation should fill the entire page.