1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
|
=====================
Docutils Transforms
=====================
:Author: David Goodger
:Contact: docutils-develop@lists.sourceforge.net
:Revision: $Revision: 7530 $
:Date: $Date: 2012-10-16 14:40:36 +0200 (Di, 16 Okt 2012) $
:Copyright: This document has been placed in the public domain.
.. contents::
Transforms change the document tree in-place, add to the tree, or prune it.
Transforms resolve references and footnote numbers, process interpreted
text, and do other context-sensitive processing. Each transform is a
subclass of ``docutils.tranforms.Transform``.
There are `transforms added by components`_, others (e.g.
``parts.Contents``) are added by the parser, if a corresponding directive is
found in the document.
To add a transform, components (objects inheriting from
Docutils.Component like Readers, Parsers, Writers, Input, Output) overwrite
the ``get_transforms()`` method of their base class. After the Reader has
finished processing, the Publisher calls
``Transformer.populate_from_components()`` with a list of components and all
transforms returned by the component's ``get_transforms()`` method are
stored in a `transformer object` attached to the document tree.
For more about transforms and the Transformer object, see also `PEP
258`_. (The ``default_transforms()`` attribute of component classes mentioned
there is deprecated. Use the ``get_transforms()`` method instead.)
.. _PEP 258: ../peps/pep-0258.html#transformer
Transforms Listed in Priority Order
===================================
Transform classes each have a default_priority attribute which is used by
the Transformer to apply transforms in order (low to high). The default
priority can be overridden when adding transforms to the Transformer object.
============================== ============================ ========
Transform: module.Class Added By Priority
============================== ============================ ========
misc.class "class" (d/p) 210
references.Substitutions standalone (r), pep (r) 220
references.PropagateTargets standalone (r), pep (r) 260
frontmatter.DocTitle standalone (r) 320
frontmatter.DocInfo standalone (r) 340
frontmatter.SectSubTitle standalone (r) 350
peps.Headers pep (r) 360
peps.Contents pep (r) 380
universal.StripClasses... Writer (w) 420
references.AnonymousHyperlinks standalone (r), pep (r) 440
references.IndirectHyperlinks standalone (r), pep (r) 460
peps.TargetNotes pep (r) 520
references.TargetNotes peps.TargetNotes (t/p) 0
misc.CallBack peps.TargetNotes (t/p) 1
references.TargetNotes "target-notes" (d/p) 540
references.Footnotes standalone (r), pep (r) 620
references.ExternalTargets standalone (r), pep (r) 640
references.InternalTargets standalone (r), pep (r) 660
parts.SectNum "sectnum" (d/p) 710
parts.Contents "contents" (d/p), 720
peps.Contents (t/p)
universal.StripComments Reader (r) 740
peps.PEPZero peps.Headers (t/p) 760
components.Filter "meta" (d/p) 780
universal.Decorations Reader (r) 820
misc.Transitions standalone (r), pep (r) 830
universal.ExposeInternals Reader (r) 840
references.DanglingReferences standalone (r), pep (r) 850
universal.Messages Writer (w) 860
universal.FilterMessages Writer (w) 870
universal.SmartQuotes Parser 850
universal.TestMessages DocutilsTestSupport 880
writer_aux.Compound newlatex2e (w) 910
writer_aux.Admonitions html4css1 (w), 920
latex2e (w)
misc.CallBack n/a 990
============================== ============================ ========
Key:
* (r): Reader
* (w): Writer
* (d): Directive
* (t): Transform
* (/p): Via a "pending" node
Transform Priority Range Categories
===================================
==== ==== ================================================
Priority
---------- ------------------------------------------------
From To Category
==== ==== ================================================
0 99 immediate execution (added by another transform)
100 199 very early (non-standard)
200 299 very early
300 399 early
400 699 main
700 799 late
800 899 very late
900 999 very late (non-standard)
==== ==== ================================================
Transforms added by components
===============================
readers.Reader:
| universal.Decorations,
| universal.ExposeInternals,
| universal.StripComments
readers.ReReader:
None
readers.standalone.Reader:
| references.Substitutions,
| references.PropagateTargets,
| frontmatter.DocTitle,
| frontmatter.SectionSubTitle,
| frontmatter.DocInfo,
| references.AnonymousHyperlinks,
| references.IndirectHyperlinks,
| references.Footnotes,
| references.ExternalTargets,
| references.InternalTargets,
| references.DanglingReferences,
| misc.Transitions
readers.pep.Reader:
| references.Substitutions,
| references.PropagateTargets,
| references.AnonymousHyperlinks,
| references.IndirectHyperlinks,
| references.Footnotes,
| references.ExternalTargets,
| references.InternalTargets,
| references.DanglingReferences,
| misc.Transitions,
| peps.Headers,
| peps.Contents,
| peps.TargetNotes
parsers.rst.Parser
universal.SmartQuotes
writers.Writer:
| universal.Messages,
| universal.FilterMessages,
| universal.StripClassesAndElements
writers.UnfilteredWriter
None
writers.latex2e.Writer
writer_aux.Admonitions
writers.html4css1.Writer:
writer_aux.Admonitions
writers.odf_odt.Writer:
removes references.DanglingReferences
|