MutableAstAttributes

data class MutableAstAttributes(var root: NestableNode? = null, val positionalLabels: MutableMap<Node, String> = mutableMapOf(), val locations: MutableMap<LocationTrackableNode, SectionLocation> = mutableMapOf(), val linkDefinitions: MutableList<LinkDefinition> = mutableListOf(), val functionCalls: MutableList<FunctionCallNode> = mutableListOf(), var hasCode: Boolean = false, var hasMath: Boolean = false, var hasMermaidDiagram: Boolean = false, var tableOfContents: TableOfContents? = null) : AstAttributes

Writeable attributes that are modified during the parsing process, and carry useful information for the next stages of the pipeline. Storing these attributes while parsing prevents a further visit of the final tree.

Parameters

root

the root node of the tree. According to the architecture, this is set right after the parsing stage

locations

the locations (in terms of section indices) of the nodes that request their location to be tracked. This is populated in the tree traversal stage of the pipeline

linkDefinitions

the defined links, which can be referenced by other nodes

functionCalls

the function calls to be later executed

hasCode

whether there is at least one code block.

hasMath

whether there is at least one math block or inline.

See also

Constructors

Link copied to clipboard
constructor(root: NestableNode? = null, positionalLabels: MutableMap<Node, String> = mutableMapOf(), locations: MutableMap<LocationTrackableNode, SectionLocation> = mutableMapOf(), linkDefinitions: MutableList<LinkDefinition> = mutableListOf(), functionCalls: MutableList<FunctionCallNode> = mutableListOf(), hasCode: Boolean = false, hasMath: Boolean = false, hasMermaidDiagram: Boolean = false, tableOfContents: TableOfContents? = null)

Properties

Link copied to clipboard
Link copied to clipboard
open override var hasCode: Boolean
Link copied to clipboard
open override var hasMath: Boolean
Link copied to clipboard
open override var hasMermaidDiagram: Boolean

Whether there is at least one Mermaid diagram. This is used to load the Mermaid library in HTML rendering only if necessary.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val positionalLabels: MutableMap<Node, String>

Labels/identifiers of nodes that are assigned it based on their position, both own (see locations) and relative to others of the same kind. The labels are often displayed in a caption. Examples of these nodes are figures and tables. For instance, depending on the document's NumberingFormat, an element may be labeled as 1.1, 1.2, 1.3, 2.1, etc.

Link copied to clipboard
open override var root: NestableNode?
Link copied to clipboard
open override var tableOfContents: TableOfContents?

The table of contents of all the headings in the document. This is generated by the tree traversal stage of the pipeline.

Functions

Link copied to clipboard
open override fun toMutable(): MutableAstAttributes