docs_core/lib.rs
1//! docs-core — the Rust docs pipeline core (ADR-0004 §2.5).
2//!
3//! Consolidates what Tachyon (16 crates), `docs-pipeline`, and the eight
4//! `starlight-*` plugins do in three languages: CommonMark+GFM to static
5//! HTML, plus **astro-island-compatible island emission** so the estate's
6//! existing SolidJS bundles hydrate inside a Rust-rendered shell — the one
7//! seam the ecosystem has no answer for (Leptos/Dioxus islands are
8//! Rust/WASM-only).
9//!
10//! ```
11//! let html = docs_core::render(
12//! "# Chisel\n\nSome *prose*.\n\n```island nav-search client=visible\n{\"count\": 3}\n```\n",
13//! "/_assets",
14//! )
15//! .unwrap();
16//! assert!(html.contains("<h1>Chisel</h1>"));
17//! assert!(html.contains("component-url=\"/_assets/islands/nav-search.js\""));
18//! ```
19//!
20//! # Scope (M1 + Wave 2 math/sanitization, honest)
21//!
22//! In: headings, paragraphs, emphasis/strong/strike, inline + fenced code,
23//! links, images, lists (incl. task lists), blockquotes, rules, island
24//! fences, math (`$...$` / `$$...$$` as build-time MathML via
25//! `latex2mathml` - no client JS, Wave 2), and sanitization for
26//! untrusted content (`sanitize` + `render_untrusted`; islands are
27//! stripped pre-render there, Wave 2).
28//! Out (Wave 2 remainder): search indexing (Pagefind; closed - docs-search
29//! is the answer, native-only per SPEC), versioning, i18n, diagrams (D2),
30//! and the dev server (lands in docs-compiler: docs-core is L2, no web
31//! framework).
32//!
33//! # Layer
34//!
35//! L2 — domain. One external dependency (`pulldown-cmark`); no UI, no web
36//! framework — the output is static HTML plus island custom elements.
37
38#![deny(missing_docs)]
39#![forbid(unsafe_code)]
40
41mod error;
42mod island;
43mod render;
44mod sanitize;
45
46pub use error::DocsError;
47pub use island::{Client, Island};
48pub use render::render;
49pub use sanitize::{render_untrusted, sanitize};
50
51/// The crate's version, for callers that report it.
52pub const VERSION: &str = env!("CARGO_PKG_VERSION");