Expand description
Fully-typed Abstract Syntax Tree (AST) for CommonMark + GitHub Flavored Markdown.
§The AST module provides a generic AST structure. See ast::generic for more details.
Fully‑typed Abstract Syntax Tree (AST) for CommonMark + GitHub Flavored Markdown (GFM)
This module models every construct described in the CommonMark 1.0 specification together with the widely‑used GFM extensions: tables, strikethrough, autolinks, task‑list items and footnotes.
The design separates block‑level and inline‑level nodes because parsers and renderers typically operate on these tiers independently.
Document ─┐
└─ Block ─┐
├─ Inline
└─ ...§User Data Support
This crate supports attaching user-defined data to AST nodes through the generic
AST module. See crate::ast::generic for more details.
Modules§
- convert
- Conversion utilities for AST nodes with user data Conversion utilities for AST nodes with user data
- generic
- Generic AST types that support user-defined data Generic Abstract Syntax Tree (AST) for CommonMark + GitHub Flavored Markdown (GFM)
- map_
data_ visitor - Visitor-based MapData implementation to avoid recursion limits Non-recursive visitor-based implementation of MapData functionality
Structs§
- Code
Block - Fenced or indented code block.
- Document
- Root of a Markdown document
- Footnote
Definition - Footnote definition block (e.g.,
[^label]: content). - GitHub
Alert - GitHub alert block
- Heading
- Heading with level 1–6 and inline content.
- Image
- Re‑usable structure for links and images (destination + children).
- Link
- Re‑usable structure for links and images (destination + children).
- Link
Definition - Link reference definition (GFM) with a label, destination and optional title.
- Link
Reference - Reference-style link (e.g.,
[text][label]or[label][]). - List
- A list container — bullet or ordered.
- List
Item - Item within a list.
- List
Ordered Kind Options - Specifies what kind of list we have.
- Table
- A table is a collection of rows and columns with optional alignment. The first row is the header row.
Enums§
- Alignment
- Specifies the alignment of a table cell.
- Block
- Block‑level constructs in the order they appear in the CommonMark spec.
- Code
Block Kind - The concrete kind of a code block.
- GitHub
Alert Type - GitHub markdown alerts types
- Heading
Kind - Heading with level 1–6 and inline content.
- Inline
- Inline-level elements within paragraphs, headings, and other blocks.
- List
Bullet Kind - Concrete bullet character used for a bullet list.
- List
Kind - Specifies what kind of list we have.
- Setext
Heading - Setext heading with level and underline type.
- Task
State - State of a task‑list checkbox.
Type Aliases§
- Simple
Block - Simple block without user data (backward compatible)
- Simple
Code Block - Simple code block without user data (backward compatible)
- Simple
Document - Simple document without user data (backward compatible)
- Simple
Footnote Definition - Simple footnote definition without user data (backward compatible)
- Simple
GitHub Alert - Simple GitHub alert without user data (backward compatible)
- Simple
Heading - Simple heading without user data (backward compatible)
- Simple
Image - Simple image without user data (backward compatible)
- Simple
Inline - Simple inline without user data (backward compatible)
- Simple
Link - Simple link without user data (backward compatible)
- Simple
Link Definition - Simple link definition without user data (backward compatible)
- Simple
Link Reference - Simple link reference without user data (backward compatible)
- Simple
List - Simple list without user data (backward compatible)
- Simple
List Item - Simple list item without user data (backward compatible)
- Simple
Table - Simple table without user data (backward compatible)
- Simple
Table Cell - Simple table cell without user data (backward compatible)
- Simple
Table Row - Simple table row without user data (backward compatible)
- Table
Cell - A table cell is a vector of inlines (text, links, etc.).
- Table
Row - A table row is a vector of cells (columns).