Home | Trees | Index | Help |
|
---|
Package docutils :: Module nodes :: Class pending |
|
Node
--+ |Element
--+ |Invisible
--+ |PreDecorative
--+ | | |PreBibliographic
--+ |Body
--+ | | |Special
--+ | pending
The "pending" element is used to encapsulate a pending operation: the operation (transform), the point at which to apply it, and any data it requires. Only the pending operation's location within the document is stored in the public document tree (by the "pending" object itself); the operation and its data are stored in the "pending" object's internal instance attributes.
For example, say you want a table of contents in your reStructuredText document. The easiest way to specify where to put it is from within the document, with a directive:
.. contents::
But the "contents" directive can't do its work until the entire document has been parsed and possibly transformed to some extent. So the directive code leaves a placeholder behind that will trigger the second phase of the its processing, something like this:
<pending ...public attributes...> + internal attributes
Use document.note_pending()
so that the
docutils.transforms.Transformer
stage of processing can run all pending
transforms.
Method Summary | |
---|---|
__init__(self,
transform,
details,
rawsource,
*children,
**attributes)
| |
Return a copy of self. | |
Return an indented pseudo-XML representation, for test purposes. | |
Inherited from Element | |
| |
| |
| |
Append a node or a list of nodes to self.children . | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Return the index of the first child whose class exactly matches. | |
Return the index of the first child whose class does not match. | |
| |
Return this element's children. | |
| |
| |
| |
| |
| |
| |
Replace one child Node with another child or children. | |
Add a new name to the "class" attribute. | |
| |
| |
| |
| |
Inherited from Node | |
Node instances are always true, even if they're empty. | |
Return a DOM fragment representation of this Node. | |
| |
Traverse a tree of Node objects, calling visit_... methods of
visitor when entering each node. | |
Perform a tree traversal similarly to Node.walk() (which see),
except also call depart_... methods before exiting each node. |
Class Variable Summary | |
---|---|
Inherited from Element | |
str |
child_text_separator = '\n\n'
|
NoneType |
tagname = None |
Inherited from Node | |
NoneType |
document = None |
NoneType |
line = None |
NoneType |
parent = None |
NoneType |
source = None |
Method Details |
---|
copy(self)Return a copy of self.
|
pformat(self, indent=' ', level=0)Return an indented pseudo-XML representation, for test purposes.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Tue Jul 22 05:31:15 2003 | http://epydoc.sf.net |