localecmddoc.codeblock

Converting localecmddoc codeblocks to sphinx literal blocks, thereby running the conde inside

Module Contents

Classes

LocalecmdExample

This class exists to mark the block. It is later replaced

LocalecmdExampleList

Mark a list of examples

LocalecmdExampleDirective

Directive of localecmd examples.

LocalecmdExampleListDirective

Directive of localecmd examples list.

Functions

get_cli

Get a localecmd.CLI for running commands or documenting modules.

clean_example_dicts

Delete entries in the example dicts that are at wrong document????

process_code_blocks

Run code blocks and generate example list

run_codeblocks

Run the code, get the output and put the result back into the node.

generate_example_list

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

This class exists to mark the block. It is later replaced

Initialization

class LocalecmdExampleList(rawsource='', *children, **attributes)

Bases: docutils.nodes.General, docutils.nodes.Element

Mark a list of examples

Initialization

class LocalecmdExampleDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

Bases: sphinx.util.docutils.SphinxDirective

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

Directive 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

run_codeblocks(app: sphinx.application.Sphinx, doctree: docutils.nodes.document, docname: str)

Run the code, get the output and put the result back into the node.

generate_example_list(app: sphinx.application.Sphinx, doctree: docutils.nodes.document, docname: str)

Generate the list of all examples