DocumentTreeRoot

laika.ast.DocumentTreeRoot
case class DocumentTreeRoot(tree: DocumentTree, coverDocument: Option[Document], styles: Map[String, StyleDeclarationSet], staticDocuments: Seq[StaticDocument], includes: IncludeMap)

Represents the root of a tree of documents. In addition to the recursive structure of documents, usually obtained by parsing text markup, it holds additional items like styles and static documents, which may contribute to the rendering of a site or an e-book.

The styles property of this type is currently only populated and processed when rendering PDF or XSL-FO. Styles for HTML or EPUB documents are part of the staticDocuments property instead and will be integrated into the final output, but not interpreted.

Value parameters

coverDocument

the cover document (usually used with e-book formats like EPUB and PDF)

includes

the map of configuration includes that may be needed when resolving template configuration

staticDocuments

the descriptors for documents that were neither identified as text markup, config or templates, and will be copied as is to the final output

styles

the styles to apply when rendering this tree, only populated for PDF or XSL-FO output

tree

the recursive structure of documents, usually obtained from parsing text markup

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Selects and applies the templates contained in this document tree for the specified output format to all documents within this tree recursively.

Selects and applies the templates contained in this document tree for the specified output format to all documents within this tree recursively.

Attributes

Creates a new tree by applying the specified function to all documents in this tree recursively.

Creates a new tree by applying the specified function to all documents in this tree recursively.

Attributes

Creates a new instance by applying the specified function to the root tree.

Creates a new instance by applying the specified function to the root tree.

Attributes

Returns a new tree, with all the document models contained in it rewritten based on the specified rewrite rules.

Returns a new tree, with all the document models contained in it rewritten 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.

The specified factory function will be invoked for each document contained in this tree and must return the rewrite rules for that particular document.

Attributes

Creates a new tree by replacing its root configuration with the specified config instance.

Creates a new tree by replacing its root configuration with the specified config instance.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

lazy val allDocuments: Seq[Document]

All documents contained in this tree, fetched recursively, depth-first.

All documents contained in this tree, fetched recursively, depth-first.

Attributes

val config: Config

The configuration associated with the root of the tree.

The configuration associated with the root of the tree.

Like text markup documents and templates, configurations form a tree structure and sub-trees may override and/or add properties that have only an effect in that sub-tree.

Attributes

lazy val isEmpty: Boolean

Indicates whether this tree does not contain any markup document. Template documents do not count, as they would be ignored in rendering when there is no markup document.

Indicates whether this tree does not contain any markup document. Template documents do not count, as they would be ignored in rendering when there is no markup document.

Attributes

val title: Option[SpanSequence]

The title of this tree, obtained from configuration.

The title of this tree, obtained from configuration.

Attributes

val titleDocument: Option[Document]

The title document for this tree, if present.

The title document for this tree, if present.

At the root level the title document, if present, will be rendered after the cover document.

Attributes