Skip to content

python-variants/sphinx_autodoc_variants

Repository files navigation

sphinx_autodoc_variants

image

An extension for sphinx to allow automatic documentation of variants functions.

Overview

The default sphinx.ext.autodoc module does not handle function groups with variants created by the variants module correctly. This extension registers an automatic documenter that detects variant functions and methods and enables documentation of both the primary and variant functions.

To use this with your project that uses variants, first install this extension with pip (or, preferably, add this to the documentation dependencies):

pip install sphinx_autodoc_variants

With this installed, add 'sphinx_autodoc_variants' to the extensions variable of your conf.py, e.g.:

extensions = ['sphinx.ext.autodoc',
              'sphinx.ext.viewcode',
              'sphinx_autodoc_variants']

This will enable proper documentation of variants functions under .. automodule or other autodoc directives.

If you want to explicitly document a variants function group, use .. autoprimary_function for functions and .. autoprimary_method for methods.

About

Sphinx extension to autodoc variants

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages