Document
Represents a single document and provides access to the document content and structure as well as hooks for triggering rewrite operations.
- Value parameters:
- config
the configuration for this document
- content
the tree model obtained from parsing the markup document
- fragments
separate named fragments that had been extracted from the content
- path
the full, absolute path of this document in the (virtual) document tree
- position
the position of this document inside a document tree hierarchy, expressed as a list of Ints
Value members
Concrete methods
Appends the specified content to this tree and return a new instance.
Appends the specified content to this tree and return a new instance.
Appends the specified content to this tree and return a new instance.
Appends the specified content to this tree and return a new instance.
Prepends the specified content to this tree and return a new instance.
Prepends the specified content to this tree and return a new instance.
Prepends the specified content to this tree and return a new instance.
Prepends the specified content to this tree and return a new instance.
Returns a new, rewritten document model based on the specified rewrite rules.
Returns a new, rewritten document model based on the specified rewrite rules.
If the rule is not defined for a specific element or the rule returns
a Retain
action as a result the old element remains in the tree unchanged.
If it returns Remove
then the node gets removed from the ast,
if it returns Replace
with a new element it will replace the old one.
The rewriting is performed bottom-up (depth-first), therefore any element container passed to the rule only contains children which have already been processed.
Inherited methods
The formats this tree content should be rendered to.
The formats this tree content should be rendered to.
- Inherited from:
- TreeContent
The title of this document, obtained from the document
structure or from the configuration. In case no title
is defined in either of the two places the result will
be None
.
The title of this document, obtained from the document
structure or from the configuration. In case no title
is defined in either of the two places the result will
be None
.
- Inherited from:
- DocumentStructure
Inherited fields
The section structure of this document based on the hierarchy of headers found in the original text markup.
The section structure of this document based on the hierarchy of headers found in the original text markup.
- Inherited from:
- DocumentStructure