sphinx-toolbox Logo
3.4.0
  • Home

Extensions

  • Overview
  • assets
  • changeset
  • code
  • collapse
  • confval
  • decorators
  • documentation_summary
  • flake8
  • formatting
  • github
  • installation
  • issues
  • latex
  • pre_commit
  • rest_example
  • shields
  • sidebar_links
  • source
  • wikipedia
  • more_autodoc
    • more_autodoc.augment_defaults
    • more_autodoc.autonamedtuple
    • more_autodoc.autoprotocol
    • more_autodoc.autotypeddict
    • more_autodoc.generic_bases
    • more_autodoc.genericalias
    • more_autodoc.no_docstring
    • more_autodoc.overloads
    • more_autodoc.regex
    • more_autodoc.sourcelink
      • Configuration
        • autodoc_show_sourcelink
      • API Reference
        • sourcelinks_process_docstring
        • setup
    • more_autodoc.typehints
    • more_autodoc.typevars
    • more_autodoc.variables
    • setup
  • more_autosummary
  • tweaks
  • Changelog

Developer API

  • sphinx_toolbox
  • sphinx_toolbox.config
  • sphinx_toolbox.testing
  • sphinx_toolbox.utils

Links

  • GitHub
  • PyPI
  • Contributing Guide
  • Downloading source code
  • License
sphinx-toolbox
  • Docs »
  • more_autodoc »
  • more_autodoc.sourcelink
  • Edit on GitHub

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¶
Type: bool
Default: False

If True, shows a link to the corresponding source code at the top of each automodule 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:

sourcelinks_process_docstring(app, what, …)

Process the docstring of a module and add a link to the source code if given in the configuration.

setup(app)

Setup sphinx_toolbox.more_autodoc.sourcelink.

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.

Parameters
  • app (Sphinx) – The Sphinx application.

  • what

  • name (str) – The name of the object being documented.

  • obj – The object being documented.

  • options (Mapping[str, Any]) – Mapping of autodoc options to values.

  • lines (List[str]) – List of strings representing the current contents of the docstring.

setup(app)[source]¶

Setup sphinx_toolbox.more_autodoc.sourcelink.

Parameters

app (Sphinx) – The Sphinx application.

Return type

SphinxExtMetadata

Next Previous

© Copyright 2020-2022 Dominic Davis-Foster Revision 8ad046b1 .

Built with Sphinx 3.5.4 using a theme provided by Read the Docs. Show Source.
Read the Docs v: latest
Versions
latest
stable
v3.4.0
v3.3.0
v3.2.0
v3.1.2
v3.1.1
v3.1.0
v3.0.0
v2.18.3
v2.18.2
v2.18.1
v2.18.0
2.18.x
v2.17.0
v2.16.1
v2.16.0
v2.15.3
v2.15.2
v2.15.1
v2.15.0
v2.14.1
v2.13.x
Downloads
pdf
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.