case class Document(path: Path, content: RootElement, fragments: Map[String, Element] = Map.empty, config: Config = Config.empty, position: TreePosition = TreePosition.orphan) extends DocumentStructure with TreeContent with Product with Serializable
Represents a single document and provides access to the document content and structure as well as hooks for triggering rewrite operations.
- path
the full, absolute path of this document in the (virtual) document tree
- content
the tree model obtained from parsing the markup document
- fragments
separate named fragments that had been extracted from the content
- config
the configuration for this document
- position
the position of this document inside a document tree hierarchy, expressed as a list of Ints
- Alphabetic
- By Inheritance
- Document
- Serializable
- Serializable
- Product
- Equals
- TreeContent
- DocumentStructure
- DocumentNavigation
- Navigatable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Document(path: Path, content: RootElement, fragments: Map[String, Element] = Map.empty, config: Config = Config.empty, position: TreePosition = TreePosition.orphan)
- path
the full, absolute path of this document in the (virtual) document tree
- content
the tree model obtained from parsing the markup document
- fragments
separate named fragments that had been extracted from the content
- config
the configuration for this document
- position
the position of this document inside a document tree hierarchy, expressed as a list of Ints
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
appendContent(newContent: Seq[Block]): Document
Appends the specified content to this tree and return a new instance.
-
def
appendContent(content: Block, contents: Block*): Document
Appends the specified content to this tree and return a new instance.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asNavigationItem(context: NavigationBuilderContext = NavigationBuilderContext()): NavigationItem
Creates the navigation structure for this document up to the specified depth.
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.
- 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
- Definition Classes
- DocumentNavigation
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
val
config: Config
The configuration associated with this element.
The configuration associated with this element.
- Definition Classes
- Document → TreeContent
-
val
configScope: Scope
- Attributes
- protected
- Definition Classes
- Document → TreeContent
-
val
content: RootElement
The tree model obtained from parsing the markup document.
The tree model obtained from parsing the markup document.
- Definition Classes
- Document → DocumentStructure
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val fragments: Map[String, Element]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
invalidElements(filter: MessageFilter): Seq[Invalid]
- Definition Classes
- DocumentStructure
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
lazy val
name: String
The local name of this navigatable.
The local name of this navigatable.
- Definition Classes
- Navigatable
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
val
path: Path
- Definition Classes
- Document → Navigatable
-
val
position: TreePosition
The position of this element within the document tree.
The position of this element within the document tree.
- Definition Classes
- Document → TreeContent
-
def
prependContent(newContent: Seq[Block]): Document
Prepends 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.
-
def
rewrite(rules: RewriteRules): Either[ConfigError, Document]
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 returnsReplace
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.
-
def
runtimeMessages(filter: MessageFilter): Seq[RuntimeMessage]
- Definition Classes
- DocumentStructure
-
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.
- Definition Classes
- DocumentStructure → DocumentNavigation
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
targetFormats: TargetFormats
The formats this tree content should be rendered to.
The formats this tree content should be rendered to.
- Definition Classes
- TreeContent
-
def
title: Option[SpanSequence]
The title of this document, obtained from the document structure or from the configuration.
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
.- Definition Classes
- DocumentStructure → DocumentNavigation
-
def
titleFromConfig: Option[SpanSequence]
- Attributes
- protected
- Definition Classes
- TreeContent
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated