sphinxcontrib_django2¶
This is a sphinx extension which improves the documentation of Django apps.
-
sphinxcontrib_django2.
setup
(app)¶ Allow this module to be used as sphinx extension.
Setup the two sub-extensions
docstrings
androles
which can also be imported separately.- Parameters
app (Sphinx) – 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_django2.roles",
]
-
sphinxcontrib_django2.roles.
add_default_intersphinx_mappings
(app, config)¶ This function provides a default intersphinx mapping to the documentations of Python, Django and Sphinx if
intersphinx_mapping
is not given inconf.py
.Called on the
config-inited
event.
-
sphinxcontrib_django2.roles.
setup
(app)¶ 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 (Sphinx) – The Sphinx application object