RUSTDOC(1)
๐ NAME ๐
rustdoc โ the iconic little tool that generates documentation from Rust source code โจ periodt
๐ธ SYNOPSIS ๐ธ
rustdoc [OPTIONS] INPUT
๐ฆ DESCRIPTION ๐ฆ
okay so bestie, listen. This tool generates API reference documentation by pulling comments straight out of source code written in the Rust language โ Rust lives at https://www.rust-lang.org, iykyk ๐
It accepts several input formats and provides several output formats for the generated documentation. She's flexible like that ๐
โจ OPTIONS โจ
-r,--input-formatFORMAT โ the input format, and the only one listed here isrust๐ฆ-w,--output-formatFORMAT โ the output format, which here ishtml๐-o,--outputOUTPUT โ where to place the output (default:doc/for html) ๐--passesLIST โ a space-separated list of passes to run (default:'')--no-defaultsโ don't run the default passes, we're doing our own thing ๐ค--pluginsLIST โ space-separated list of plugins to run (default:'')--plugin-pathDIR โ directory to load plugins from (default:/tmp/rustdoc_ng/plugins)--targetTRIPLE โ target triple to document ๐ฏ--crate-nameNAME โ specify the name of this crate-L,--library-pathDIR โ directory to add to crate search path--cfgSPEC โ pass a--cfgtorustc--externVAL โ pass an--externtorustc--testโ run code examples as tests ๐งช--test-argsARGS โ pass arguments to the test runner--html-in-headerFILE โ file to add to<head>--html-before-contentFILES โ files to include inline between<body>and the content of a rendered Markdown file or generated documentation--markdown-before-contentFILES โ files to include inline between<body>and the content of a rendered Markdown file or generated documentation--html-after-contentFILES โ files to include inline between the content and</body>of a rendered Markdown file or generated documentation--markdown-after-contentFILES โ files to include inline between the content and</body>of a rendered Markdown file or generated documentation--markdown-cssFILES โ CSS files to include via<link>in a rendered Markdown file Markdown file or generated documentation ๐--markdown-playground-urlURL โ URL to send code snippets to ๐--markdown-no-tocโ don't include table of contents, no spoilers bestie-h,--extend-cssโ to redefine some css rules with a given file to generate doc with your own theme ๐-V,--versionโ Print rustdoc's version
๐ OUTPUT FORMATS ๐
The rustdoc tool can generate output in an HTML format. Just the one, and honestly? She ate. ๐ฅ
If using an HTML format, then the specified output destination will be the root directory of an HTML structure for all the documentation. Pages will be placed into this directory, and source files will also possibly be rendered into it as well.
๐ EXAMPLES ๐
To generate documentation for the source in the current directory:
$ rustdoc hello.rs
List all available passes that rustdoc has, along with default passes:
$ rustdoc --passes list
The generated HTML can be viewed with any standard web browser. literally any of them, no cap ๐
๐ SEE ALSO ๐
๐ BUGS ๐
See https://github.com/rust-lang/rust/issues for issues. (yes bestie, we know, pls report them ๐)
โญ AUTHOR โญ
See the version control history or https://thanks.rust-lang.org ๐ซถ
๐ COPYRIGHT ๐
This work is dual-licensed under Apache 2.0 and MIT terms. See COPYRIGHT file in the rust source distribution.
and that's the whole vibe: rustdoc 1.99.1 (58cf8f9c3 2026-... July 2018) โ go make some docs, bestie, you're gonna slay ๐ฆ๐โจ
๐ฆ where this page comes from
- centos-stream 10: rust 1.99.1-1.el10 ยท (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
- centos-stream 9: rust 1.99.1-1.el9 ยท (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
- fedora 43: rust 1.99.1-2.fc43 ยท (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
- fedora 44: rust 1.99.1-2.fc44 ยท (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms