Skip to main content

sim_lib_view_doc/
lib.rs

1//! Markup article workspace lens for the SIM Web UI.
2//!
3//! The article lens is a real authoring surface, not a markdown textarea: a
4//! round-trippable document value with semantic blocks (section, prose,
5//! equation, figure, table, citation, embedded-runtime block), an outline plus
6//! block canvas, side-by-side source and formatted views as two lenses on the
7//! same document value, and embedded live blocks via `scene/embed`.
8//!
9//! [`doc`] adapts article-shaped compatibility helpers to `MarkupDoc`; [`lens`]
10//! is the formatted and source lenses plus export over that shared markup value.
11
12#![forbid(unsafe_code)]
13#![deny(missing_docs)]
14
15mod citizen;
16pub mod cookbook;
17pub mod doc;
18pub mod lens;
19
20pub use citizen::{DocArticleDescriptor, doc_article_class_symbol};
21pub use cookbook::{article_demo, latex_lens_demo};
22pub use doc::{
23    ARTICLE_CLASS, article, article_from_markup, blocks, citation, embed_block, equation, figure,
24    markup_from_article, prose, section, table, title,
25};
26pub use lens::{
27    ARTICLE_FORMATTED_LENS, ARTICLE_SOURCE_LENS, article_formatted, article_outline,
28    article_source, export_intermediate, export_markdown, markup_edit_from_intent, with_cache,
29};
30
31/// Stable symbol for the scientific article lens.
32pub const ARTICLE_LENS: &str = ARTICLE_FORMATTED_LENS;
33
34/// Embedded cookbook recipe books shipped with this library.
35pub static RECIPES: sim_cookbook::EmbeddedDir =
36    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
37
38#[cfg(test)]
39mod tests;