module documentation
Collection of helper functions and classes related to the creation and processing of docutils
nodes.
Class | obj |
A reference to a documentable object. |
Class | wbr |
Word break opportunity. |
Function | build |
Simplified from docutils Contents transform. |
Function | get |
Get the 0-based line number for a docutils `nodes.title_reference`. |
Function | set |
Set the attributes of a Node and return the modified node. This is required to manually construct a docutils document that is consistent. |
Function | _set |
Set the nodes.Node.parent attribute of the nodes to the defined parent. |
Simplified from docutils Contents transform.
All section nodes MUST have set attribute 'ids' to a list of strings.
Parameters | |
node:nodes.Node | Undocumented |
depth:int | Undocumented |
level:int | Undocumented |
Returns | |
Optional[ | Undocumented |
Get the 0-based line number for a docutils `nodes.title_reference`.
Walk up the tree hierarchy until we find an element with a line number, then counts the number of newlines until the reference element is found.
Parameters | |
node:nodes.Node | Undocumented |
Returns | |
int | Undocumented |
Set the attributes of a Node and return the modified node. This is required to manually construct a docutils document that is consistent.
Parameters | |
node:nodes.Node | A node to edit. |
document:Optional[ | The nodes.Node.document attribute. |
lineno:Optional[ | The nodes.Node.line attribute. |
children:Optional[ | The nodes.Element.children attribute. Special care is taken to appropriately set the nodes.Node.parent attribute on the child nodes. |
Returns | |
nodes.Node | Undocumented |
Set the nodes.Node.parent
attribute of the nodes to the defined parent.
Parameters | |
nodes:Iterable[ | Undocumented |
parent:nodes.Element | Undocumented |
Returns | |
Iterator[ | An iterator containing the modified nodes. |