Module ast

Module ast 

Source
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§

CodeBlock
Fenced or indented code block.
Document
Root of a Markdown document
FootnoteDefinition
Footnote definition block (e.g., [^label]: content).
GitHubAlert
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).
LinkDefinition
Link reference definition (GFM) with a label, destination and optional title.
LinkReference
Reference-style link (e.g., [text][label] or [label][]).
List
A list container — bullet or ordered.
ListItem
Item within a list.
ListOrderedKindOptions
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.
CodeBlockKind
The concrete kind of a code block.
GitHubAlertType
GitHub markdown alerts types
HeadingKind
Heading with level 1–6 and inline content.
Inline
Inline-level elements within paragraphs, headings, and other blocks.
ListBulletKind
Concrete bullet character used for a bullet list.
ListKind
Specifies what kind of list we have.
SetextHeading
Setext heading with level and underline type.
TaskState
State of a task‑list checkbox.

Type Aliases§

SimpleBlock
Simple block without user data (backward compatible)
SimpleCodeBlock
Simple code block without user data (backward compatible)
SimpleDocument
Simple document without user data (backward compatible)
SimpleFootnoteDefinition
Simple footnote definition without user data (backward compatible)
SimpleGitHubAlert
Simple GitHub alert without user data (backward compatible)
SimpleHeading
Simple heading without user data (backward compatible)
SimpleImage
Simple image without user data (backward compatible)
SimpleInline
Simple inline without user data (backward compatible)
SimpleLink
Simple link without user data (backward compatible)
SimpleLinkDefinition
Simple link definition without user data (backward compatible)
SimpleLinkReference
Simple link reference without user data (backward compatible)
SimpleList
Simple list without user data (backward compatible)
SimpleListItem
Simple list item without user data (backward compatible)
SimpleTable
Simple table without user data (backward compatible)
SimpleTableCell
Simple table cell without user data (backward compatible)
SimpleTableRow
Simple table row without user data (backward compatible)
TableCell
A table cell is a vector of inlines (text, links, etc.).
TableRow
A table row is a vector of cells (columns).