1 .TH RUSTDOC "1" "July 2018" "rustdoc <INSERT VERSION HERE>" "User Commands"
3 rustdoc \- generate documentation from Rust source code
6 [\fIOPTIONS\fR] \fIINPUT\fR
9 This tool generates API reference documentation by extracting comments from
10 source code written in the Rust language, available at
11 <\fBhttps://www.rust-lang.org\fR>. It accepts several input formats and
12 provides several output formats for the generated documentation.
17 \fB\-r\fR, \fB\-\-input\-format\fR \fIFORMAT\fR
20 \fB\-w\fR, \fB\-\-output\-format\fR \fIFORMAT\fR
23 \fB\-o\fR, \fB\-\-output\fR \fIOUTPUT\fR,
24 where to place the output (default: \fIdoc/\fR for html)
26 \fB\-\-passes\fR \fILIST\fR
27 space\[hy]separated list of passes to run (default: '')
29 \fB\-\-no\-defaults\fR
30 don't run the default passes
32 \fB\-\-plugins\fR \fILIST\fR
33 space-separated list of plugins to run (default: '')
35 \fB\-\-plugin\-path\fR \fIDIR\fR
36 directory to load plugins from (default: \fI/tmp/rustdoc_ng/plugins\fR)
38 \fB\-\-target\fR \fITRIPLE\fR
39 target triple to document
41 \fB\-\-crate\-name\fR \fINAME\fR
42 specify the name of this crate
44 \fB\-L\fR, \fB\-\-library\-path\fR \fIDIR\fR
45 directory to add to crate search path
47 \fB\-\-cfg\fR \fISPEC\fR
48 pass a \fI\-\-cfg\fR to rustc
50 \fB\-\-extern\fR \fIVAL\fR
51 pass an \fI\-\-extern\fR to rustc
54 run code examples as tests
56 \fB\-\-test\-args\fR \fIARGS\fR
57 pass arguments to the test runner
59 \fB\-\-html\-in\-header\fR \fIFILE\fR
62 \fB\-\-html\-before\-content\fR \fIFILES\fR
63 files to include inline between <body> and the content of a rendered Markdown
64 file or generated documentation
66 \fB\-\-markdown\-before\-content\fR \fIFILES\fR
67 files to include inline between <body> and the content of a rendered
68 Markdown file or generated documentation
70 \fB\-\-html\-after\-content\fR \fIFILES\fR
71 files to include inline between the content and </body> of a rendered
72 Markdown file or generated documentation
74 \fB\-\-markdown\-after\-content\fR \fIFILES\fR
75 files to include inline between the content and </body> of a rendered
76 Markdown file or generated documentation
78 \fB\-\-markdown\-css\fR \fIFILES\fR
79 CSS files to include via <link> in a rendered Markdown file Markdown file or
80 generated documentation
82 \fB\-\-markdown\-playground\-url\fR \fIURL\fR
83 URL to send code snippets to
85 \fB\-\-markdown\-no\-toc\fR
86 don't include table of contents
88 \fB\-h\fR, \fB\-\-extend\-css\fR
89 to redefine some css rules with a given file to generate doc with your own theme
91 \fB\-V\fR, \fB\-\-version\fR
92 Print rustdoc's version
96 The rustdoc tool can generate output in an HTML format.
98 If using an HTML format, then the specified output destination will be the root
99 directory of an HTML structure for all the documentation.
100 Pages will be placed into this directory, and source files will also
101 possibly be rendered into it as well.
105 To generate documentation for the source in the current directory:
108 List all available passes that rustdoc has, along with default passes:
109 $ rustdoc \-\-passes list
111 The generated HTML can be viewed with any standard web browser.
118 See <\fBhttps://github.com/rust\-lang/rust/issues\fR>
122 See the version control history or <\fBhttps://thanks.rust\-lang.org\fR>
125 This work is dual\[hy]licensed under Apache\ 2.0 and MIT terms.
126 See \fICOPYRIGHT\fR file in the rust source distribution.