Skip to main content

Crate ferromark_transforms

Crate ferromark_transforms 

Source
Expand description

Optional ordered passes over Ferromark’s arena-backed Markdown AST.

This crate depends on ferromark and is not a dependency of the core parser or renderer. Construct a TransformPipeline only when AST passes are needed; an empty pipeline performs no traversal or URL scan.

§Custom pass

A pass borrows the parsed document and arena for one call. The same pass object can be reused for later documents, but it must not retain references into an arena that the caller may reset. See the packaged custom pass example. Pass objects are Send, so callers can move a configured pipeline to the thread that owns a document; documents and contexts stay thread-local.

Structs§

EmojiShortcodesPass
Replaces known gemoji@8.1.0 shortcode aliases in prose with Unicode emoji.
GitHubReferencesPass
Links a qualified subset of GitHub references using an explicit repository.
InvalidGitHubRepository
Error returned when a configured GitHub repository is not a safe owner/repo path.
TableOfContentsError
Error returned when an outline entry cannot become a TOC link.
TextRun
A maximal sequence of adjacent Text nodes in one sibling list.
TextRuns
Iterator over maximal adjacent text runs in a node slice.
TextSegment
One decoded text segment and the source range of its AST node.
TransformContext
Context available to a pass while one document is being transformed.
TransformError
Error from a pass, including its ordered identity in the pipeline.
TransformPipeline
Ordered collection of reusable AST transform passes.
TypographyOptions
Configuration for the optional typography pass.
TypographyPass
A pass that applies explicit language-aware typography to prose text.
UnsupportedTypographyLanguage
Error returned when a language code is not supported by the typography pass.

Enums§

TextReplacementError
Error returned when a pass replaces an invalid node or text range.
TypographyLanguage
A supported language for the optional typography pass.

Traits§

TransformPass
A stateful pass over one parsed document.

Functions§

build_table_of_contents
Builds a nested unordered-list AST node from one document outline.
text_runs
Iterates over maximal adjacent Text runs in one sibling list.

Type Aliases§

BoxError
The boxed, thread-safe error type returned by custom transform passes.