pub enum NodeKind {
Show 42 variants
Heading {
level: u8,
text: String,
id: Option<String>,
},
Paragraph,
CodeBlock {
language: Option<String>,
code: String,
},
ThematicBreak,
List {
ordered: bool,
start: Option<u32>,
tight: bool,
},
ListItem,
DefinitionList,
DefinitionTerm,
DefinitionDescription,
TaskCheckbox {
checked: bool,
},
Blockquote,
Admonition {
kind: AdmonitionKind,
title: Option<String>,
icon: Option<String>,
style: AdmonitionStyle,
},
TabGroup,
TabItem {
title: String,
},
SliderDeck {
timer_seconds: Option<u32>,
},
Slide {
vertical: bool,
},
Table {
alignments: Vec<TableAlignment>,
},
TableRow {
header: bool,
},
TableCell {
header: bool,
alignment: TableAlignment,
},
HtmlBlock {
html: String,
},
FootnoteDefinition {
label: String,
},
Text(String),
TaskCheckboxInline {
checked: bool,
},
Emphasis,
Strong,
StrongEmphasis,
Strikethrough,
Mark,
Superscript,
Subscript,
Link {
url: String,
title: Option<String>,
},
LinkReference {
label: String,
suffix: String,
},
FootnoteReference {
label: String,
},
Image {
url: String,
alt: String,
},
CodeSpan(String),
InlineHtml(String),
HardBreak,
SoftBreak,
PlatformMention {
username: String,
platform: String,
display: Option<String>,
},
InlineMath {
content: String,
},
DisplayMath {
content: String,
},
MermaidDiagram {
content: String,
},
}Expand description
All supported block and inline AST node kinds.
Variants§
Heading
ATX or setext heading node.
Fields
Paragraph
Paragraph container.
CodeBlock
Fenced or indented code block.
ThematicBreak
Horizontal rule (---, ***, ___).
List
Ordered or unordered list container.
Fields
ListItem
List item container.
DefinitionList
Extended definition lists (Markdown Guide / Markdown Extra-style).
Rendering convention:
- A
DefinitionListcontains alternatingDefinitionTerm(<dt>) andDefinitionDescription(<dd>) children. DefinitionTermshould contain inline children.DefinitionDescriptionshould contain block children.
DefinitionTerm
Definition term (dt) item.
DefinitionDescription
Definition description (dd) item.
TaskCheckbox
GFM task list checkbox marker for a list item.
This is emitted by the list parser when a list item begins with
[ ] or [x] / [X].
Rendering convention:
- This node is expected to appear as the first child inside a
ListItem. - The HTML renderer will convert it into a themed checkbox icon.
Blockquote
Blockquote container.
Admonition
GitHub-style admonition / alert (GFM extension).
This is created by a post-parse transformation that recognizes a special
first line inside a blockquote (e.g. [!NOTE]) and removes that marker.
Fields
kind: AdmonitionKindAdmonition semantic kind.
title: Option<String>Optional custom title for the admonition header.
Used by extended GFM-style admonitions (e.g. > [😂 Happy Header]).
icon: Option<String>Optional custom icon content (typically a Unicode emoji) for the title.
Rendered as text (not SVG) and must be styled by CSS.
style: AdmonitionStyleRender variant.
TabGroup
Extended tab blocks.
Syntax (container + items):
:::tab
@tab Title
Content...
:::Children convention:
- A
TabGroupcontains one or moreTabItemchildren. - Each
TabItemcontains block children representing the tab panel content.
TabItem
A single tab item inside a tab group.
SliderDeck
Extended slide decks (Reveal.js-like syntax, rendered as a simple slideshow).
Syntax:
@slidestart
slide 1
---
slide 2
@slideendOptional timer (seconds per slide): @slidestart:t5.
Children convention:
- A
SliderDeckcontains one or moreSlidechildren. - Each
Slidecontains block children representing the slide content.
Slide
A single slide inside a slider deck.
Fields
Table
GFM table (pipe table extension).
Children convention:
- Each child is a
TableRow. - Each
TableRowcontainsTableCellchildren.
Fields
alignments: Vec<TableAlignment>Per-column alignments.
TableRow
A single table row.
TableCell
A single table cell.
Fields
alignment: TableAlignmentEffective alignment for this cell.
HtmlBlock
Raw block-level HTML fragment.
FootnoteDefinition
GFM-style footnote definition (extension).
Syntax:
[^label]: definition text- Continuation lines may be indented.
Rendering convention:
- This node should not be rendered in place.
- Instead, the renderer collects referenced footnotes and emits a footnotes section at the end of the document.
Text(String)
Plain text inline content.
TaskCheckboxInline
Inline task checkbox marker (extension).
This is emitted when a paragraph begins with a task marker like
[ ] / [x] / [X] .
Rendering convention:
- The HTML renderer converts it into the same themed SVG checkbox icon used for task list items.
Emphasis
Emphasis inline container.
Strong
Strong emphasis inline container.
StrongEmphasis
Combined strong+emphasis, e.g. ***text*** or ___text___.
This is parsed as a single inline node to avoid leaving dangling delimiters that would otherwise be treated as plain text.
Strikethrough
Strikethrough (extension), e.g. ~~text~~.
Mark
Highlight/mark (extension), e.g. ==text==.
Superscript
Superscript (extension), e.g. ^text^.
Subscript
Subscript (extension), e.g. ~text~.
Link
Inline link node.
LinkReference
Reference-style link placeholder (CommonMark): [text][label], [label][], [label].
These cannot be fully resolved during inline parsing because reference
definitions may appear later in the document. The top-level parse()
performs a post-processing pass that converts this into a Link when a
matching definition exists in Document.references.
If no matching definition is found, this should be rendered as literal
bracketed text (preserving the already-parsed children for the first
bracketed segment).
Fields
FootnoteReference
GFM-style footnote reference (extension), e.g. [^label].
Rendering convention:
- If a matching
FootnoteDefinitionexists, this renders as a numbered superscript link. - Otherwise it should fall back to literal text.
Image
Inline image node.
CodeSpan(String)
Inline code span.
InlineHtml(String)
Inline HTML fragment.
HardBreak
Hard line break (two spaces + newline or backslash + newline).
SoftBreak
Soft line break.
PlatformMention
Extended user mentions.
Syntax:
@username[platform]@username[platform](Display Name)
Rendering policy:
- The renderer may convert this to an external profile link based on a platform mapping table.
Fields
InlineMath
Inline math (LaTeX), e.g. $E = mc^2$.
Rendering policy:
- Rendered using KaTeX in inline mode.
- Content is raw LaTeX source code.
DisplayMath
Display math (LaTeX), e.g. $$\int_0^\infty e^{-x^2} dx$$.
Rendering policy:
- Rendered using KaTeX in display mode.
- Content is raw LaTeX source code.
MermaidDiagram
Mermaid diagram (code block with language=“mermaid”).
Rendering policy:
- Rendered using mermaid-rs-renderer to SVG.
- Content is raw Mermaid diagram source code.
This is created during parsing when a fenced code block has info string “mermaid”.