README

oilleelssq-wq/moonmarkdown/types does not have a README file

#
Block

pub(all) enum Block {
Document(Array[Block])
BlockQuote(Array[Block])
ListItem(Array[Block])
List(Int?, Bool, UInt16, Array[Block])
Paragraph(Array[Inline])
Heading(Int, Array[Inline])
FencedCodeBlock(String, String)
IndentedCodeBlock(String)
ThematicBreak
HTMLBlock(String)
LinkReferenceDefinition(String, String, String?)
}

CommonMark Block-level AST node types.

This enum represents all block-level constructs defined by the CommonMark specification (0.31.2). Block nodes form the structural skeleton of a parsed Markdown document.

Variant Groups

Container Blocks

These blocks can contain other blocks as children:
  • Document — the root node, contains all top-level blocks
  • BlockQuote — quoted content, recursively contains blocks
  • ListItem — a single list item, contains child blocks
  • List — ordered or unordered list, contains list items

Leaf Blocks

These blocks contain inline content or raw text:
  • Paragraph — regular text paragraph
  • Heading — ATX or Setext heading
  • FencedCodeBlock — code delimited by ``` or ~~~
  • IndentedCodeBlock — code indented by 4+ spaces
  • ThematicBreak — horizontal rule (---, ***, ___)
  • HTMLBlock — raw HTML content

Meta Blocks

  • LinkReferenceDefinition — parsed but not rendered directly

#
CssPreset

pub(all) enum CssPreset {
None
Default
Bootstrap
}

CSS class preset used by the HTML renderer.

#
Inline

pub(all) enum Inline {
Text(String)
CodeSpan(String)
Emphasis(Array[Inline])
Strong(Array[Inline])
Link(Array[Inline], String, String?)
Image(Array[Inline], String, String?)
HardBreak
SoftBreak
RawHTML(String)
HtmlEntity(String)
Autolink(String)
Strikethrough(Array[Inline])
}

CommonMark Inline-level AST node types.

Inline nodes represent formatted content within leaf blocks (paragraphs, headings). The inline parser converts raw text into a tree of these nodes.

Node Types

Text and Code

  • Text — plain text content (always HTML-escaped during rendering)
  • CodeSpan — inline code (backtick-delimited)

Emphasis

  • Emphasis — italic (*text* or _text_)
  • Strong — bold (**text** or __text__)
  • Strikethrough — deleted text (~~text~~, GFM extension)

Links and Media

  • Link — hyperlink ([text](url "title"))
  • Image — embedded image (![alt](url "title"))
  • Autolink — bare URL/email (<https://...>)

Line Breaks

  • HardBreak — explicit line break (backslash-newline)
  • SoftBreak — implicit line break (newline in paragraph)

Raw Content

  • RawHTML — inline HTML passed through unchanged
  • HtmlEntity — decoded HTML entity reference

#
MarkdownOptions

pub(all) struct MarkdownOptions {
gfm : Bool
smart : Bool
html : Bool
entities : Bool
reference_links : Bool
highlight : Bool
css : CssPreset
}

Controls parsing and rendering behavior.

#
MarkdownOptions::default

Create a MarkdownOptions with all extensions disabled.

#
MarkdownOptions::gfm

Create a MarkdownOptions with GFM extensions enabled.

#
MarkdownOptions::with_bootstrap_css

fn MarkdownOptions::with_bootstrap_css(self : MarkdownOptions) -> MarkdownOptions

Create a MarkdownOptions with the Bootstrap CSS class preset.

#
MarkdownOptions::with_css

Return a copy with a CSS class preset.

#
MarkdownOptions::with_default_css

fn MarkdownOptions::with_default_css(self : MarkdownOptions) -> MarkdownOptions

Create a MarkdownOptions with the default CSS class preset.

#
MarkdownOptions::with_highlight

fn MarkdownOptions::with_highlight(self : MarkdownOptions, highlight : Bool) -> MarkdownOptions

Return a copy with syntax highlighting enabled or disabled.

#
MarkdownOptions::with_html

fn MarkdownOptions::with_html(self : MarkdownOptions, html : Bool) -> MarkdownOptions

Return a copy with raw HTML passthrough enabled or disabled.