Skip to main content

Crate mdwright_format

Crate mdwright_format 

Source

Structs§

CheckpointTable
Per-document table of top-level block boundaries.
FmtOptions
Formatter knobs.
FormatReport
Aggregate formatter rewrite counts.
MathOptions
Math canonicalisation configuration.

Enums§

EndOfLine
Line-ending policy. Keep adopts the first newline in the source.
FormatError
Errors returned by format_validated.
HeadingAttrsStyle
Heading-attribute trailer emission policy.
ItalicStyle
Italic delimiter normalisation policy. Defaults to Preserve: structural emit preserves each run’s source delimiter. Fixed variants are consumed only by the canonicalisation post-pass.
LinkDefStyle
Destination style for link reference definitions and inline links.
ListContinuationIndent
Continuation indentation for wrapped list-item paragraphs.
ListMarkerStyle
Unordered-list bullet normalisation policy. Defaults to Preserve: structural emit keeps each list’s source bullet.
MathRender
Delimiter rewrite policy for math regions at emit time.
OrderedListStyle
Ordered-list number normalisation policy.
Placement
Emission position for collected items (link reference definitions, footnote definitions). End (the default) gathers items and sorts them at the end of the document; Preserve keeps source order.
StrongStyle
Strong-emphasis delimiter normalisation policy. Defaults to Preserve. Independent of ItalicStyle so an author can canonicalise one without forcing the other.
TableStyle
GFM table canonicalisation policy.
ThematicStyle
Thematic-break canonicalisation policy. Defaults to Preserve: structural emit echoes the source --- / *** / ___ line verbatim. The fixed variants exist for the future canonicalisation pass.
TrailingNewline
Trailing-newline policy applied at the document boundary.
Wrap
Prose-wrap mode.
WrapStrategy
Paragraph-wrap planner.

Functions§

first_divergence
If source and formatted are not semantically equivalent, return a short human-readable description of the first divergent event pair. Returns None if the streams agree.
format_document
Format a parsed document.
format_document_with_report
Format a parsed document and return aggregate rewrite metrics.
format_range
Format the smallest set of whole top-level blocks that covers range in source.
format_range_with_checkpoints
Range-format using a pre-built CheckpointTable.
format_source
Parse and format Markdown source with default parse options.
format_validated
Format and verify that a second pass is semantically stable.
format_validated_with_report
Format, return aggregate metrics, and verify that a second pass is semantically stable.
semantically_equivalent
True iff the two Markdown sources parse to the same canonical document signature under default recognition policy.