Skip to content

Themes and Documentation

darkstar edited this page Oct 3, 2026 · 2 revisions

Themes & Documentation

🎨 Themes

use diagprint::{Style, Theme};

let theme = Theme {
    border: Style::rgb(20, 185, 181),
    patch_add: Style::rgb(100, 255, 100),
    patch_remove: Style::rgb(255, 80, 100),
    ..Theme::default()
};

Styles support standard ANSI, ANSI-256, RGB foregrounds and backgrounds, hex colours, bold, dim, italic and underline. color(false) stays authoritative.

⚡ Cybercore palette

With the cybercore feature, diagprint uses the active Cybercore theme, the same CYBERGRID palette as the rest of the Cybercore family (and this wiki):

use diagprint::Theme;

let theme = Theme::cybercore();   // named Cybercore themes are supported too

It consumes Cybercore's semantic palette rather than duplicating colour values.

cargo run --features cybercore --example cybercore

📚 Documentation intelligence

DocumentationResolver resolves version-aware links using Cargo metadata and lockfiles: Rust error docs, Cargo Book pages, docs.rs for the exact package version, and custom links. Ambiguous versions fail closed.

📖 Terminal documentation (terminal-docs)

use diagprint::{DocumentationLink, TerminalDocViewer};

let link = DocumentationLink::rust_error("E0277");
TerminalDocViewer::new().width(96).open_and_print(&link)?;

HTTP/HTTPS only, size-limited, control characters sanitized, HTML converted to readable text, code examples extracted and highlighted. It currently uses blocking I/O.

← 🛡️ Safety Model  ·  🧪 Examples →

🩺 diagprint

⚡ Start

🧱 Build

📤 Ship

🔧 Fix

🔬 Investigate

🛠️ Project


🌐 Site · 📖 docs.rs · 📦 crates.io

Clone this wiki locally