Python API documentation for MkDocs.
This markdown extension adds autodoc style support, for use with MkDocs.
[...]
markdown_extensions:
- admonition
- codehilite
- mkautodocThis will depend on how your documentation building is setup, but
you may need to use pip install -e . or modify PYTHONPATH in your docs build script.
# API documentation
::: my_library.some_function
:docstring:
::: my_library.SomeClass
:docstring:
:members:Update your mkdocs.yml to include some custom CSS.
[...]
extra_css:
- css/custom.cssThen add a css/custom.css file to your documentation.
div.autodoc-docstring {
padding-left: 20px;
margin-bottom: 30px;
border-left: 5px solid rgba(230, 230, 230);
}
div.autodoc-members {
padding-left: 20px;
margin-bottom: 15px;
}Renders the docstring of the associated function, method, or class.
Renders documentation for member attributes of the associated class.
Currently handles methods and properties.
Instance attributes set during __init__ are not currently recognised.
May optionally accept a list of member attributes that should be documented. For example:
::: my_library.SomeClass
:docstring:
:members: currency vat_registered calculate_expenses