Python Source Docs

Use the optional python_docs plugin to turn Python modules into source-backed documentation pages.

The plugin only runs when it is explicitly listed in hooks and enabled in its config section.

Example

[markata-go]
hooks = ["default", "python_docs"]

[markata-go.python_docs]
enabled = true
patterns = ["src/**/*.py", "pkg/**/*.py"]
exclude = ["**/tests/**", "**/.venv/**"]
slug_prefix = "api"
template = "docs"
include_source = true
include_module_code = false
published = false

This creates one generated post per discovered Python module.

Examples:

What Gets Rendered

For each module, the plugin generates markdown that includes:

Cross-Linking

When multiple modules are documented together, the plugin links internal references where possible.

Supported cases include:

Common Options

[markata-go]
hooks = ["default", "python_docs"]

[markata-go.python_docs]
enabled = true
patterns = ["src/**/*.py"]
directories = ["pkg", "scripts"]
exclude = ["**/tests/**"]
use_gitignore = true
slug_prefix = "reference"
template = "docs"
published = false
include_private = false
include_source = true
include_module_code = false
tags = ["python", "docs"]
interpreter = "python3"

Notes