Skip to content

Mkdocs-Apidoc

Version: 0.2.3

Installation

pip install mkdocs-apidoc

Usage

mkdocs-apidoc exposes a set of jinja2 templates for use in your mkdocs project. The most basic usage is to include a markdown file for each module you want to document

In docs/my_module.md

# Some markdown text can do here

{{ auto_module("my-package.my-module") }}

## and more markdown can follow, but neither are needed

And in your mkdocs.yaml

site_name: MkLorum
nav:
    - Home: index.md
    - Auto: my_module.md

plugins:
  - mkdocs_apidoc

And that's it! The module docstring and docstrings for classes, methods and functions are automatically rendered in your site documentation. We've provided some default formatting for how the various components get rendered to markdown, but these can be customized using a jinja2 template in the config.

auto_object

{{ auto_object("package.module.object") }}

Automatically render a class or function object using the normal logic.

auto_module

{{ auto_module("package.module") }}

Insert the parsed documentation for a module, including it's name, docstring, functions and classes.

markdown

{{ markdown("package.module.object") }}

This will call the object's __repr_markdown__ and embed the result. Can be used to do anything you want to, really.