Document

case class Document(path: Path, content: RootElement, fragments: Map[String, Element], config: Config, position: TreePosition) extends DocumentStructure with TreeContent

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

trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def appendContent(content: Block, contents: Block*): Document

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

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

def appendContent(newContent: Seq[Block]): Document

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

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

def prependContent(content: Block, contents: Block*): Document

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

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

def prependContent(newContent: Seq[Block]): Document

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

Creates the navigation structure for this document 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.

Creates the navigation structure for this document 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

Returns:

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

Inherited from:
DocumentNavigation
Inherited from:
DocumentStructure
def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product

The formats this tree content should be rendered to.

The formats this tree content should be rendered to.

Inherited from:
TreeContent
def title: Option[SpanSequence]

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
protected def titleFromConfig: Option[SpanSequence]
Inherited from:
TreeContent

Inherited fields

lazy val name: String

The local name of this navigatable.

The local name of this navigatable.

Inherited from:
Navigatable
lazy val sections: Seq[SectionInfo]

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