Expand description
Aozora Flavored Markdown — CommonMark + GFM + 青空文庫記法.
Layers aozora-pipeline (青空文庫記法 borrowed-AST lexer) onto a
vendored verbatim comrak so a single render call
turns aozora-flavored-markdown source into HTML. Public entry points:
render— render aozora-flavored-markdown source straight to HTML.serialize— aozora-md-source round-trip (delegates toaozora::render::serialize::serialize).Options— configuration;Options::defaultenables the GFM extensions aozora-flavored-markdown uses on top of CommonMark.
use aozora_flavored_markdown::{Options, render};
let rendered = render("彼は|青梅《おうめ》に行った。", &Options::default());
assert!(rendered.html.contains("<ruby>"));§Pipeline
source ── UTF-8 input
│
▼ aozora::lex_into_arena ── normalized text + Registry
│
▼ comrak::parse_document ── vanilla CommonMark + GFM
│ (PUA sentinels U+E001..U+E004 flow through as plain text)
│
▼ comrak::format_html_with_options ── HTML with sentinels
│
▼ ast_splice::splice_into_ast ── sentinel → aozora-render,
│ · INLINE_SENTINEL → NodeValue::Raw inline node
│ · BLOCK_LEAF paragraphs → NodeValue::Raw block node
│ · BLOCK_OPEN/CLOSE paragraphs → container open/close raws
│
▼ comrak::format_html ── vanilla, sentinel-free AST
│
▼
HTMLComrak is unmodified: the v0.52.0 verbatim tree carries no Aozora-aware code (ADR-0001 budget = 0).
Modules§
- diagnostics
- aozora-flavored-markdown’s own diagnostic surface.
- html
- HTML rendering convenience entry.
- ir
- Intermediate representation produced by
crate::render_to_ir. - sentinels
- PUA sentinel codepoints embedded by
aozora_pipeline.
Structs§
- Diagnostic
- A non-fatal observation about a render.
- Options
- Parse-time configuration for
renderand friends. - Rendered
- Output of
render. - Rendered
Block - One block of
render_blocks_to_ir’s output. - Rendered
Ir - Output of
render_to_ir. - Span
- Byte-offset range into the (sanitized) source, end-exclusive.
Enums§
- Diagnostic
Source - Origin axis of a
Diagnostic: a user-input issue versus a library-internal invariant violation. Serialises to"source"/"internal". - Severity
- How strictly a host should treat a
Diagnostic. Serialises to the lowercase wire string ("error"/"warning"/"note").
Functions§
- render
- Render aozora-flavored-markdown source text to HTML.
- render_
blocks_ to_ ir - Per-block streaming render.
- render_
to_ ir - Render aozora-flavored-markdown source to a structured IR + HTML + diagnostics.
- serialize
- Round-trip an aozora-flavored-markdown source through the lexer and back to canonical aozora-md-source text.