module sphinxext.sphinx_collapse_extension

Inheritance diagram of pyquickhelper.sphinxext.sphinx_collapse_extension

Short summary

module pyquickhelper.sphinxext.sphinx_collapse_extension

Defines a sphinx extension to hide / unhide section of the HTML page.

Classes

class

truncated documentation

collapse_node

defines collapse node.

CollapseDirective

A collapse adds hide/unhide button for a part of HTML page. It has no effect in other formats.

Functions

function

truncated documentation

depart_collapse_node

depart collapse_node

depart_collapse_node_html

depart collapse_node

depart_collapse_node_rst

depart collapse_node

setup

setup for collapse (sphinx)

visit_collapse_node

visit collapse_node

visit_collapse_node_html

visit collapse_node

visit_collapse_node_rst

visit collapse_node

Methods

method

truncated documentation

run

Builds the collapse text.

Documentation

Defines a sphinx extension to hide / unhide section of the HTML page.

New in version 1.7.

source on GitHub

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

Bases: docutils.parsers.rst.Directive

A collapse adds hide/unhide button for a part of HTML page. It has no effect in other formats.

  • legend: legend for the button, if not precise, it will be hide / unhide. Example: :legend: hide/unhide.

  • hide: the text is shown by default unless this option is set up.

Example:

.. collapse::
    :legend: hide/unhide

    some text to hide or unhide

Which gives:

some text to hide or unhide

source on GitHub

node_class[source]

alias of collapse_node

run()[source][source]

Builds the collapse text.

source on GitHub

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

Bases: docutils.nodes.admonition

defines collapse node.

source on GitHub

pyquickhelper.sphinxext.sphinx_collapse_extension.depart_collapse_node(self, node)[source][source]

depart collapse_node

source on GitHub

pyquickhelper.sphinxext.sphinx_collapse_extension.depart_collapse_node_html(self, node)[source][source]

depart collapse_node

source on GitHub

pyquickhelper.sphinxext.sphinx_collapse_extension.depart_collapse_node_rst(self, node)[source][source]

depart collapse_node

source on GitHub

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

setup for collapse (sphinx)

source on GitHub

pyquickhelper.sphinxext.sphinx_collapse_extension.visit_collapse_node(self, node)[source][source]

visit collapse_node

source on GitHub

pyquickhelper.sphinxext.sphinx_collapse_extension.visit_collapse_node_html(self, node)[source][source]

visit collapse_node

source on GitHub

pyquickhelper.sphinxext.sphinx_collapse_extension.visit_collapse_node_rst(self, node)[source][source]

visit collapse_node

source on GitHub