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

Properties

property

truncated documentation

document

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

document

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

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]

Bases: 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

final_argument_whitespace = False[source]

May the final argument contain whitespace?

has_content = True[source]

May the directive have content?

node_class[source]

alias of mathdef_node

option_spec = {'class': <function class_option>, 'index': <function unchanged>, 'label': <function unchanged>, 'lid': <function unchanged>, 'tag': <function unchanged>, 'title': <function unchanged>}[source]

Mapping of option names to validator functions.

optional_arguments = 0[source]

Number of optional arguments after the required arguments.

required_arguments = 0[source]

Number of required directive arguments.

run()[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]

Bases: 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

final_argument_whitespace = False[source]

May the final argument contain whitespace?

has_content = False[source]

May the directive have content?

option_spec = {'contents': <function unchanged>, 'tag': <function unchanged>}[source]

Mapping of option names to validator functions.

optional_arguments = 0[source]

Number of optional arguments after the required arguments.

required_arguments = 0[source]

Number of required directive arguments.

run()[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]

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]

depart_mathdef_node

source on GitHub

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

Bases: admonition

Defines mathdef node.

source on GitHub

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

Bases: General, Element

Defines mathdeflist node.

source on GitHub

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

source on GitHub

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

source on GitHub

pyquickhelper.sphinxext.sphinx_mathdef_extension.process_mathdefs(app, doctree)[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 on GitHub

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

setup for mathdef (sphinx)

source on GitHub

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

source on GitHub

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

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

source on GitHub