MkDocs-Click is an MkDocs extension designed to automatically generate comprehensive documentation for Click command-line applications. It parses Click command structures and renders them directly into MkDocs pages, including options, arguments, and subcommands. The current version is 0.9.0, and it maintains an active release cadence, adapting to changes in both MkDocs and Click.
pip install mkdocs-clickVerified import paths — ran on the pinned version, not inferred.
To use mkdocs-click, first install it alongside MkDocs. Then, configure your `mkdocs.yml` to include the `mkdocs-click` extension. Create a Python file containing your Click application and reference it in your Markdown file using the `mkdocs-click` directive. The example shows a basic Click CLI and its integration into an MkDocs project.
Upgrade Python to 3.9 or higher.
Refer to the mkdocs-click `install_requires` for the supported Click version range and ensure your project's Click dependency falls within this range.
Review generated documentation if you upgrade from versions prior to 0.3.0 to ensure the `--help` option display is as desired. Use the `:exclude:` option if you need to manually hide it.
Upgrade to version 0.8.1 or newer. If using an older version, ensure there is an explicit newline after the `:::` block.