Extensions¶
See also
Built-in extensions¶
- sphinx.ext.autodoc
embeds documentation from docstrings.
- sphinx.ext.autosummary
generates summaries of functions, methods, and attributes from docstrings.
- sphinx.ext.autosectionlabel
references sections using the title.
- sphinx.ext.graphviz
renders Graphviz graphs.
- sphinx.ext.ifconfig
includes content only under certain conditions.
- sphinx.ext.intersphinx
allows the inclusion of other project documentation.
- sphinx.ext.mathjax
renders mathematical formulas using JavaScript.
- sphinx.ext.napoleon
supports NumPy and Google Style docstrings.
- sphinx.ext.todo
supports to-do items.
- sphinx.ext.viewcode
adds links to the source code of the Sphinx documentation.
See also
Third-party extensions¶
- Breathe
ReStructuredText and Sphinx bridge to Doxygen.
- sphinx-autobuild
monitors a Sphinx repository and generates new documentation as soon as changes are made.
- sphinx-autodoc-typehints
support for type hints for the Sphinx autodoc extension.
- nbsphinx
Jupyter notebooks in Sphinx
- sphinxcontrib-mermaid
allows you to embed Mermaid graphics in your documents.
- numpydoc
NumPy Sphinx extension
- Sphinx-Needs
allows the definition, linking and filtering of need objects, such as requirements and test cases.
- jupyter-sphinx
enables the rendering of interactive Jupyter widgets in Sphinx.
- Releases
writes a
CHANGELOG
file.- Sphinx Lint
based on rstlint.py from CPython.
- sphinx-intl
Sphinx extension for translations.
- sphinx-jsonschema
displays a JSON Schema in the Sphinx documentation.
- sphinx-toolbox
Toolbox for Sphinx with many useful tools.
- Sphinx Sitemap Generator Extension
generates multiversion and multilanguage sitemaps for the HTML version.
- sphinx-issues
creates links to GitHub or GitLab issues, pull requests and user profiles.
- Sphinx-pyreverse
creates a UML diagram of Python modules.
- Sphinx-Test-Reports
displays test results within Sphinx documentation.
- Sphinx Gitstamp Generator Extension
inserts Git timestamps in context, for example in a Jinja template:
{%- if gitstamp %} Diese Seite wurde zuletzt aktualisiert am {{ gitstamp }}. {%- endif %}
See also
- sphinx-contrib
A repository of Sphinx extensions maintained by their respective authors.
- sphinx-extensions
Curated site with Sphinx extensions with live examples and their configuration.
Custom extensions¶
Local extensions in a project should be specified relative to the documentation.
The corresponding path is specified in the Sphinx configuration file
docs/conf.py
. If your extension is located in the exts
directory in
the file foo.py
, then the conf.py
file should look like this:
import sys
import os
sys.path.insert(0, os.path.abspath("exts"))
extensions = ["foo", ...]