skeleton.demo_role#

Demonstration of a custom role for sphinx.

This role should be deleted when starting a new extension but it gives an overview of the different steps to follow to create a new role. It is also used to demonstrate the documentation/test workflows.

Note

We only coded a html output for this role.

Module Contents#

Classes#

DemoRole

The demo sphinxrole interpreter.

demo_node

The demo node.

Functions#

depart_demo_node_html(translator, node)

Depart from the html output.

visit_demo_node_html(translator, node)

Visit the html output.

visit_icon_node_unsuported(translator, node)

Raise error when the requested output is not supported.

Attributes#

_NODE_VISITORS

logger

class skeleton.demo_role.DemoRole[source]#

Bases: sphinx.util.docutils.SphinxRole

The demo sphinxrole interpreter.

run()[source]#

Setup the role in the builder context.

Return type:

Tuple[List[docutils.nodes.Node], List[str]]

class skeleton.demo_role.demo_node(rawsource='', *children, **attributes)[source]#

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

The demo node.

skeleton.demo_role.depart_demo_node_html(translator, node)[source]#

Depart from the html output.

Parameters:
  • translator (sphinx.util.docutils.SphinxTranslator) –

  • node (demo_node) –

Return type:

None

skeleton.demo_role.visit_demo_node_html(translator, node)[source]#

Visit the html output.

Parameters:
  • translator (sphinx.util.docutils.SphinxTranslator) –

  • node (demo_node) –

Return type:

None

skeleton.demo_role.visit_icon_node_unsuported(translator, node)[source]#

Raise error when the requested output is not supported.

Parameters:
  • translator (sphinx.util.docutils.SphinxTranslator) –

  • node (demo_node) –

Return type:

None

skeleton.demo_role._NODE_VISITORS[source]#
skeleton.demo_role.logger[source]#