localecmddoc.codeblock¶
Converting localecmddoc codeblocks to sphinx literal blocks, thereby running the conde inside
Module Contents¶
Classes¶
This class exists to mark the block. It is later replaced |
|
Mark a list of examples |
|
Directive of localecmd examples. |
|
Directive of localecmd examples list. |
Functions¶
Get a localecmd.CLI for running commands or documenting modules. |
|
Delete entries in the example dicts that are at wrong document???? |
|
Run code blocks and generate example list |
|
Run the code, get the output and put the result back into the node. |
|
Generate the list of all examples |
API¶
- get_cli(app: sphinx.application.Sphinx) localecmd.CLI¶
Get a localecmd.CLI for running commands or documenting modules.
- Parameters:
app (Sphinx) – Sphinx instance
- Returns:
command line interface. Remember to close this one before querying the next
- Return type:
CLI
- Raises:
ValueError – If a modulename is empty
- class LocalecmdExample(rawsource='', text='', *children, **attributes)¶
Bases:
docutils.nodes.General,docutils.nodes.FixedTextElementThis class exists to mark the block. It is later replaced
Initialization
- class LocalecmdExampleList(rawsource='', *children, **attributes)¶
Bases:
docutils.nodes.General,docutils.nodes.ElementMark a list of examples
Initialization
- class LocalecmdExampleDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)¶
Bases:
sphinx.util.docutils.SphinxDirectiveDirective of localecmd examples.
Type the commands only and sphinx will run the command and give the printout.
Initialization
- class LocalecmdExampleListDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)¶
Bases:
docutils.parsers.rst.DirectiveDirective of localecmd examples list.
Initialization
- clean_example_dicts(app: sphinx.application.Sphinx, env: sphinx.environment.BuildEnvironment, docname: str)¶
Delete entries in the example dicts that are at wrong document????
- process_code_blocks(app: sphinx.application.Sphinx, doctree: docutils.nodes.document, docname: str)¶
Run code blocks and generate example list