Skip to main content

Markdown documentation generator from python source code

Project description

rdocgen

rdocgen is an alternative to python documentation generators that use standard docstrings. It uses inline comments as the source of descriptions and exports documentation in markdown files compatible with SSG tools such as VitePress.

Write documentation like this:

def example_function(
    value: int,  # input integer
    label: Optional[str] = None,  # optional label
) -> str:

Generated VitePress documentation will look like: function docs example

Why?

  • It is simpler than docstrings.
  • It provides a single source of truth, so documentation drift is less likely.

Use this project only if you do not rely on standard docstring tooling.

Usage

Single file

rdocgen -c path/to/module.py -o ./out_docs

When -c points to a single file, rdocgen writes a single output file (index.md by default) with all content for that file.

Directory

rdocgen -c path/to/package -o ./out_docs

Include / exclude files

rdocgen -c src -o ./out_docs \
  --include-path "rdocgen/**" \
  --exclude-path "**/tests/**"

Control hierarchy and output

rdocgen -c src -o ./out_docs \
  --module-depth 2 \
  --project-name "My SDK" \
  --flatten \
  --index-title "API"

Visibility and types

rdocgen -c src -o ./out_docs \
  --include-private \
  --include-dunder \
  --include-types class,function

Docstring rendering

rdocgen -c src -o ./out_docs \
  --docstring-style python-fences \
  --code-fence-language python \
  --code-fence-suffix "copy showLineNumbers"

CLI flags (high level)

  • --code / -c: File or directory to parse.
  • --outdir / -o: Output directory.
  • --include-path / --exclude-path: Glob filters (repeatable).
  • --module-depth: Grouping depth (1, 2, or all).
  • --project-name: Override the project name shown in indexes.
  • --clean / --no-clean: Control output dir deletion (default is no deletion).
  • --force: Allow deleting protected directories like .git.
  • --dry-run: Print planned actions without writing files.
  • --include-private / --include-dunder: Include hidden members.
  • --include-types / --exclude-types: Filter by class,function,enum,attribute.
  • --sort: source-order or alpha.
  • --flatten: Emit a single output file.
  • --index-title: Override root index title.
  • --docstring-style: raw, python-fences, or preserve.
  • --code-fence-language: Default language for unlabeled fences.
  • --code-fence-suffix: Extra tokens for opening fences (e.g., copy showLineNumbers).
  • --output-extension: Override .md/.mdx.
  • --fail-on-parse-error: Abort on invalid Python files.

Notes

  • --clean deletes the contents of the output directory, not the directory itself.
  • Without --force, cleanup is blocked if the output dir contains hidden files, symlinks, or files that are not .md/.mdx.
  • This project only reads source files; it does not execute code.

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

rdocgen-0.1.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

rdocgen-0.1.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file rdocgen-0.1.0.tar.gz.

File metadata

  • Download URL: rdocgen-0.1.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rdocgen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 de3bd86a43ca002368b9c54eb8f52817bb6cab60ccfb8e3c63921e7758bfde40
MD5 60806aa03e243bda7887fec28cb7276e
BLAKE2b-256 fa9be8867f0c36e6e52840fcc3f1df4db4b51aa161f241c0bd04974fd45fec89

See more details on using hashes here.

File details

Details for the file rdocgen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rdocgen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rdocgen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59410b6a3d509044e96d7154f9e2b0af627fdf5adcb7de397def0f2c0afbb527
MD5 e46f36f3f5fcc58e870fbbf313fec0f3
BLAKE2b-256 a89779aec05d0833467cec8d6c468f0b6f5ad29c6194788d08664703050c9a06

See more details on using hashes here.

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