Heading

class Heading(val depth: Int, val text: InlineContent, val isDecorative: Boolean = false, val customId: String? = null) : TextNode, Identifiable, LocationTrackableNode

A heading defined via prefix symbols. A heading is identifiable, as it can be looked up in the document and can be referenced. It is also location trackable, meaning its position in the document hierarchy is determined, and possibly displayed.

Parameters

depth

importance (depth=1 for H1, depth=6 for H6)

isDecorative

whether this heading is decorative. A decorative heading does not trigger automatic page breaks and is not counted in the document's hierarchy and is not numbered.

customId

optional custom ID. If null, the ID is automatically generated

Constructors

Link copied to clipboard
constructor(depth: Int, text: InlineContent, isDecorative: Boolean = false, customId: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val canTrackLocation: Boolean

Decorative headings are not assigned a location and are not counted.

Link copied to clipboard
open override val children: List<Node>
Link copied to clipboard
val customId: String? = null
Link copied to clipboard
val depth: Int
Link copied to clipboard
val isDecorative: Boolean = false
Link copied to clipboard
Link copied to clipboard
open override val text: InlineContent

The text of the node as processed inline content.

Functions

Link copied to clipboard
open override fun <T> accept(visitor: IdentifierProvider<T>): T

Accepts an IdentifierProvider to generate an identifier for this element.

open override fun <T> accept(visitor: NodeVisitor<T>): T

Accepts a visitor.

Link copied to clipboard

Returns a sequence of all nodes in the tree, where this is the root node. The sequence is generated by traversing the tree in depth-first order. The root node is excluded from the sequence.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard