Skip to main content

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, honest)
21//!
22//! In: headings, paragraphs, emphasis/strong/strike, inline + fenced code,
23//! links, images, lists (incl. task lists), blockquotes, rules, and island
24//! fences.
25//! Out (Wave 2, per the ecosystem survey): search indexing (Pagefind),
26//! versioning, i18n, math (`latex2mathml`), diagrams (D2), HTML
27//! sanitization for untrusted content (`ammonia`), and the dev server.
28//!
29//! # Layer
30//!
31//! L2 — domain. One external dependency (`pulldown-cmark`); no UI, no web
32//! framework — the output is static HTML plus island custom elements.
33
34#![deny(missing_docs)]
35#![forbid(unsafe_code)]
36
37mod error;
38mod island;
39mod render;
40
41pub use error::DocsError;
42pub use island::{Client, Island};
43pub use render::render;
44
45/// The crate's version, for callers that report it.
46pub const VERSION: &str = env!("CARGO_PKG_VERSION");