module sphinxext.sphinxext_helper

Short summary

module pyquickhelper.sphinxext.sphinxext_helper

Helpers for sphinx extensions.

source on GitHub

Functions

function

truncated documentation

get_env_state_info

Retrieves an environment and a docname inside a directive.

try_add_config_value

Add a variables in the config file if it does not have it yet.

Documentation

Helpers for sphinx extensions.

source on GitHub

pyquickhelper.sphinxext.sphinxext_helper.get_env_state_info(self)[source]

Retrieves an environment and a docname inside a directive.

Parameters:

self – self inside a Sphinx directive

Returns:

env, docname, lineno

source on GitHub

pyquickhelper.sphinxext.sphinxext_helper.try_add_config_value(app, name, default, rebuild, type_s=())[source]

Add a variables in the config file if it does not have it yet.

Parameters:
  • app – Sphinx application

  • name – name of the variable

  • default – default value

  • rebuild – see below

  • type_s – expected types

Returns:

True if added, False if already present.

Rebuilds can be (source: Sphinx.add_config_value):

  • ‘env’ if a change in the setting only takes effect when a document is parsed - this means that the whole environment must be rebuilt.

  • ‘html’ if a change in the setting needs a full rebuild of HTML documents.

  • ‘’ if a change in the setting will not need any special rebuild.

source on GitHub