module sphinxext.sphinx_mathdef_extension

Inheritance diagram of pyquickhelper.sphinxext.sphinx_mathdef_extension

Short summary

module pyquickhelper.sphinxext.sphinx_mathdef_extension

Defines a sphinx extension to give a title to a mathematical definition, theorem… Inspired from math.py.

source on GitHub

Classes

class

truncated documentation

MathDef

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

mathdef_node

Defines mathdef node.

MathDefList

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

mathdeflist

Defines mathdeflist node.

Functions

function

truncated documentation

depart_mathdef_node

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

depart_mathdeflist_node

depart_mathdef_node

merge_mathdef

merge_mathdef

process_mathdef_nodes

process_mathdef_nodes

process_mathdefs

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

purge_mathsext

purge_mathsext

setup

setup for mathdef (sphinx)

visit_mathdef_node

visit_mathdef_node

visit_mathdeflist_node

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

Methods

method

truncated documentation

run

Builds the mathdef text.

run

Simply insert an empty mathdeflist node which will be replaced later when process_mathdef_nodes is called

Documentation

Defines a sphinx extension to give a title to a mathematical definition, theorem… Inspired from math.py.

source on GitHub

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

Bases: docutils.parsers.rst.directives.admonitions.BaseAdmonition

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

  • title: a title for the math

  • tag: a tag to have several categories of math

  • lid or label: a label to refer to

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

Example:

.. mathdef::
    :title: title
    :tag: definition or theorem or ...
    :lid: id (used for further reference)

    Description of the math

source on GitHub

node_class[source]

alias of mathdef_node

run()[source][source]

Builds the mathdef text.

source on GitHub

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

Bases: docutils.parsers.rst.Directive

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

  • tag: a tag to have several categories of mathdef

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

Example:

.. mathdeflist::
    :tag: issue
    :contents:

source on GitHub

run()[source][source]

Simply insert an empty mathdeflist node which will be replaced later when process_mathdef_nodes is called

source on GitHub

pyquickhelper.sphinxext.sphinx_mathdef_extension.depart_mathdef_node(self, node)[source][source]

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

source on GitHub

pyquickhelper.sphinxext.sphinx_mathdef_extension.depart_mathdeflist_node(self, node)[source][source]

depart_mathdef_node

source on GitHub

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

Bases: docutils.nodes.admonition

Defines mathdef node.

source on GitHub

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

Bases: docutils.nodes.General, docutils.nodes.Element

Defines mathdeflist node.

source on GitHub

pyquickhelper.sphinxext.sphinx_mathdef_extension.merge_mathdef(app, env, docnames, other)[source][source]

source on GitHub

pyquickhelper.sphinxext.sphinx_mathdef_extension.process_mathdef_nodes(app, doctree, fromdocname)[source][source]

source on GitHub

pyquickhelper.sphinxext.sphinx_mathdef_extension.process_mathdefs(app, doctree)[source][source]

collect all mathdefs 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_mathdef_extension.purge_mathsext(app, env, docname)[source][source]

source on GitHub

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

setup for mathdef (sphinx)

source on GitHub

pyquickhelper.sphinxext.sphinx_mathdef_extension.visit_mathdef_node(self, node)[source][source]

source on GitHub

pyquickhelper.sphinxext.sphinx_mathdef_extension.visit_mathdeflist_node(self, node)[source][source]

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

source on GitHub