module sphinxext.sphinx_cmdref_extension

Inheritance diagram of pyquickhelper.sphinxext.sphinx_cmdref_extension

Short summary

module pyquickhelper.sphinxext.sphinx_cmdref_extension

Defines a sphinx extension to keep track of cmd.

source on GitHub

Classes

class

truncated documentation

CmdRef

A cmdref entry, displayed in the form of an admonition. It is used to reference a script a module is added as a …

cmdref_node

defines cmdref node

CmdRefList

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

cmdreflist

defines cmdreflist node

Functions

function

truncated documentation

depart_cmdref_node

depart_cmdref_node, see sphinx/writers/html.py. …

depart_cmdreflist_node

depart_cmdref_node

merge_cmdref

merge_cmdref

process_cmdref_nodes

process_cmdref_nodes

process_cmdrefs

Collect all cmdrefs in the environment this is not done in the directive itself because it some transformations …

purge_cmdrefs

purge_cmdrefs

setup

setup for cmdref (sphinx)

visit_cmdref_node

visit_cmdref_node

visit_cmdreflist_node

visit_cmdreflist_node see 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

calls run from BlocRef and add index entries by default

run

calls run from BlocRefList and add default tag if not present

Documentation

Defines a sphinx extension to keep track of cmd.

source on GitHub

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

Bases: BlocRef

A cmdref entry, displayed in the form of an admonition. It is used to reference a script a module is added as a command line. It takes the following options:

  • title: a title for the bloc

  • tag: a tag to have several categories of blocs, if not specified, it will be equal to cmd

  • lid or label: a label to refer to

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

  • name: command line name, if populated, the directive displays the output of name --help.

  • path: used if the command line startswith -m

It works the same way as BlocRef. The command line can be something like -m <module> <command> .... The extension will call python in a separate process.

source on GitHub

node_class[source]

alias of cmdref_node

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

Mapping of option names to validator functions.

run()[source]

calls run from BlocRef and add index entries by default

source on GitHub

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

Bases: BlocRefList

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

  • tag: a tag to have several categories of cmdref

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

source on GitHub

node_class[source]

alias of cmdreflist

run()[source]

calls run from BlocRefList and add default tag if not present

source on GitHub

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

Bases: admonition

defines cmdref node

source on GitHub

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

Bases: General, Element

defines cmdreflist node

source on GitHub

__slotnames__ = [][source]
pyquickhelper.sphinxext.sphinx_cmdref_extension.depart_cmdref_node(self, node)[source]

depart_cmdref_node, see sphinx/writers/html.py.

source on GitHub

pyquickhelper.sphinxext.sphinx_cmdref_extension.depart_cmdreflist_node(self, node)[source]

depart_cmdref_node

source on GitHub

pyquickhelper.sphinxext.sphinx_cmdref_extension.merge_cmdref(app, env, docnames, other)[source]

source on GitHub

pyquickhelper.sphinxext.sphinx_cmdref_extension.process_cmdref_nodes(app, doctree, fromdocname)[source]

source on GitHub

pyquickhelper.sphinxext.sphinx_cmdref_extension.process_cmdrefs(app, doctree)[source]

Collect all cmdrefs 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_cmdref_extension.purge_cmdrefs(app, env, docname)[source]

source on GitHub

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

setup for cmdref (sphinx)

source on GitHub

pyquickhelper.sphinxext.sphinx_cmdref_extension.visit_cmdref_node(self, node)[source]

source on GitHub

pyquickhelper.sphinxext.sphinx_cmdref_extension.visit_cmdreflist_node(self, node)[source]

see sphinx/writers/html.py.

source on GitHub