RUSTDOC(1)
π rustdoc (1) β User Commands π
okay bestie, welcome to the rustdoc page π this is the tool that takes your Rust source code and turns your comments into β¨glorious API reference documentationβ¨
β¨ NAME β¨
rustdoc β generate documentation from Rust source code π¦
β¨ SYNOPSIS β¨
rustdoc [OPTIONS] INPUT
β¨ DESCRIPTION β¨
so the way that this works π rustdoc generates API reference documentation by extracting comments from source code written in the Rust language, which lives at <https://www.rust-lang.org> in case you need it. it accepts several input formats and provides several output formats for the generated documentation. it's giving "your comments but make them a website" and we're obsessed πβ¨
β¨ OPTIONS β¨
-r,--input-format FORMATβ the input format, and bestie the value isrustπ¦-w,--output-format FORMATβ the output format, and the value here ishtmlπΈ-o,--output OUTPUT,β where to place the output (default:doc/for html). also yes there is a little stray comma in there, we love her, she stays π--passes LISTβ space-separated list of passes to run (default:'') π₯--no-defaultsβ don't run the default passes π--plugins LISTβ space-separated list of plugins to run (default:'') π§--plugin-path DIRβ directory to load plugins from (default:/tmp/rustdoc_ng/plugins) π--target TRIPLEβ target triple to document π--crate-name NAMEβ specify the name of this crate π-L,--library-path DIRβ directory to add to crate search path π--cfg SPECβ pass a--cfgtorustcπ--extern VALβ pass an--externtorustcπ--testβ run code examples as tests π§ͺ lowkey iconic of her--test-args ARGSβ pass arguments to the test runner πββοΈ--html-in-header FILEβ file to add to<head>π--html-before-content FILESβ files to include inline between<body>and the content of a rendered Markdown file or generated documentation π--markdown-before-content FILESβ files to include inline between<body>and the content of a rendered Markdown file or generated documentation π--html-after-content FILESβ files to include inline between the content and</body>of a rendered Markdown file or generated documentation π--markdown-after-content FILESβ files to include inline between the content and</body>of a rendered Markdown file or generated documentation π--markdown-css FILESβ CSS files to include via<link>in a rendered Markdown file Markdown file or generated documentation π¨ (yeah she said "Markdown file" twice, no cap, we're keeping it exactly as she is π )--markdown-playground-url URLβ URL to send code snippets to ποΈ--markdown-no-tocβ don't include table of contents π«π-h,--extend-cssβ to redefine some css rules with a given file to generate doc with your own theme π¨ (yes,-his the short flag for this one here, not help β stay woke bestie π)-V,--versionβ Print rustdoc's version π’
β¨ OUTPUT FORMATS β¨
the rustdoc tool can generate output in an HTML format π¦
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. so like, everything's going in there, it's the whole vibe π β¨
β¨ 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 π main character browsing experience fr fr
β¨ SEE ALSO β¨
rustc(1) β go say hi to her sibling π
β¨ BUGS β¨
found a bug? see <https://github.com/rust-lang/rust/issues> for issues π no pressure but like, tell them
β¨ AUTHOR β¨
see the version control history or <https://thanks.rust-lang.org> π«Ά shoutout to everyone in the git log
β¨ COPYRIGHT β¨
this work is dual-licensed under Apache 2.0 and MIT terms π see COPYRIGHT file in the rust source distribution.
okay that's the whole page bestie, you ate that π β¨
signing off with the vibe check: this was rustdoc 1.97.1 (8bab26f4f 2026-... from July 2018 πΈ (yes the date is a whole situation, don't @ her), and we're out here being RUSTDOC(1) β periodt ππ
π¦ where this page comes from
- ubuntu stonking: rustc-1.97 1.97.1+dfsg-0ubuntu1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms