docutils.transforms.misc module
Miscellaneous transforms.
- class CallBack(document, startnode=None)[source]
Bases:
TransformInserts a callback into a document. The callback is called when the transform is applied, which is determined by its priority.
For use with nodes.pending elements. Requires a
details['callback']entry, a bound method or function which takes one parameter: the pending node. Other data can be stored in thedetailsattribute or in the object hosting the callback method.- default_priority = 990
Numerical priority of this transform, 0 through 999 (override).
- class ClassAttribute(document, startnode=None)[source]
Bases:
TransformMove the “class” attribute specified in the “pending” node into the immediately following non-comment element.
- default_priority = 210
Numerical priority of this transform, 0 through 999 (override).
- class Transitions(document, startnode=None)[source]
Bases:
TransformMove transitions at the end of sections up the tree. Complain on transitions after a title, at the beginning or end of the document, and after another transition.
For example, transform this:
<section> ... <transition> <section> ...
into this:
<section> ... <transition> <section> ...
- default_priority = 830
Numerical priority of this transform, 0 through 999 (override).