Skip to content

A Sphinx plugin to automatically document click-based applications

License

Notifications You must be signed in to change notification settings

click-contrib/sphinx-click

Folders and files

NameName
Last commit message
Last commit date

Latest commit

dc11fe1 · Dec 28, 2024
May 14, 2024
May 14, 2024
Jul 31, 2023
May 15, 2024
Dec 28, 2024
May 15, 2024
Jan 9, 2018
Jul 4, 2022
Dec 28, 2024
May 14, 2024
Apr 5, 2017
Dec 6, 2022
Dec 28, 2024
May 15, 2024
Nov 21, 2023
Aug 17, 2022
May 15, 2024

Repository files navigation

sphinx-click

Build Status Documentation Status

sphinx-click is a Sphinx plugin that allows you to automatically extract documentation from a Click-based application and include it in your docs.

Installation

Install the plugin using pip:

$ pip install sphinx-click

Alternatively, install from source by cloning this repo then running pip locally:

$ pip install .

Usage

Important

To document a Click-based application, both the application itself and any additional dependencies required by that application must be installed.

Enable the plugin in your Sphinx conf.py file:

extensions = ['sphinx_click']

Once enabled, you can now use the plugin wherever necessary in the documentation.

.. click:: module:parser
   :prog: hello-world
   :nested: full

Detailed information on the various options available is provided in the documentation.

Alternative

This plugin is perfect to document a Click-based CLI in Sphinx, as it properly renders the help screen and its options in nice HTML with deep links and styling.

However, if you are looking to document the source code of a Click-based CLI, and the result of its execution, you might want to check out click-extra. The latter provides the .. click:example:: and .. click:run:: Sphinx directives so you can capture and render, with full colors, the result of your CLI in your documentation.