Document finalization and query tools for raw text element trees.
itertools
typing0
string0
types0
export422%types.Paragraph
export(paragraph, literal, reference)
Convert the given paragraph element into terms defined by fault.text.types.
exportParameters
paragraphThe raw parse elements formed by Parser.process.
sections420%typing.Iterator[typing.Tuple[str, object]]
sections(root)
Iterator producing (section-identifier, section) pairs.
section420%object
section(root, identifier)
Select the section with the given identifier. Uses a full scan; index the results of sections using a dict for repeat reads.
concatenate516%typing.Iterator[str]
concatenate(syntax)
Concatenate the lines of the given syntax element.
context30%
context(element)
Structure a common context admonition.
paragraph_as_string70%
paragraph_as_string(element)
paragraph_only50%
paragraph_only(element)
Select the only paragraph in the given element.
paragraph_first40%
paragraph_first(element)
Select the first paragraph in the given element.
paragraph_last40%
paragraph_last(element)
Select the last paragraph in the given element.
paragraph_lines80%
paragraph_lines(element)
interpret_reference90%
interpret_reference(element)
interpret_paragraph_single70%
interpret_paragraph_single(element)
directory_pairs60%
directory_pairs(items)
Iterate over the key-value pairs in the directory items.
Tree0
Serializer for (text) object trees.
Tree__init__0
__init__(self)
Initialize the tree builder.
Treeempty20%
empty(self, name, *args, **kw)
Empty with potential attributes.
Treeelement0
element(self, element_name, content, *attributes, **kwattributes)
Serialize an element with the exact element_name with the contents of subelement_iterator as the inner elements. subelement_iterator must produce bytes encoded objects.
Treeprefixed0
prefixed = element
Treeescape0
escape(self, string)
Treehyperlink0
hyperlink(self, href)
Transform0
Transform parse events into a form designated by the given AST constructor.
Transformchain0
chain = staticmethod(itertools.chain.from_iterable)
Transform__init__0
__init__(self, serialization, identify)
Initialize a Transform instance designating the AST constructor.
Transform__init__Parameters
Transformprocess0
process(self, tree)
Transformprocess_paragraph_text0
process_paragraph_text(self, tree, text)
Transformprocess_paragraph_emphasis0
process_paragraph_emphasis(self, tree, data)
Transformprocess_paragraph_literal0
process_paragraph_literal(self, tree, data)
Transformprocess_paragraph_reference566%
process_paragraph_reference(self, tree, source, type, title, action)
Transformprocess_paragraph_referenceParameters
Transformprocess_end_of_line0
process_end_of_line(self, tree, text)
Transformprocess_init0
process_init(self, tree, data, *params)
Transformparagraph_index0
paragraph_index = {
'init': process_init,
'text': process_paragraph_text,
'eol': process_end_of_line,
'emphasis': process_paragraph_emphasis,
'literal': process_paragraph_literal,
'reference': process_paragraph_reference,
}
Transformprocess_items185%
process_items(self, tree, element, name)
Transformprocess_set0
process_set(self, tree, element)
Transformprocess_sequence0
process_sequence(self, tree, element)
Transformprocess_directory0
process_directory(self, tree, vl_element)
Transformempty_paragraph277%
empty_paragraph(sequence)
Whether the paragraph should be considered to be empty.
Transformparagraph_content40%
paragraph_content(self, tree, sequence)
Transformprocess_paragraph0
process_paragraph(self, tree, paragraph)
Transformprocess_syntax187%
process_syntax(self, tree, sequence)
Transformprocess_admonition0
process_admonition(self, tree, content)
Transformprocess_section0
process_section(self, tree, section)
Transformcreate_section185%
create_section(self, tree, section)
Transformprocess_exception30%
process_exception(self, tree, exception)
Emit an exception element in order to report warnings or failures regarding syntax that was not entirely comprehensible.
Transformsection_index0
section_index = {
'paragraph': process_paragraph,
'set': process_set,
'sequence': process_sequence,
'directory': process_directory,
'syntax': process_syntax,
'admonition': process_admonition,
'section': create_section,
'exception': process_exception,
}