DocumentTree

laika.ast.DocumentTree
See theDocumentTree companion object
final class DocumentTree extends TreeContent

Represents a virtual tree with all its documents, templates, configurations and subtrees.

Value parameters

content

the markup documents and subtrees except for the (optional) title document

templates

all templates on this level of the tree hierarchy that might get applied to a document when it gets rendered

titleDocument

the optional title document of this tree

Attributes

Companion
object
Source
documents.scala
Graph
Supertypes
trait TreeContent
trait Navigatable
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

Adds the specified template document to this tree, retaining any previously added templates.

Adds the specified template document to this tree, retaining any previously added templates.

Attributes

Source
documents.scala
def appendContent(content: TreeContent, contents: TreeContent*): DocumentTree

Appends the specified content to this tree and return a new instance.

Appends the specified content to this tree and return a new instance.

Attributes

Source
documents.scala
def appendContent(newContent: Seq[TreeContent]): DocumentTree

Appends the specified content to this tree and return a new instance.

Appends the specified content to this tree and return a new instance.

Attributes

Source
documents.scala

Creates the navigation structure for this tree up to the specified depth.

Creates the navigation structure for this tree up to the specified depth. The returned instance can be used as part of a bigger navigation structure comprising of trees, documents and their sections.

Value parameters

context

captures the navigation depth, reference path and styles for the navigation tree being built

Attributes

Returns

a navigation item that can be used as part of a bigger navigation structure comprising of trees, documents and their sections

Source
documents.scala
def config: Config

The configuration associated with this tree.

The configuration associated with this tree.

Attributes

Source
documents.scala
def getDefaultTemplate(formatSuffix: String): Option[TemplateDocument]

Selects the template with the name default.template.<suffix> for the specified format suffix from this level of the document tree.

Selects the template with the name default.template.<suffix> for the specified format suffix from this level of the document tree.

Attributes

Source
documents.scala

Extracts all invalid elements with the specified minimum message level from this tree content.

Extracts all invalid elements with the specified minimum message level from this tree content.

Attributes

Source
documents.scala

Modifies the existing config instance for this document tree by appending one or more additional values.

Modifies the existing config instance for this document tree by appending one or more additional values.

This method is much more efficient than withConfig when existing config values should be retained.

Attributes

Source
documents.scala

Applies the specified function to all elements of the content property and returns a new document tree.

Applies the specified function to all elements of the content property and returns a new document tree.

Applies the function to documents and document trees on this level of the hierarchy. IF you want to modify documents recursively, use modifyDocumentsRecursively instead.

Attributes

Source
documents.scala

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

Source
documents.scala
def path: Path

The full, absolute path of this (virtual) document tree.

The full, absolute path of this (virtual) document tree.

Attributes

Source
documents.scala

The position of this tree inside a document ast hierarchy, expressed as a list of Ints.

The position of this tree inside a document ast hierarchy, expressed as a list of Ints.

Attributes

Source
documents.scala
def prependContent(content: TreeContent, contents: TreeContent*): DocumentTree

Prepends the specified content to this tree and return a new instance.

Prepends the specified content to this tree and return a new instance.

Attributes

Source
documents.scala
def prependContent(newContent: Seq[TreeContent]): DocumentTree

Prepends the specified content to this tree and return a new instance.

Prepends the specified content to this tree and return a new instance.

Attributes

Source
documents.scala
def removeContent(filter: Path => Boolean): DocumentTree

Removes all documents from this tree where the specified filter applies to its path.

Removes all documents from this tree where the specified filter applies to its path. Does not recurse into nested sub-trees and does not apply to templates or title documents.

Attributes

Source
documents.scala
def replaceContent(newContent: Seq[TreeContent]): DocumentTree

Replaces the contents of this document tree.

Replaces the contents of this document tree. Consider using modifyContent instead when only intending to adjust existing content.

Attributes

Source
documents.scala

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

Source
documents.scala

Extracts all runtime messages with the specified minimum level from this tree content.

Extracts all runtime messages with the specified minimum level from this tree content.

Attributes

Source
documents.scala
def selectDocument(path: String): Option[Document]

Selects a document from this tree or one of its subtrees by the specified path.

Selects a document from this tree or one of its subtrees by the specified path. The path needs to be relative and not point to a parent tree (neither start with / nor with ..).

Attributes

Source
documents.scala
def selectDocument(path: RelativePath): Option[Document]

Selects a document from this tree or one of its subtrees by the specified path.

Selects a document from this tree or one of its subtrees by the specified path. The path must not point to a parent tree (start with ../) as this instance is not aware of its parents.

Attributes

Source
documents.scala
def selectSubtree(path: String): Option[DocumentTree]

Selects a subtree of this tree by the specified path.

Selects a subtree of this tree by the specified path. The path needs to be relative and it may point to a deeply nested subtree, not just immediate children.

Attributes

Source
documents.scala

Selects a subtree of this tree by the specified path.

Selects a subtree of this tree by the specified path. The path must not point to a parent tree (start with ../) as this instance is not aware of its parents.

Attributes

Source
documents.scala
def selectTemplate(path: String): Option[TemplateDocument]

Selects a template from this tree or one of its subtrees by the specified path.

Selects a template from this tree or one of its subtrees by the specified path. The path needs to be relative.

Attributes

Source
documents.scala

Selects a template from this tree or one of its subtrees by the specified path.

Selects a template from this tree or one of its subtrees by the specified path. The path must not point to a parent tree (start with ../) as this instance is not aware of its parents.

Attributes

Source
documents.scala

Associates the specified config instance with this document tree.

Associates the specified config instance with this document tree.

If you want to add values to the existing configuration of this instance, use modifyConfig instead, which is more efficient than re-assigning a full new instance which is based on the existing one.

Attributes

Source
documents.scala
def withDefaultTemplate(template: TemplateRoot, formatSuffix: String): DocumentTree

Create a new document tree that contains the specified template as the default.

Create a new document tree that contains the specified template as the default.

Attributes

Source
documents.scala

Adds the specified document as the title document for this tree, replacing the existing title document if present.

Adds the specified document as the title document for this tree, replacing the existing title document if present.

Attributes

Source
documents.scala

Adds the specified document as the title document for this tree replacing the existing title document if present or, if the parameter is empty, removes any existing title document.

Adds the specified document as the title document for this tree replacing the existing title document if present or, if the parameter is empty, removes any existing title document.

Attributes

Source
documents.scala

Inherited methods

The formats this tree content should be rendered to.

The formats this tree content should be rendered to.

Attributes

Inherited from:
TreeContent
Source
documents.scala
protected def titleFromConfig: Option[SpanSequence]

Attributes

Inherited from:
TreeContent
Source
documents.scala

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

Source
documents.scala
val content: Seq[TreeContent]

Attributes

Source
documents.scala
lazy val isEmpty: Boolean

Indicates whether this tree does not contain any 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

Source
documents.scala

Attributes

Source
documents.scala
lazy val title: Option[SpanSequence]

The title of this tree, obtained from configuration.

The title of this tree, obtained from configuration.

Attributes

Source
documents.scala
val titleDocument: Option[Document]

Attributes

Source
documents.scala

Inherited fields

lazy val name: String

The local name of this navigatable.

The local name of this navigatable.

Attributes

Inherited from:
Navigatable
Source
documents.scala