Format text elements into text images.
Paragraph level formatting functions usually return Fragment while section-level returns Image.
chapter and elements are the primary entry points where chapter takes a single chapter element and elements takes a sequence of arbitrary elements.
Types
Sequence
Iterable
types0
document0
Fragment0
Fragment = str
Line0
Line = Sequence[Fragment]
Image0
Image = Iterable[Line]
syntax811%Image
syntax(lines, syntype, qualifier, adjustment)
Generator producing sequences of line text for a syntax element.
syntaxParameters
section_path118%Line
section_path(rdepth, rmultiple, *path)
Construct a section selector from a relative depth and a section identifier path.
ambiguous_reference233%Fragment
ambiguous_reference(string)
Prefix the given string with an ampersand.
section_reference233%Fragment
section_reference(section_selector)
Prefix the given string with an ampersand after enclosing it with brackets.
hyperlink233%Fragment
hyperlink(url)
Prefix the given string with an ampersand after enclosing it with angle brackets.
literal233%Fragment
literal(string)
Surround the string with grave-accents and replace any grave-accent within with two.
_p_fragments0
_p_fragments = {
('reference', 'ambiguous'): ambiguous_reference,
('reference', 'hyperlink'): hyperlink,
('reference', 'section'): section_reference,
('literal', 'grave-accent'): literal,
('text', 'normal'): (lambda x: x),
('text', 'line-break'): (lambda x: " "),
('text', 'emphasis'): (lambda x: x),
}
paragraph195%Image
paragraph(para)
Generator producing an Image representing the given fault.text.types.Paragraph.
inline_fragment150%Fragment
inline_fragment(frag)
_chapter30%
_chapter(depth, element)
_section80%
_section(depth, element)
_syn80%
_syn(depth, syntax)
_para80%
_para(depth, element)
_list160%
_list(depth, element, list_type)
_sequence10%
_sequence(depth, element)
_set10%
_set(depth, element)
_directory220%
_directory(depth, element)
_admonition60%
_admonition(depth, element)
_index0
_index = {
'section': _section,
'chapter': _chapter,
'paragraph': _para,
'syntax': _syn,
'admonition': _admonition,
'set': _set,
'sequence': _sequence,
'dictionary': _directory,
'directory': _directory,
# No-op element type often providing additional metadata.
'void': (lambda x, y: ()),
}
_tree30%
_tree(depth, elements)
tree516%Image
tree(element, adjustment, indentation, newline)
Produce the image representing the given element including newline characters.
treeParameters
elements516%Image
elements(elements, adjustment, indentation, newline)
Produce the image representing the given elements sequence.
elementsParameters
chapter516%Image
chapter(element, adjustment, indentation, newline)
Produce the image representing the given chapter element including newline characters.