Skip to main content

An MkDocs plugin to generate documentation for a rich argparse parser

Project description

Mkdocs rich argparse

github repo badge github license badge RSD workflow pypi badge fair-software badge CI

An MkDocs plugin to generate documentation for a rich argparse parser. It renders commands, sub commands and sub-sub commands which can have rich help messages.

Installation

Install from Pypi:

pip install mkdocs-rich-argparse

Usage

In your mkdocs.yml configuration file, add the plugin and configure it with the module and factory to document:

plugins:
    - mkdocs-rich-argparse:
        module: my_module
        factory: my_factory_function

nav:
   - CLI Reference: cli.md

Where my_module is the Python module containing your argparse parser factory function, and my_factory_function is the specific function that returns an argparse parser object. It should be callable without arguments. You can optionally add path to specify the path to the module if it's not in the Python path.

When serving or building your MkDocs site, the plugin will generate a cli.md file containing the documentation for the specified argparse parser.

See the example/ directory for a minimal example and a custom styled example.

Screenshot of example

Colors in Continuous Integration

If you are building the mkdocs site in a Continuous Integration (CI) environment, the colors might not render correctly. To fix this add TTY_COMPATIBLE=1 and TTY_INTERACTIVE=0 environment variables to your CI configuration.

For example in GitHub Actions add the following to your workflow file:

env:
    TTY_COMPATIBLE: '1'
    TTY_INTERACTIVE: '0'

Contributing

If you want to contribute to the development of mkdocs_rich_argparse, have a look at the contribution guidelines.

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

mkdocs_rich_argparse-0.1.3.tar.gz (178.7 kB view details)

Uploaded Source

Built Distribution

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

mkdocs_rich_argparse-0.1.3-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_rich_argparse-0.1.3.tar.gz.

File metadata

  • Download URL: mkdocs_rich_argparse-0.1.3.tar.gz
  • Upload date:
  • Size: 178.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mkdocs_rich_argparse-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8354cc76ed08e316c3a42b359faf0dceb19ca2312ea4e6643ba85c258ab906b2
MD5 832ac6ac10a742c62e6c33d62b8ac2ba
BLAKE2b-256 d9ca9d7ece07900e162e69b76a0e288d101ff24d0ca3dfb85c52402a85c454f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_rich_argparse-0.1.3.tar.gz:

Publisher: pypi-publish.yml on i-VRESSE/mkdocs_rich_argparse

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

File details

Details for the file mkdocs_rich_argparse-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_rich_argparse-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e137de0e86a824dba87bdc60e1c0c218ed43fa12ccce63f1f99cd0fe22f1abd4
MD5 d543bfc6e83d1e335743140605e969cc
BLAKE2b-256 c0553cc3955e7665f2a5896645479d429cf1bb959319679f9a6c98c33236888e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_rich_argparse-0.1.3-py3-none-any.whl:

Publisher: pypi-publish.yml on i-VRESSE/mkdocs_rich_argparse

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