Skip to main content

Module extensions

Module extensions 

Source
Expand description

The extensions module contains custom block and table extensions. Extension functionality for the MDX Gen library.

This module provides utilities for enhancing Markdown processing, including custom block handling and table formatting. Syntax highlighting has moved to crate::highlight.

Structs§

CustomBlockConfig
Configuration for custom block rendering.
Heading
A single heading discovered in a Markdown document.

Enums§

ColumnAlignment
Alignment options for table columns.
CustomBlockType
Represents different types of custom blocks.

Functions§

collect_all_text
Recursively concatenates the plain-text content of a node’s subtree, stripping all Markdown and HTML markup. Blocks are separated by whitespace to prevent words from merging.
collect_headings
Walks the AST and returns one Heading per heading node, in document order.
enhance_table_nodes
Walks the comrak AST and replaces Table nodes with HtmlBlock nodes containing responsive-wrapped, class-enhanced table HTML.
process_custom_block_nodes
Walks the comrak AST and transforms HtmlBlock nodes that contain known custom block divs into styled alert HTML.
process_custom_blocks
Processes custom blocks in an HTML string.
process_tables
Processes tables, enhancing them with responsive design and alignment classes.