Skip to content

mkdocstrings

As of 0.0.11, Zensical provides preliminary support for mkdocstrings, which allows rendering API reference documentation from source code. We'll be rethinking API reference documentation from the ground up in the coming months, making it much more flexible and powerful.

Preliminary support

The mkdocstrings integration is preliminary, which means some features are not yet supported, specifically cross-references and backlinks. We're working on bringing these features into Zensical.

Installation

mkdocstrings is not included with Zensical by default, so it needs to be installed separately:

pip install mkdocstrings-python
uv add mkdocstrings-python

Configuration

Configure mkdocstrings as a plugin:

[project.plugins.mkdocstrings.handlers.python]
inventories = ["https://docs.python.org/3/objects.inv"]
paths = ["src"]

[project.plugins.mkdocstrings.handlers.python.options]
docstring_style = "google"
inherited_members = true
show_source = false
plugins:
  - mkdocstrings:
      handlers:
        python:
          paths: [src]
          inventories:
            - https://docs.python.org/3/objects.inv
          options:
            docstring_style: google
            inherited_members: true
            show_source: false

The complete list of options can be found here: