sphinx_toolbox.config

Internal configuration for sphinx-toolbox.

Exceptions:

InvalidOptionError

Subclass of ValueError to indicate an invalid value for a configuration value.

MissingOptionError

Subclass of ValueError to indicate a missing configuration option.

Classes:

ToolboxConfig([config, overrides])

Subclass of sphinx.config.Config with type annotations for the configuration values added by sphinx-toolbox.

Functions:

validate_config(app, config)

Validate the provided configuration values.

exception InvalidOptionError[source]

Bases: ValueError

Subclass of ValueError to indicate an invalid value for a configuration value.

exception MissingOptionError[source]

Bases: ValueError

Subclass of ValueError to indicate a missing configuration option.

class ToolboxConfig(config={}, overrides={})[source]

Bases: Config

Subclass of sphinx.config.Config with type annotations for the configuration values added by sphinx-toolbox.

Depending on the extensions enabled not all of these configuration values will be present.

Functionally compatible with sphinx.config.Config.

Attributes:

all_typevars

Document all typing.TypeVars, even if they have no docstring.

assets_dir

The directory in which to find assets for the asset role.

conda_channels

List of required Conda channels.

docutils_tab_width

The tab size used by docutils.

github_issues_url

The base URL for the issues on GitHub.

github_pull_url

The base URL for the pull requests on GitHub.

github_repository

The GitHub repository this documentation corresponds to.

github_source_url

The base URL for the source code on GitHub.

github_url

The complete URL of the repository on GitHub.

github_username

The username of the GitHub account that owns the repository this documentation corresponds to.

no_unbound_typevars

Only document typing.TypeVars that have a constraint of are bound.

rst_prolog

A string of reStructuredText that will be included at the beginning of every source file that is read.

source_link_target

The target of the source link, either 'github' or 'sphinx'.

wikipedia_lang

The Wikipedia language to use for wikipedia roles.

all_typevars

Type:    bool

Document all typing.TypeVars, even if they have no docstring.

assets_dir

Type:    str

The directory in which to find assets for the asset role.

conda_channels

Type:    List[str]

List of required Conda channels.

docutils_tab_width

Type:    int

The tab size used by docutils. This is usually 8 spaces, but can be configured in the docutils.conf file.

github_issues_url

Type:    RequestsURL

The base URL for the issues on GitHub.

github_pull_url

Type:    RequestsURL

The base URL for the pull requests on GitHub.

github_repository

Type:    str

The GitHub repository this documentation corresponds to.

github_source_url

Type:    RequestsURL

The base URL for the source code on GitHub.

github_url

Type:    RequestsURL

The complete URL of the repository on GitHub.

github_username

Type:    str

The username of the GitHub account that owns the repository this documentation corresponds to.

no_unbound_typevars

Type:    bool

Only document typing.TypeVars that have a constraint of are bound.

This option has no effect if all_typevars is False.

rst_prolog

Type:    str

A string of reStructuredText that will be included at the beginning of every source file that is read.

Type:    str

The target of the source link, either 'github' or 'sphinx'. Will be lowercase after validate_config() has run.

wikipedia_lang

Type:    str

The Wikipedia language to use for wikipedia roles.

validate_config(app, config)[source]

Validate the provided configuration values.

See ToolboxConfig for a list of the configuration values.

Parameters
  • app (Sphinx) – The Sphinx application.

  • config (Config)