Skip to content

rtb-docs v0.1

Ships a tool's documentation inside the binary and makes it browsable offline — a two-pane TUI, a loopback HTML server, and full-text search, all over a markdown tree carried by rtb-assets. Airgap-friendly: the binary needs no network to render its own docs.

Public API

use std::collections::HashMap;
use rtb_docs::{DocsBrowser, Index};

# fn build(index: Index, pages: HashMap<String, String>) -> Result<DocsBrowser, rtb_docs::DocsError> {
// `new(index, pages)` builds the browser from the doc index and the
// rendered page bodies. It's a ratatui widget — drive `render()`
// from your own event loop (or let the `docs` command do it).
let browser = DocsBrowser::new(index, pages)?;
# Ok(browser)
# }
Item Purpose
[DocsBrowser] Two-pane ratatui widget. Left: index from _index.yaml (filesystem-scan fallback); right: tui-markdown-rendered page.
[DocsServer] Loopback-only HTTP server rendering the same tree as HTML.
[Index], [IndexEntry] The navigable doc index model.
[search] tantivy full-text search over rendered bodies + fuzzy-matcher title search.
[DocsError] thiserror + miette::Diagnostic error enum.

CLI

The docs command is a default-enabled runtime feature. At v0.1 the DocsCmd is a discoverability shim; the full clap dispatch layer (list / show / browse / serve / ask) is a 0.2.x follow-up.

Streaming AI Q&A

The ai module is a trait seam for streaming question-answering over the docs corpus, gated on the ai Cargo feature and backed by rtb-ai — see configure an AI provider. The seam is empty at v0.1; the streaming Q&A implementation is a follow-up.

Spec

Authoritative contract: docs/development/specs/2026-04-23-rtb-docs-v0.1.md.