Intersphinx

sphinx.ext.intersphinx allows the linking of other project documentation.

Configuration

In docs/conf.py Intersphinx must be indicated as an extension:

extensions = [
    ...
    'sphinx.ext.intersphinx',
    ]

External Sphinx documentation can then be specified, e.g. with:

intersphinx_mapping = {
    'python': ('https://docs.python.org/3', None),
    'bokeh':  ('https://bokeh.pydata.org/en/latest/', None)
}

However, alternative files can also be specified for an inventory, for example:

intersphinx_mapping = {
    'python': ('https://docs.python.org/3', (None, 'python-inv.txt'),
    ...
}

Add roles

If you get an error message that a certain text role is unknown, e.g.

WARNING: Unknown interpreted text role "confval".

so you can add them in the conf.py:

def setup(app):
    # from sphinx.ext.autodoc import cut_lines
    # app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))
    app.add_object_type(
        "confval",
        "confval",
        objname="configuration value",
        indextemplate="pair: %s; configuration value",
    )