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 page.

source on GitHub

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

Properties

property

truncated documentation

document

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

Methods

method

truncated documentation

run

Builds the collapse text.

Documentation

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

source on GitHub

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

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

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 collapse_node

option_spec = {'class': <function class_option>, 'hide': <function unchanged>, 'legend': <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 collapse text.

source on GitHub

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

Bases: admonition

defines collapse node.

source on GitHub

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

depart collapse_node

source on GitHub

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

depart collapse_node

source on GitHub

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

depart collapse_node

source on GitHub

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

setup for collapse (sphinx)

source on GitHub

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

visit collapse_node

source on GitHub

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

visit collapse_node

source on GitHub

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

visit collapse_node

source on GitHub