Expand description
Document domain codec for SIM.
Provides codec:doc, a domain decoder/encoder pair that turns document
text (plain or Markdown) into a structured document Expr and back, plus
provenance-preserving chunk operations exposed as callable functions. As a
domain codec it round-trips only documents and chunks and fails closed
outside that domain.
Module map (all modules are private; the public surface is re-exported from this crate root):
- codec: the
DocCodecdecoder/encoder, theDocCodecLibhost lib, andinstall_doc_codec. - document: the document model (
DocValue,DocFormat,DocBlock,DocChunk,ChunkOp),decode_document, and thechunkoperation. - functions: the
doc/chunk-*chunking functions registered as callables.
Structs§
- DocBlock
- One parsed span of a document, carrying its byte offsets and the heading path in effect where it appears.
- DocChunk
- A provenance-preserving slice of a document produced by
chunk. - DocCodec
- The
codec:docdecoder/encoder. - DocCodec
Lib - The host-registered
Libthat installsDocCodecascodec:docand thedoc/chunk-*chunking functions. - DocValue
- A decoded document: its full source text, detected format, and the ordered
DocBlocks parsed from it.
Enums§
- ChunkOp
- A chunking strategy selecting how
chunksplits aDocValue. - DocBlock
Kind - The category of a
DocBlock. - DocFormat
- The detected surface format of a decoded document.
Statics§
- RECIPES
- Cookbook recipes embedded from this crate’s
recipes/directory.
Functions§
- chunk
- Split a decoded
docintoDocChunks according toop. - decode_
document - Parse document
textinto aDocValue, recording per-block byte offsets and heading paths. - install_
doc_ codec - Install
DocCodecLibintocx, registeringcodec:docand thedoc/chunk-*functions with a freshly allocated codec id.