module sphinxext.sphinx_exref_extension

Inheritance diagram of pyquickhelper.sphinxext.sphinx_exref_extension

Short summary

module pyquickhelper.sphinxext.sphinx_exref_extension

Defines a sphinx extension to keep track of ex.

source on GitHub

Classes

class

truncated documentation

ExRef

A exref entry, displayed in the form of an admonition. It takes the following options:

exref_node

defines exref ndoe

ExRefList

A list of all exref entries, for a specific tag.

exreflist

defines exreflist node

Functions

function

truncated documentation

depart_exref_node

depart_exref_node, see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

depart_exreflist_node

depart_exref_node

merge_exref

merge_exref

process_exref_nodes

process_blocref_nodes

process_exrefs

collect all exref in the environment this is not done in the directive itself because it some transformations …

purge_exrefs

purge_exrefs

setup

setup for exref (sphinx)

visit_exref_node

visit_exref_node

visit_exreflist_node

visit_exreflist_node see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

Properties

property

truncated documentation

document

Return the document root node of the tree containing this Node.

document

Return the document root node of the tree containing this Node.

Methods

method

truncated documentation

run

calls run from BlocRef and add defaut tag

run

calls run from BlocRefList and add default tag if not present

Documentation

Defines a sphinx extension to keep track of ex.

source on GitHub

class pyquickhelper.sphinxext.sphinx_exref_extension.ExRef(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: BlocRef

A exref entry, displayed in the form of an admonition. It takes the following options:

  • title: a title for the bloc

  • tag: a tag to have several categories of blocs (optional)

  • lid or label: a label to refer to

  • index: to add an entry to the index (comma separated)

Example:

.. exref::
    :title: example of a blocref
    :lid: id-you-can-choose6

    An example of code:

    ::

        print("mignon")

Which renders as:

example of a exref

An example of code:

print("mignon")

All blocs can be displayed in another page by using exreflist:

.. exreflist::
    :tag: dummy_example6
    :sort: title

Only blocs tagged as dummy_example will be inserted here. The option sort sorts items by title, number, file. You also link to it by typing :ref:'anchor <id-you-can-choose2>' which gives something like link_to_blocref. The link must receive a name.

example of a exref

An example of code:

print("mignon")

(original entry : sphinx_exref_extension.py:docstring of pyquickhelper.sphinxext.sphinx_exref_extension.ExRef, line 23)

source on GitHub

node_class[source]

alias of exref_node

run()[source]

calls run from BlocRef and add defaut tag

source on GitHub

class pyquickhelper.sphinxext.sphinx_exref_extension.ExRefList(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: BlocRefList

A list of all exref entries, for a specific tag.

  • tag: a tag to filter bloc having this tag

  • sort: a way to sort the blocs based on the title, file, number, default: title

  • contents: add a bullet list with links to added blocs

Example:

.. exreflist::
    :tag: issue

source on GitHub

node_class[source]

alias of exreflist

run()[source]

calls run from BlocRefList and add default tag if not present

source on GitHub

pyquickhelper.sphinxext.sphinx_exref_extension.depart_exref_node(self, node)[source]

depart_exref_node, see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub

pyquickhelper.sphinxext.sphinx_exref_extension.depart_exreflist_node(self, node)[source]

depart_exref_node

source on GitHub

class pyquickhelper.sphinxext.sphinx_exref_extension.exref_node(rawsource='', *children, **attributes)[source]

Bases: admonition

defines exref ndoe

source on GitHub

__slotnames__ = [][source]
class pyquickhelper.sphinxext.sphinx_exref_extension.exreflist(rawsource='', *children, **attributes)[source]

Bases: General, Element

defines exreflist node

source on GitHub

__slotnames__ = [][source]
pyquickhelper.sphinxext.sphinx_exref_extension.merge_exref(app, env, docnames, other)[source]

source on GitHub

pyquickhelper.sphinxext.sphinx_exref_extension.process_exref_nodes(app, doctree, fromdocname)[source]

process_blocref_nodes

source on GitHub

pyquickhelper.sphinxext.sphinx_exref_extension.process_exrefs(app, doctree)[source]

collect all exref in the environment this is not done in the directive itself because it some transformations must have already been run, e.g. substitutions

source on GitHub

pyquickhelper.sphinxext.sphinx_exref_extension.purge_exrefs(app, env, docname)[source]

source on GitHub

pyquickhelper.sphinxext.sphinx_exref_extension.setup(app)[source]

setup for exref (sphinx)

source on GitHub

pyquickhelper.sphinxext.sphinx_exref_extension.visit_exref_node(self, node)[source]

source on GitHub

pyquickhelper.sphinxext.sphinx_exref_extension.visit_exreflist_node(self, node)[source]

see https://github.com/sphinx-doc/sphinx/blob/master/sphinx/writers/html.py

source on GitHub