Skip to main content

sim_codec_doc/
lib.rs

1//! Document domain codec for SIM.
2//!
3//! Provides `codec:doc`, a domain decoder/encoder pair that turns document
4//! text (plain or Markdown) into a structured document `Expr` and back, plus
5//! provenance-preserving chunk operations exposed as callable functions. As a
6//! domain codec it round-trips only documents and chunks and fails closed
7//! outside that domain.
8//!
9//! Module map (all modules are private; the public surface is re-exported from
10//! this crate root):
11//! - codec: the `DocCodec` decoder/encoder, the `DocCodecLib` host lib, and
12//!   `install_doc_codec`.
13//! - document: the document model (`DocValue`, `DocFormat`, `DocBlock`,
14//!   `DocChunk`, `ChunkOp`), `decode_document`, and the `chunk` operation.
15//! - functions: the `doc/chunk-*` chunking functions registered as callables.
16
17#![forbid(unsafe_code)]
18#![deny(missing_docs)]
19
20mod codec;
21mod document;
22mod functions;
23#[cfg(test)]
24mod tests;
25
26/// Cookbook recipes embedded from this crate's `recipes/` directory.
27pub static RECIPES: sim_cookbook::EmbeddedDir =
28    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
29
30pub use codec::{DocCodec, DocCodecLib, install_doc_codec};
31pub use document::{
32    ChunkOp, DocBlock, DocBlockKind, DocChunk, DocFormat, DocValue, chunk, decode_document,
33};