Skip to main content

Module serialize

Module serialize 

Source
Expand description

AST to Markdown. The verbs live on Document (to_markdown / to_markdown_with); SerializeOptions tunes the output style. The document is validated first, so serialization can fail with a SerializeError.

A document with its source is written partly from it (reuse, decision 0020): each node that corresponds to the node its source parses to is written as its source, an edited one with its own syntax copied around what changed, and the rest is rendered. Rendering only renders: each node is written in the spelling the AST records for it, or else by one fixed rule, with text, escapes, and character references as recorded. The output is parsed back only to check the blocks written partly from the source.

Structs§

SerializeOptions
Output-style options for serialization. Defaults: LF, trailing newline, and the list markers and code fences the AST records.

Enums§

BulletMarker
The bullet char SerializeOptions::bullet writes unordered lists with.
LineEnding
The newline style emitted by the serializer.
OrderedDelimiter
The delimiter SerializeOptions::ordered_delimiter writes ordered-list markers with.
SerializeError
Why serialization failed.