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 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 | __init__ |
Undocumented |
Method | copy |
Return a copy of self. |
Method | pformat |
Return an indented pseudo-XML representation, for test purposes. |
Instance Variable | details |
Detail data (dictionary) required by the pending operation. |
Instance Variable | transform |
The `docutils.transforms.Transform` class implementing the pending operation. |
Inherited from Element
:
Class Method | is |
Returns True if and only if the given attribute is NOT recognized by this class. |
Class Method | is |
Returns True if and only if the given attribute is NOT one of the basic list attributes defined for all Elements. |
Method | __add__ |
Undocumented |
Method | __contains__ |
Undocumented |
Method | __delitem__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __iadd__ |
Append a node or a list of nodes to `self.children`. |
Method | __len__ |
Undocumented |
Method | __radd__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __setitem__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | append |
Undocumented |
Method | append |
For each element in values, if it does not exist in self[attr], append it. |
Method | astext |
Return a string representation of this Node. |
Method | attlist |
Undocumented |
Method | clear |
Undocumented |
Method | coerce |
First, convert both self[attr] and value to a non-string sequence type; if either is not already a sequence, convert it to a list of one element. Then call append_attr_list. |
Method | copy |
If attr is an attribute of self and either self[attr] or value is a list, convert all non-sequence values to a sequence of 1 element and then concatenate the two sequence, setting the result to self[attr]... |
Method | copy |
If attr is an attribute of self and both self[attr] and value are lists, concatenate the two sequences, setting the result to self[attr]. If either self[attr] or value are non-sequences and replace is True or self[attr] is None, replace self[attr] with value... |
Method | copy |
If replace is True or self[attr] is None, replace self[attr] with value. Otherwise, do nothing. |
Method | copy |
If attr is an attribute of self, set self[attr] to [self[attr], value], otherwise set self[attr] to value. |
Method | deepcopy |
Return a deep copy of self (also copying children). |
Method | delattr |
Undocumented |
Method | emptytag |
Undocumented |
Method | endtag |
Undocumented |
Method | extend |
Undocumented |
Method | first |
Return the index of the first child whose class exactly matches. |
Method | first |
Return the index of the first child whose class does *not* match. |
Method | get |
Undocumented |
Method | get |
Return node's language tag. |
Method | hasattr |
Undocumented |
Method | index |
Undocumented |
Method | insert |
Undocumented |
Method | is |
Undocumented |
Method | non |
Undocumented |
Method | note |
Note that this Element has been referenced by its name `name` or id `id`. |
Method | pop |
Undocumented |
Method | remove |
Undocumented |
Method | replace |
Replace one child `Node` with another child or children. |
Method | replace |
If self[attr] does not exist or force is True or omitted, set self[attr] to value, otherwise do nothing. |
Method | replace |
Replace `self` node with `new`, where `new` is a node or a list of nodes. |
Method | set |
Add a new class to the "classes" attribute. |
Method | setdefault |
Undocumented |
Method | shortrepr |
Undocumented |
Method | starttag |
Undocumented |
Method | update |
Updates all attributes from node or dictionary `dict_`. |
Method | update |
Updates all attributes from node or dictionary `dict_`. |
Method | update |
Updates all attributes from node or dictionary `dict_`. |
Method | update |
Updates all attributes from node or dictionary `dict_`. |
Method | update |
Updates all attributes from node or dictionary `dict_`. |
Method | update |
Update basic attributes ('ids', 'names', 'classes', 'dupnames', but not 'source') from node or dictionary `dict_`. |
Class Variable | basic |
Tuple of attributes which are defined for every Element-derived class instance and can be safely transferred to a different node. |
Class Variable | child |
Separator for child nodes, used by `astext()` method. |
Class Variable | known |
Tuple of attributes that are known to the Element base class. |
Class Variable | list |
Tuple of attributes that are automatically initialized to empty lists for all nodes. |
Class Variable | local |
Tuple of class-specific attributes that should not be copied with the standard attributes when replacing a node. |
Instance Variable | attributes |
Dictionary of attribute {name: value}. |
Instance Variable | children |
List of child nodes (elements and/or `Text`). |
Instance Variable | rawsource |
The raw text from which this element was constructed. |
Instance Variable | referenced |
Undocumented |
Instance Variable | tagname |
The element generic identifier. If None, it is set as an instance attribute to the name of the class. |
Method | _dom |
Undocumented |
Inherited from Node
(via Element
):
Method | __bool__ |
Node instances are always true, even if they're empty. A node is more than a simple container. Its boolean "truth" does not depend on having one or more subnodes in the doctree. |
Method | asdom |
Return a DOM **fragment** representation of this Node. |
Method | document |
Undocumented |
Method | findall |
Return an iterator yielding nodes following `self`: |
Method | next |
Return the first node in the iterator returned by findall(), or None if the iterable is empty. |
Method | previous |
Return preceding sibling node or ``None``. |
Method | setup |
Undocumented |
Method | traverse |
Return list of nodes following `self`. |
Method | walk |
Traverse a tree of `Node` objects, calling the `dispatch_visit()` method of `visitor` when entering each node. (The `walkabout()` method is similar, except it also calls the `dispatch_departure()` method before exiting each node... |
Method | walkabout |
Perform a tree traversal similarly to `Node.walk()` (which see), except also call the `dispatch_departure()` method before exiting each node. |
Class Variable | line |
The line number (1-based) of the beginning of this Node in `source`. |
Class Variable | parent |
Back-reference to the Node immediately containing this Node. |
Class Variable | source |
Path or description of the input source which generated this Node. |
Property | document |
Return the `document` root node of the tree containing this Node. |
Method | _fast |
Return iterator that only supports instance checks. |
Method | _superfast |
Return iterator that doesn't check for a condition. |
Instance Variable | _document |
Undocumented |
docutils.nodes.Element.pformat
Return an indented pseudo-XML representation, for test purposes. Override in subclasses.