Formatting Modules

hedwig.format.rst

hedwig.format.rst.rst_to_html(text, extract_title, start_heading)

Convert RST to HTML.

Parameters:
  • extract_title – whether to extract a document title

  • start_heading – initial heading level

Returns:

a tuple containing the body, title and a list of TOC items

class hedwig.format.rst.HedwigDocReader(parser=None, parser_name=None)

RST reader sub-class which replaces the DocTitle transform with our DocTitleNoSubtitle class.

get_transforms()

Returns the standard Reader transforms with DocTitle replaced.

class hedwig.format.rst.DocTitleNoSubtitle(document, startnode=None)

Sub-class of the DocTitle transform which does not process a sub-title.

promote_subtitle(*args, **kwargs)

Does nothing.

class hedwig.format.rst.HedwigTocTree(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

Handler for the toctree directive.

This allows the use of TOC trees in the Hedwig online help system.

has_content = True

May the directive have content?

option_spec = {'maxdepth': <class 'int'>}

Mapping of option names to validator functions.

toc_items = []
run()
class hedwig.format.rst.HedwigGraphviz(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

Handler for the graphviz directive.

This only supports references to external .dot files in a graph directory, e.g.:

.. graphviz:: graph/a_graph.dot
required_arguments = 1

Number of required directive arguments.

run()
hedwig.format.rst.doc_reference_role(role, rawtext, text, lineno, inliner, options={}, context=[])

Handler for the :doc: reference role.

This allows the Sphinx cross-reference syntax to be used in document served though Hedwig’s online help system.