1 .TH RUSTDOC "1" "September 2016" "rustdoc 1.13.0" "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
18 html or json (default: inferred)
20 \fB\-w\fR, \fB\-\-output\-format\fR \fIFORMAT\fR
21 html or json (default: html)
23 \fB\-o\fR, \fB\-\-output\fR \fIOUTPUT\fR
24 where to place the output (default: \fIdoc/\fR for html,
25 \fIdoc.json\fR for json)
27 \fB\-\-passes\fR \fILIST\fR
28 space\[hy]separated list of passes to run (default: '')
30 \fB\-\-no\-defaults\fR
31 don't run the default passes
33 \fB\-\-plugins\fR \fILIST\fR
34 space-separated list of plugins to run (default: '')
36 \fB\-\-plugin\-path\fR \fIDIR\fR
37 directory to load plugins from (default: \fI/tmp/rustdoc_ng/plugins\fR)
39 \fB\-\-target\fR \fITRIPLE\fR
40 target triple to document
42 \fB\-\-crate\-name\fR \fINAME\fR
43 specify the name of this crate
45 \fB\-L\fR, \fB\-\-library\-path\fR \fIDIR\fR
46 directory to add to crate search path
48 \fB\-\-cfg\fR \fISPEC\fR
49 pass a \fI\-\-cfg\fR to rustc
51 \fB\-\-extern\fR \fIVAL\fR
52 pass an \fI\-\-extern\fR to rustc
55 run code examples as tests
57 \fB\-\-test\-args\fR \fIARGS\fR
58 pass arguments to the test runner
60 \fB\-\-html\-in\-header\fR \fIFILE\fR
63 \fB\-\-html\-before\-content\fR \fIFILE\fR
64 file to add in <body>, before content
66 \fB\-\-html\-after\-content\fR \fIFILE\fR
67 file to add in <body>, after content
69 \fB\-\-markdown\-css\fR \fIFILE\fR
70 CSS files to include via <link> in a rendered Markdown file
72 \fB\-\-markdown\-playground\-url\fR \fIURL\fR
73 URL to send code snippets to
75 \fB\-\-markdown\-no\-toc\fR
76 don't include table of contents
78 \fB\-h\fR, \fB\-\-help\fR
81 \fB\-V\fR, \fB\-\-version\fR
82 Print rustdoc's version
86 The rustdoc tool can generate output in either an HTML or JSON format.
88 If using an HTML format, then the specified output destination will be the root
89 directory of an HTML structure for all the documentation.
90 Pages will be placed into this directory, and source files will also
91 possibly be rendered into it as well.
93 If using a JSON format, then the specified output destination will have the
94 rustdoc output serialized as JSON into it.
95 This output format exists to pre\[hy]compile documentation for crates,
96 and for usage in non\[hy]rustdoc tools.
97 The JSON output is the following hash:
105 The schema version indicates what the structure of crate/plugins will
107 Within a schema version the structure will remain the same.
108 The \fIcrate\fR field will contain all relevant documentation for the
109 source being documented, and the \fIplugins\fR field will contain the
110 output of the plugins run over the crate.
114 To generate documentation for the source in the current directory:
117 List all available passes that rustdoc has, along with default passes:
118 $ rustdoc \-\-passes list
120 To precompile the documentation for a crate, and then use it to render html at
122 $ rustdoc \-w json hello.rs
125 The generated HTML can be viewed with any standard web browser.
132 See <\fBhttps://github.com/rust\-lang/rust/issues\fR>
136 See \fIAUTHORS.txt\fR in the Rust source distribution.
139 This work is dual\[hy]licensed under Apache\ 2.0 and MIT terms.
140 See \fICOPYRIGHT\fR file in the rust source distribution.