Skip to main content

Crate ferromark

Crate ferromark 

Source
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::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
DoS prevention constants.
link_ref
Link reference definitions (CommonMark).
range
Compact range representation for zero-copy text references.
render
HTML output writer with optimized buffer management.

Structs§

Options
Parsing/rendering options.
ParseResult
Result of parsing Markdown with front matter extraction.

Functions§

parse
Parse Markdown and return both HTML and front matter (if present).
parse_with_options
Parse Markdown with options and return both HTML and front matter.
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_with_options
Convert Markdown to HTML with options.