Skip to main content

NodeKind

Enum NodeKind 

Source
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, },
}

Variants§

§

Heading

Fields

§level: u8
§text: String
§id: Option<String>

Explicit heading id, e.g. ### Title {#custom-id}.

When present, the renderer should emit it as id="..." on the heading element.

§

Paragraph

§

CodeBlock

Fields

§language: Option<String>
§code: String
§

ThematicBreak

§

List

Fields

§ordered: bool
§start: Option<u32>
§tight: bool
§

ListItem

§

DefinitionList

Extended definition lists (Markdown Guide / Markdown Extra-style).

Rendering convention:

  • A DefinitionList contains alternating DefinitionTerm (<dt>) and DefinitionDescription (<dd>) children.
  • DefinitionTerm should contain inline children.
  • DefinitionDescription should contain block children.
§

DefinitionTerm

§

DefinitionDescription

§

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.

Fields

§checked: bool
§

Blockquote

§

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

§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: AdmonitionStyle

Render variant.

§

TabGroup

Marco extended tab blocks.

Syntax (container + items):

:::tab
@tab Title
Content...
:::

Children convention:

  • A TabGroup contains one or more TabItem children.
  • Each TabItem contains block children representing the tab panel content.
§

TabItem

Fields

§title: String
§

SliderDeck

Marco sliders (planned Reveal.js-like syntax, rendered as a simple slideshow).

Syntax:

@slidestart
slide 1
---
slide 2
@slideend

Optional timer (seconds per slide): @slidestart:t5.

Children convention:

  • A SliderDeck contains one or more Slide children.
  • Each Slide contains block children representing the slide content.

Fields

§timer_seconds: Option<u32>
§

Slide

Fields

§vertical: bool

True if this slide started after a vertical separator (--).

The current Marco viewer treats slides as a single linear sequence (left/right). This flag is preserved for future vertical navigation.

§

Table

GFM table (pipe table extension).

Children convention:

  • Each child is a TableRow.
  • Each TableRow contains TableCell children.

Fields

§alignments: Vec<TableAlignment>
§

TableRow

Fields

§header: bool
§

TableCell

Fields

§header: bool
§alignment: TableAlignment
§

HtmlBlock

Fields

§html: String
§

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.

Fields

§label: String
§

Text(String)

§

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.

Fields

§checked: bool
§

Emphasis

§

Strong

§

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~.

Fields

§

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

§label: String

Label used for reference resolution (will be normalized when looked up).

§suffix: String

Extra literal suffix after the first ] (e.g. "[]" or "[label]"). Empty for shortcut reference links.

§

FootnoteReference

GFM-style footnote reference (extension), e.g. [^label].

Rendering convention:

  • If a matching FootnoteDefinition exists, this renders as a numbered superscript link.
  • Otherwise it should fall back to literal text.

Fields

§label: String
§

Image

Fields

§

CodeSpan(String)

§

InlineHtml(String)

§

HardBreak

§

SoftBreak

§

PlatformMention

Marco 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

§username: String
§platform: String
§display: Option<String>
§

InlineMath

Inline math (LaTeX), e.g. $E = mc^2$.

Rendering policy:

  • Rendered using KaTeX in inline mode.
  • Content is raw LaTeX source code.

Fields

§content: String
§

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.

Fields

§content: String
§

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”.

Fields

§content: String

Trait Implementations§

Source§

impl Clone for NodeKind

Source§

fn clone(&self) -> NodeKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NodeKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.