class Substitutions(Transform):
Given the following document as input:
<document> <paragraph> The <substitution_reference refname="biohazard"> biohazard symbol is deservedly scary-looking. <substitution_definition name="biohazard"> <image alt="biohazard" uri="biohazard.png">
The substitution_reference will simply be replaced by the contents of the corresponding substitution_definition.
The transformed result will be:
<document> <paragraph> The <image alt="biohazard" uri="biohazard.png"> symbol is deservedly scary-looking. <substitution_definition name="biohazard"> <image alt="biohazard" uri="biohazard.png">
Method | apply |
Override to apply the transform to the document tree. |
Class Variable | default​_priority |
The Substitutions transform has to be applied very early, before docutils.transforms.frontmatter.DocTitle and others. |
Inherited from Transform
:
Method | __init__ |
Initial setup for in-place document transforms. |
Instance Variable | document |
The document tree to transform. |
Instance Variable | language |
Language module local to this document. |
Instance Variable | startnode |
Node from which to begin the transform. For many transforms which apply to the document as a whole, startnode is not set (i.e. its value is None ). |
docutils.transforms.Transform.apply
int
=
docutils.transforms.frontmatter.DocTitle
and others.