mkdocstrings-python-legacy

0.2.7 · active · verified Thu Apr 16

mkdocstrings-python-legacy is a Python handler for the mkdocstrings documentation generator. It facilitates the automatic collection of documentation from Python source code, relying on `pytkdocs` for data extraction. The handler supports popular docstring styles like Google, Numpydoc, and reStructuredText. While actively maintained, receiving updates as recently as May 2025, it is considered a legacy component, and users are strongly advised to migrate to the newer `mkdocstrings-python` handler, which offers improved functionality based on Griffe.

Common errors

Warnings

Install

Quickstart

To use mkdocstrings-python-legacy, first ensure it's installed. Then, configure your `mkdocs.yml` file to include `mkdocstrings` in the plugins section and specify the `python` handler within `mkdocstrings.handlers`. You'll need to define `paths` to indicate where your Python source code is located. Once configured, you can inject documentation into your Markdown files using the `:::` syntax, followed by the Python object's dotted path.

# mkdocs.yml
plugins:
  - mkdocstrings:
      handlers:
        python:
          paths: [src] # Adjust to your source code directory
          options:
            docstring_style: google # or numpy, restructured-text
            members: !docstrings_replace # Example: show only documented members

# docs/index.md
# ::: my_package.my_module

view raw JSON →