Expand description
ferromark: Ultra-high-performance Markdown to HTML compiler
This crate provides a streaming Markdown parser optimized for speed, targeting 20-30% better throughput than existing Rust parsers.
§Design Principles
- No AST: streaming events only
- No regex: pure byte-level scanning
- No backtracking: O(n) time on all inputs
- Minimal allocations: ranges into input buffer
§Future Optimizations
simdutf/simdutf8: SIMD-accelerated UTF-8 validation for input- NEON intrinsics for ARM: inline marker scanning
- Loop unrolling in hot paths (4x unroll like md4c)
Re-exports§
pub use block::Alignment;pub use block::BlockEvent;pub use block::BlockParser;pub use block::CalloutType;pub use block::CodeBlockKind;pub use block::fixup_list_tight;pub use footnote::FootnoteStore;pub use inline::InlineEvent;pub use inline::InlineParser;pub use link_ref::LinkRefDef;pub use link_ref::LinkRefStore;pub use range::Range;pub use render::HtmlWriter;
Modules§
- block
- Block-level parser for Markdown.
- cursor
- Pointer-based cursor for high-performance byte scanning.
- escape
- HTML escaping utilities.
- footnote
- Footnote definitions storage.
- inline
- Inline parser for Markdown.
- limits
- Enforced parser resource limits.
- link_
ref - Link reference definitions (CommonMark).
- range
- Compact range representation for zero-copy text references.
- render
- HTML output writer with optimized buffer management.
Structs§
- Fenced
Code Block - A complete fenced code block passed to a custom renderer.
- Heading
- One document heading collected during rendering.
- Options
- Parsing/rendering options.
- Parse
Result - Result of parsing Markdown with front matter extraction.
- Trusted
Html - HTML that a
FencedCodeRendererhas explicitly marked as trusted.
Enums§
- Render
Policy - Trust boundary applied while rendering links, images, and raw HTML.
Traits§
- Fenced
Code Renderer - Opt-in renderer for complete fenced code blocks.
Functions§
- parse
- Parse Markdown and return HTML, front matter, and headings.
- parse_
with_ options - Parse Markdown with options and return HTML, front matter, and headings.
- parse_
with_ renderer - Parse Markdown with options and an opt-in fenced-code renderer, returning HTML, front matter, and headings.
- to_html
- Convert Markdown to HTML.
- to_
html_ into - Convert Markdown to HTML, writing into a provided buffer.
- to_
html_ into_ with_ options - Convert Markdown to HTML into a provided buffer with options.
- to_
html_ into_ with_ renderer - Convert Markdown into a reusable buffer with an opt-in fenced-code renderer.
- to_
html_ with_ options - Convert Markdown to HTML with options.
- to_
html_ with_ renderer - Convert Markdown to HTML with an opt-in fenced-code renderer.