| Crates.io | rustdoc-text |
| lib.rs | rustdoc-text |
| version | 0.3.3 |
| created_at | 2025-03-17 00:36:32.231378+00 |
| updated_at | 2025-11-03 23:23:30.393635+00 |
| description | A lightweight library and CLI tool to view Rust documentation as plain text |
| homepage | |
| repository | https://github.com/lmmx/rustdoc-text |
| max_upload_size | |
| id | 1594882 |
| size | 85,453 |
A lightweight library and CLI tool to view Rust documentation as plain text (Markdown) in the terminal.
Similar to tools like pydoc and godoc, but for Rust documentation.
cargo install rustdoc-text
--online is recommended!# View documentation for a crate
rustdoc-text serde
# View documentation from docs.rs (instead of building locally)
rustdoc-text --online tokio
# View documentation for a specific item in a crate
rustdoc-text serde Deserializer
# View documentation for a specific sub-item in a crate
rustdoc-text --online ropey struct.Rope
# Get help
rustdoc-text --help
If you're not getting the particular URL resolved that you want, read the source here to see how it is being converted from your input.
use rustdoc_text::Config;
use anyhow::Result;
fn main() -> Result<()> {
// Simple usage
let docs = Config::new("serde")
.with_online(true)
.execute()?;
println!("{}", docs);
// Or use the functions directly
let tokio_docs = rustdoc_text::fetch_online_docs("tokio", Some("Runtime"))?;
println!("{}", tokio_docs);
Ok(())
}
This tool:
Markdown is a lightweight markup language that's very readable as plain text, making it ideal for terminal output. It preserves the structure of the documentation while being much more readable than raw HTML.
htmd: For HTML to Markdown conversionclap: For command-line argument parsingreqwest: For fetching online documentationanyhow: For error handlingscraper: For HTML parsingThis project is licensed under the MIT License - see the LICENSE file for details.