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:
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, orall).--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 byclass,function,enum,attribute.--sort:source-orderoralpha.--flatten: Emit a single output file.--index-title: Override root index title.--docstring-style:raw,python-fences, orpreserve.--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
--cleandeletes 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rdocgen-0.1.1.tar.gz.
File metadata
- Download URL: rdocgen-0.1.1.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dd0a84998e49707eb63a4f271503733a5fb39928118537b0cefa3ebcc3863b3
|
|
| MD5 |
d4cdd2a565e884e6d53bdeeb0f53c753
|
|
| BLAKE2b-256 |
283101788dd13fcb07d9fc11405fe413b88420b3bed606245b6d7d91a1164532
|
File details
Details for the file rdocgen-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rdocgen-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17d2a5c78a0a5dbfed5130eb3a71c1da7b53b13916a83d0ff8e4c42177b89821
|
|
| MD5 |
150373a277b7d1545142074b2d89474e
|
|
| BLAKE2b-256 |
1c5aeb58bb7fa620261e88273282acf979a069f0855f753978e2de82d1b61bbf
|