sphinxcontrib_django
This is a sphinx extension which improves the documentation of Django apps.
- sphinxcontrib_django.setup(app: Sphinx) dict
Allow this module to be used as sphinx extension.
Setup the two sub-extensions
docstringsandroleswhich can also be imported separately.- Parameters:
app – The Sphinx application object
Docstrings
Roles
This module adds cross-reference types which are used in the documentation of Django and Sphinx to allow intersphinx mappings to these custom types. The supported text roles are:
Django:
:setting:, e.g.:setting:`INSTALLED_APPS`renders asINSTALLED_APPS:templatetag:, e.g.:templatetag:`block`renders asblock:templatefilter:, e.g.:templatefilter:`add`renders asadd:fieldlookup:, e.g.:fieldlookup:`equals`renders asequals
Sphinx:
:event:, e.g.:event:`autodoc-skip-member`renders asautodoc-skip-member:confval:, e.g.:confval:`extensions`renders asextensions
This module can also be used separately in conf.py:
extensions = [
"sphinxcontrib_django.roles",
]
- sphinxcontrib_django.roles.add_default_intersphinx_mappings(app: Sphinx, config: Config) None
This function provides a default intersphinx mapping to the documentations of Python, Django and Sphinx if
intersphinx_mappingis not given inconf.py.Called on the
config-initedevent.- Parameters:
app – The Sphinx application object
config – The Sphinx configuration
- sphinxcontrib_django.roles.setup(app: Sphinx) dict
Allow this module to be used as Sphinx extension.
This is also called from the top-level
setup().It adds cross-reference types via
add_crossref_type().- Parameters:
app – The Sphinx application object