Skip to main content

Modern Sphinx extension for documenting argparse-based CLI tools

Project description

sphinx-autodoc-argparse

Modern Sphinx extension for documenting argparse-based CLI tools.

A modernized replacement for sphinx-argparse that:

  • Works with Sphinx 8.x and 9.x (no autodoc.mock dependency)
  • Fixes long-standing issues (TOC pollution, heading levels)
  • Provides configurable output (rubrics vs sections, flattened subcommands)
  • Includes Pygments lexers for argparse help output and CLI usage blocks
  • Supports extensibility via renderer classes

Install

$ pip install sphinx-autodoc-argparse

Usage

In your docs/conf.py:

extensions = ["sphinx_autodoc_argparse"]

Then use the .. argparse:: directive:

.. argparse::
   :module: myapp.cli
   :func: create_parser
   :prog: myapp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_autodoc_argparse-0.0.1a30.dev0.tar.gz (42.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file sphinx_autodoc_argparse-0.0.1a30.dev0.tar.gz.

File metadata

File hashes

Hashes for sphinx_autodoc_argparse-0.0.1a30.dev0.tar.gz
Algorithm Hash digest
SHA256 b3c21a54bf752cc4e6c320d63477f017c31de39060f7efb483f08f9d7e7c7a45
MD5 5931e4e461aafdd0ad177a835ca3f70f
BLAKE2b-256 923f864194819d23044108df79a72d1402480d30f0eb45ffd12d88ad9abdecb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_autodoc_argparse-0.0.1a30.dev0.tar.gz:

Publisher: release.yml on git-pull/gp-sphinx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_autodoc_argparse-0.0.1a30.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_autodoc_argparse-0.0.1a30.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 2641f12f6ee05c3c0e082f8a9ed8e466954574712f5bf0b329870b1f8f3bdc58
MD5 7fd0208a3afc0176b3bc0ce061ad00f4
BLAKE2b-256 7b8590feb558558c6969013d6f894bf2332d1a84685a64bfcf29576a5c998e70

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_autodoc_argparse-0.0.1a30.dev0-py3-none-any.whl:

Publisher: release.yml on git-pull/gp-sphinx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page