Skip to main content

Crate rtb_docs

Crate rtb_docs 

Source
Expand description

Interactive docs browser + embedded HTML server.

§What ships

  • DocsBrowser — two-pane ratatui TUI over an embedded markdown tree. Left pane is an index built from _index.yaml (with a fallback filesystem scan); right pane renders the selected page via tui-markdown.
  • DocsServer — loopback-only HTTP server rendering the same tree as HTML. Airgap-friendly — the tool binary carries everything it needs via rtb-assets.
  • searchtantivy-backed full-text search over rendered markdown bodies, plus a fuzzy-matcher-powered title search.
  • ai — trait seam for streaming Q&A. Empty at v0.1; gets filled in when rtb-ai lands in v0.3. Gated on the ai Cargo feature.

§What’s deferred to 0.2.x follow-ups

  • Full clap dispatch layer for the docs subcommand (list / show / browse / serve / ask). The DocsCmd ships as a discoverability shim at v0.1.
  • TestBackend-driven rendering assertions.
  • Framework-docs-merge (spec § 2.7 O5 resolution).

See docs/development/specs/2026-04-23-rtb-docs-v0.1.md.

Re-exports§

pub use browser::DocsBrowser;
pub use error::DocsError;
pub use index::Index;
pub use index::IndexEntry;
pub use server::DocsServer;

Modules§

browser
DocsBrowser — two-pane ratatui TUI over an embedded markdown tree.
command
docs CLI subcommand — list | show | browse | serve | ask.
error
DocsError — every failure mode the browser / server / search path can surface.
index
Navigation index — either parsed from _index.yaml under the doc-tree root or synthesised from a recursive .md file scan.
loader
Load docs from an rtb_assets::Assets tree into the (Index, HashMap<path, body>) shape that crate::DocsBrowser and crate::DocsServer consume.
render
Markdown rendering adapters.
search
Title + full-text search over the doc tree.
server
DocsServer — loopback HTTP server that renders the embedded markdown tree as HTML for airgapped end-users.