module sphinxext.sphinx_ext_helper

Inheritance diagram of pyquickhelper.sphinxext.sphinx_ext_helper

Short summary

module pyquickhelper.sphinxext.sphinx_ext_helper

Few helpers for Sphinx.

source on GitHub

Classes

class

truncated documentation

NodeEnter

Returned by function traverse().

NodeLeave

Returned by function traverse().

TinyNode

Returned by traverse().

WrappedNode

Wraps a docutils node.

Functions

function

truncated documentation

_get_data

Loads file objects.inv generated by extension sphinx.ext.intersphinx.

get_index

Retrieves documentation data for a specific module.

info_blocref

Log information with Sphinx.

sphinx_lang

Returns the language defined in the configuration file.

traverse

Enumerates through all children but insert a node whenever digging or leaving the childrens nodes.

Methods

method

truncated documentation

__init__

Create a note

__init__

Create a note

__init__

Create a note

__init__

Documentation

Few helpers for Sphinx.

source on GitHub

class pyquickhelper.sphinxext.sphinx_ext_helper.NodeEnter(parent)[source]

Bases: TinyNode

Returned by function traverse.

source on GitHub

Create a note

Parameters:

parent – parent node

source on GitHub

class pyquickhelper.sphinxext.sphinx_ext_helper.NodeLeave(parent)[source]

Bases: TinyNode

Returned by function traverse.

source on GitHub

Create a note

Parameters:

parent – parent node

source on GitHub

class pyquickhelper.sphinxext.sphinx_ext_helper.TinyNode(parent)[source]

Bases: object

Returned by traverse.

source on GitHub

Create a note

Parameters:

parent – parent node

source on GitHub

__init__(parent)[source]

Create a note

Parameters:

parent – parent node

source on GitHub

class pyquickhelper.sphinxext.sphinx_ext_helper.WrappedNode(node)[source]

Bases: object

Wraps a docutils node.

source on GitHub

__init__(node)[source]
pyquickhelper.sphinxext.sphinx_ext_helper._get_data(url)[source]

Loads file objects.inv generated by extension sphinx.ext.intersphinx.

Parameters:

url – url of documentation, example https://pandas.pydata.org/docs/

Returns:

instance of InventoryFile

source on GitHub

pyquickhelper.sphinxext.sphinx_ext_helper.get_index(index_url, cache_dir)[source]

Retrieves documentation data for a specific module.

Parameters:
  • url – url of documentation, example https://pandas.pydata.org/docs/

  • cache_dir – restore a cached inventory stored with pickle

Returns:

instance of InventoryFile

source on GitHub

pyquickhelper.sphinxext.sphinx_ext_helper.info_blocref(app, doctree, fromdocname, class_name, entry_name, class_node, class_node_list)[source]

Log information with Sphinx.

Parameters:
  • app – application (Sphinx)

  • doctree – document tree

  • fromdocname – document currently being compiled

  • class_name – name of the node

  • entry_name – entry name in TITLES

  • class_node – class node (blocref_node)

  • class_node_list – class node list (blocreflist)

source on GitHub

pyquickhelper.sphinxext.sphinx_ext_helper.sphinx_lang(env, default_value='en')[source]

Returns the language defined in the configuration file.

Parameters:
  • env – environment

  • default_value – default value

Returns:

language

source on GitHub

pyquickhelper.sphinxext.sphinx_ext_helper.traverse(node, depth=0)[source]

Enumerates through all children but insert a node whenever digging or leaving the childrens nodes.

Parameters:
  • node – node (from doctree)

  • depth – current depth

Returns:

enumerate (depth, node)

NodeEnter and NodeLeave are returned whenever entering or leaving nodes.

source on GitHub