rtb_docs/lib.rs
1//! Interactive docs browser + embedded HTML server.
2//!
3//! # What ships
4//!
5//! - [`DocsBrowser`] — two-pane `ratatui` TUI over an embedded
6//! markdown tree. Left pane is an index built from `_index.yaml`
7//! (with a fallback filesystem scan); right pane renders the
8//! selected page via `tui-markdown`.
9//! - [`DocsServer`] — loopback-only HTTP server rendering the same
10//! tree as HTML. Airgap-friendly — the tool binary carries
11//! everything it needs via `rtb-assets`.
12//! - [`search`] — `tantivy`-backed full-text search over rendered
13//! markdown bodies, plus a `fuzzy-matcher`-powered title search.
14//! - `ai` — trait seam for streaming Q&A. Empty at v0.1; gets
15//! filled in when `rtb-ai` (now `rtb-chat`) landed in v0.3. Gated on the `ai`
16//! Cargo feature.
17//!
18//! # What's deferred to 0.2.x follow-ups
19//!
20//! - Full clap dispatch layer for the `docs` subcommand (list /
21//! show / browse / serve / ask). The `DocsCmd` ships as a
22//! discoverability shim at v0.1.
23//! - `TestBackend`-driven rendering assertions.
24//! - Framework-docs-merge (spec § 2.7 O5 resolution).
25//!
26//! See `docs/development/specs/2026-04-23-rtb-docs-v0.1.md`.
27
28// `deny` (not `forbid`) so `command.rs` can allow `unsafe_code` for
29// the `linkme::distributed_slice` registration — same rationale as
30// `rtb-forge` / `rtb-update`. No hand-rolled unsafe anywhere.
31#![deny(unsafe_code)]
32
33pub mod ai;
34pub mod browser;
35pub mod command;
36pub mod error;
37pub mod index;
38pub mod loader;
39pub mod render;
40pub mod search;
41pub mod server;
42
43pub use browser::DocsBrowser;
44pub use error::DocsError;
45pub use index::{Index, IndexEntry};
46pub use server::DocsServer;