API Reference
The Rust API reference is generated by cargo doc and published
alongside this book at:
afm crates (this repo)
These are the crates published from the afm workspace. They
compose the sibling aozora-* parser into a Markdown integration
layer.
afm_markdown— public entry points:render_to_string,render_to_ir,render_blocks_to_ir,serialize, plusOptions(withafm_default/commonmark_only/gfm_onlyfactories) and theIrDocument/IrBlock/IrInlinetree underafm_markdown::ir.afm_wasm—#[wasm_bindgen]surface used by afm-obsidian and other browser hosts. The IR is serialised throughserde-wasm-bindgenand matches the TypeScriptIRDocumentdeclared inafm-obsidian/src/ir/types.ts.afm-cli— theafmbinary. No library API; see CLI Reference for invocation details.
Sibling crates (aozora repo)
Pulled in as a git dependency from
P4suta/aozora. Their published
rustdoc lives on that repo’s GitHub Pages site; afm just embeds the
returned types in its own surface.
aozora_pipeline— the lex driver.lex_into_arena(src, &arena)produces theBorrowedLexOutput(normalized text +Registryof borrowedAozoraNodepayloads + diagnostics) thatafm-markdownconsumes.aozora_syntax— the borrowed AST:AozoraNode,Container,ContainerKind,BoutenKind,BoutenPosition,AozoraHeadingKind,Indent,AlignEnd,SectionKind, plus the arena types (Arena,NonEmpty,Registry,NodeRef).aozora_render— per-node HTML writer (render_node::render) and the source-level serializer (serialize::serialize). afm invokes the writer once per sentinel during HTML splicing.aozora_encoding— Shift_JIS decoder (decode_sjis) and the gaiji resolution table.aozora_spec—Diagnostic,Severity,DiagnosticSource,Span, sentinel codepoint constants.
Local preview
When viewing this handbook locally (e.g. via just book-serve) the
API link above will 404 — run cargo doc --workspace --no-deps and
mount the resulting target/doc/ at /afm/api/ to mirror the
published Pages layout, or visit the published site at
https://p4suta.github.io/afm/api/ directly.