The sectiondoc extension parses the function and class docstrings as they are retrieved by the autodoc extension and converts the section blocks into sphinx friendly rst.
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
sectiondoc
.codecov.yml
.coveragerc
.gitignore
.travis.yml
AUTHORS.txt
CHANGELOG.txt
LICENSE.txt
README.rst
codecov.yml
setup.py
travis-ci-requirements.txt

README.rst

Sectiondoc: Docstring section rendering sphinx extension

Build status Coverage status Documentation Status

The sectiondoc extension parses the function and class docstrings as they are retrieved by the autodoc extension and renders the section blocks into sphinx friendly rst. The extension shares similarities with alternatives (such as numpydoc) but aims at reflecting the original form of the docstring and support project specific customizations.

Key features of sectiondoc are:

  • Do not change the order of sections.
  • Allow sphinx directives between (and inside) section blocks.
  • Custom rendering styles

Note

Sectiondoc should work with sphinx >= 0.4 that provides the autodoc-process-docstring hook.

Repository

The sectiondoc extension lives at Github. You can clone the repository using:

$ git clone https://github.com/enthought/sectiondoc.git

Installation

Install sectiondoc from pypi using pip:

$ pip install sectiondoc

Install the latest developing version using:

$ pip install git+https://github.com/enthought/sectiondoc.git#egg=sectiondoc

Usage

Styles can be selected by referencing in conf.py the module they are defined:

extensions = [
    ...,
    'sectiondoc.styles.legacy',
    ...,
]