Skip to main content

Generate MDX API documentation from Python modules

Project description

mdxify

Generate MDX API documentation from Python modules with automatic navigation structure.

Installation

pip install mdxify

Usage

Generate documentation for all modules in a package:

mdxify --all --root-module mypackage --output-dir docs/python-sdk

Generate documentation for specific modules:

mdxify mypackage.core mypackage.utils --output-dir docs/python-sdk

Exclude internal modules from documentation:

mdxify --all --root-module mypackage --exclude mypackage.internal --exclude mypackage.tests

Options

  • modules: Specific modules to document
  • --all: Generate documentation for all modules under the root module
  • --root-module: Root module to generate docs for (required when using --all)
  • --output-dir: Output directory for generated MDX files (default: docs/python-sdk)
  • --update-nav/--no-update-nav: Update docs.json navigation (default: True)
  • --skip-empty-parents: Skip parent modules that only contain boilerplate (default: False)
  • --anchor-name: Name of the navigation anchor to update (default: 'SDK Reference')
  • --exclude: Module to exclude from documentation (can be specified multiple times). Excludes the module and all its submodules.

Navigation Updates

mdxify can automatically update your docs.json navigation in two ways:

  1. First run: Add a placeholder in your docs.json:
{
  "navigation": [
    {
      "anchor": "SDK Reference",
      "groups": [
        {
          "group": "Modules", 
          "pages": [
            {"$mdxify": "generated"}
          ]
        }
      ]
    }
  ]
}
  1. Subsequent runs: mdxify will find and update the existing anchor directly - no placeholder needed!

The navigation structure uses the --anchor-name parameter (default: "SDK Reference") to identify which section to update.

Features

  • Fast AST-based parsing - No module imports required
  • MDX output - Compatible with modern documentation frameworks
  • Automatic navigation - Generates hierarchical navigation structure
  • Google-style docstrings - Formats docstrings using Griffe
  • Smart filtering - Excludes private modules and known test patterns

Development

# Install development dependencies
uv sync

# Run tests
uv run pytest

# Run type checking
uv run ty check

# Run linting
uv run ruff check src/ tests/

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

mdxify-0.2.10.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.

mdxify-0.2.10-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file mdxify-0.2.10.tar.gz.

File metadata

  • Download URL: mdxify-0.2.10.tar.gz
  • Upload date:
  • Size: 42.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mdxify-0.2.10.tar.gz
Algorithm Hash digest
SHA256 9cf7fbd08eff13705dc643ca6ff5155b8d511318bed6574ef458205be12e5529
MD5 549e35cb8d09d7e8c11b618887835c0e
BLAKE2b-256 62cbfa3779d670a244d9c69c90cb0be99a4d4c1e5ad9a08d0b8820d3f6702c62

See more details on using hashes here.

File details

Details for the file mdxify-0.2.10-py3-none-any.whl.

File metadata

  • Download URL: mdxify-0.2.10-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mdxify-0.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 87bbb20e213c97a45681d48ef5e1d4202fcd789e575450a914262b462f3ba91e
MD5 ec61bc3e96cebeaba6a8bd921650df82
BLAKE2b-256 c7b5bef88604553aecd1503a4fea509427a5e28fab6109d45b29163243d0324c

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