MystNode

class MystNode(obj: JsonObject)

A lightweight wrapper over MyST's mdast-based AST.

MyST nodes are polymorphic (dozens of optional fields), so instead of a rigid data class per node type we keep the raw JsonObject and expose typed accessors. This is what lets the SAME core parse whatever mystmd build emits without breaking every time a new field appears.

Constructors

Link copied to clipboard
constructor(obj: JsonObject)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val frontmatter: JsonObject?

Page frontmatter (present on the root node of a resolved page).

Link copied to clipboard

Source pointer for provenance comments, if mystmd attached one.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun child(key: String): MystNode?

Nested JSON object field as a MystNode, e.g. a page document's mdast tree.

Link copied to clipboard
Link copied to clipboard
fun str(key: String): String?

Arbitrary string field, e.g. kind, url, lang, identifier, alt.