Skip to main content

sim_cookbook/
lib.rs

1//! Cookbook engine for SIM: runnable, crate-local tutorial recipes.
2//!
3//! A *recipe* is a tiny lesson -- a runnable setup (in Lisp or any registered
4//! codec) plus a purpose document -- that ships inside the crate it teaches.
5//! When a lib loads, it registers its recipes as Card records; the *cookbook*
6//! is then a projection over those cards, grouped into books and chapters and
7//! rendered by every surface (CLI, WebUI, browse, agent).
8//!
9//! This crate owns the kernel-free cookbook engine: manifest parsing and lint,
10//! compile-time embedding, recipe stores, projection/search/next behavior, and
11//! deterministic user overlays. Runtime operations live in `sim-lib-cookbook`;
12//! the CLI, WebUI, browse/help, and agent surfaces all use that shared runtime
13//! projection instead of parallel cookbook logic.
14
15#![forbid(unsafe_code)]
16#![deny(missing_docs)]
17
18mod embed;
19mod embed_codegen;
20mod manifest;
21mod model;
22mod overlay;
23mod project;
24mod store;
25mod toml_lite;
26
27pub use embed::{EmbeddedDir, recipes_from_embedded};
28pub use embed_codegen::{generate_embed_code, write_embed};
29pub use manifest::{
30    BookManifest, ChapterManifest, DEFAULT_ORDER, Diagnostic, RecipeManifest, lint_dir, parse_book,
31    parse_chapter, parse_recipe,
32};
33pub use model::{
34    BookView, ChapterView, CheckResult, CookbookView, Expectation, RecipeCard, RecipeRun,
35    RecipeSource,
36};
37pub use overlay::{OverlayDirectives, apply_directives, load_overlay, parse_overlay};
38pub use project::{next, ordered_cards, search, view};
39pub use store::RecipeStore;
40pub use toml_lite::TomlValue;