more_autodoc.sourcelink
¶
Source code: sphinx_toolbox/more_autodoc/sourcelink.py
Show a link to the corresponding source code at the top of automodule
output.
New in version 0.6.0.
Enable sphinx_toolbox.more_autodoc.sourcelink
by adding the following
to the extensions
variable in your conf.py
:
extensions = [
...
'sphinx_toolbox.more_autodoc.sourcelink',
]
For more information see https://www.sphinx-doc.org/en/master/usage/extensions#third-party-extensions .
Configuration¶
sphinx_toolbox.more_autodoc.sourcelink
can be configured using the autodoc_default_options
option in conf.py
, or with the :sourcelink:
option flag to automodule
.
-
autodoc_show_sourcelink
¶ -
If
True
, shows a link to the corresponding source code at the top of eachautomodule
directive.
-
:sourcelink:
¶ When passed as an option flag to an
automodule
directive, show a link to the corresponding source code at the top of the output for that module only.
Changed in version 1.1.0: Added support for the :sourcelink:
option flag to automodule
.
API Reference¶
Functions:
|
Process the docstring of a module and add a link to the source code if given in the configuration. |
|
-
sourcelinks_process_docstring
(app, what, name, obj, options, lines)[source]¶ Process the docstring of a module and add a link to the source code if given in the configuration.
-
setup
(app)[source]¶ Setup
sphinx_toolbox.more_autodoc.sourcelink
.- Parameters
app (
Sphinx
) – The Sphinx application.- Return type