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 doc;
17pub mod lens;
18
19pub use citizen::{DocArticleDescriptor, doc_article_class_symbol};
20pub use doc::{
21    ARTICLE_CLASS, article, article_from_markup, blocks, citation, embed_block, equation, figure,
22    markup_from_article, prose, section, table, title,
23};
24pub use lens::{
25    ARTICLE_FORMATTED_LENS, ARTICLE_SOURCE_LENS, article_formatted, article_outline,
26    article_source, export_intermediate, export_markdown, markup_edit_from_intent, with_cache,
27};
28
29/// Stable symbol for the scientific article lens.
30pub const ARTICLE_LENS: &str = ARTICLE_FORMATTED_LENS;
31
32/// Embedded cookbook recipe books shipped with this library.
33pub static RECIPES: sim_cookbook::EmbeddedDir =
34    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
35
36#[cfg(test)]
37mod tests;