auto_intersphinx

Sphinx extension to automatically link package documentation from their names.

This package contains a Sphinx plugin that can fill intersphinx mappings based on package names. It simplifies the use of that plugin by removing the need of knowing URLs for various API catologs you may want to cross-reference.

Functions

oneliner(s)

Transforms a multiline docstring into a single line of text.

populate_intersphinx_mapping(app, config)

Main extension method.

rewrap(s)

Re-wrap a multiline docstring into a 80-character format.

setup(app)

Sphinx extension configuration entry-point.

auto_intersphinx.oneliner(s)[source]

Transforms a multiline docstring into a single line of text.

This method converts the multi-line string into a single line, while also dedenting the text.

Parameters:

s (str) – The input multiline string

Return type:

str

Returns:

A single line with all text.

auto_intersphinx.rewrap(s)[source]

Re-wrap a multiline docstring into a 80-character format.

This method first converts the multi-line string into a single line. It then wraps the single line into 80-characters width.

Parameters:

s (str) – The input multiline string

Return type:

str

Returns:

An 80-column wrapped multiline string

auto_intersphinx.populate_intersphinx_mapping(app, config)[source]

Main extension method.

This function is called by Sphinx once it is setup(). It executes the lookup procedure for all packages listed on the configuration parameter auto_intersphinx_packages. If a catalog name is provided at auto_intersphinx_catalog, and package information is not found on the catalogs, but discovered elsewhere (environment, readthedocs.org, or pypi.org), then it is saved on that file, so that the next lookup is faster.

It follows the following search protocol for each package (first match found stops the search procedure):

  1. User catalog (if available)

  2. Built-in catalog distributed with the package

  3. The current Python environment

  4. https://readthedocs.org

  5. https://pypi.org

Parameters:
  • app (Sphinx) – Sphinx application

  • config (Config) – Sphinx configuration

Return type:

None

auto_intersphinx.setup(app)[source]

Sphinx extension configuration entry-point.

This function defines the main function to be executed, other extensions to be loaded, the loading relative order of this extension, and configuration options with their own defaults.

Return type:

dict[str, Any]