1 rustdoc [options] <input>
4 -h, --help show this help message
5 -V, --version print rustdoc's version
6 -v, --verbose use verbose output
7 -w, --output-format [html]
8 the output type to write
9 --output PATH Which directory to place the output. This option is
10 deprecated, use --out-dir instead.
11 -o, --out-dir PATH which directory to place the output
13 specify the name of this crate
14 --crate-type [bin|lib|rlib|dylib|cdylib|staticlib|proc-macro]
15 Comma separated list of types of crates
16 for the compiler to emit
17 -L, --library-path DIR
18 directory to add to crate search path
19 --cfg pass a --cfg to rustc
20 --check-cfg pass a --check-cfg to rustc
22 pass an --extern to rustc
23 --extern-html-root-url NAME=URL
24 base URL to use for dependencies; for example,
25 "std=/doc" links std::vec::Vec to
26 /doc/std/vec/struct.Vec.html
27 --extern-html-root-takes-precedence
28 give precedence to `--extern-html-root-url`, not
30 -C, --codegen OPT[=VALUE]
31 pass a codegen option to rustc
32 --document-private-items
33 document private items
34 --document-hidden-items
35 document items that have doc(hidden)
36 --test run code examples as tests
38 arguments to pass to the test runner
39 --test-run-directory PATH
40 The working directory in which to run tests
41 --target TRIPLE target triple to document
43 CSS files to include via <link> in a rendered Markdown
45 --html-in-header FILES
46 files to include inline in the <head> section of a
47 rendered Markdown file or generated documentation
48 --html-before-content FILES
49 files to include inline between <body> and the content
50 of a rendered Markdown file or generated documentation
51 --html-after-content FILES
52 files to include inline between the content and
53 </body> of a rendered Markdown file or generated
55 --markdown-before-content FILES
56 files to include inline between <body> and the content
57 of a rendered Markdown file or generated documentation
58 --markdown-after-content FILES
59 files to include inline between the content and
60 </body> of a rendered Markdown file or generated
62 --markdown-playground-url URL
63 URL to send code snippets to
65 don't include table of contents
67 To add some CSS rules with a given file to generate
68 doc with your own theme. However, your theme might
69 break if the rustdoc's generated HTML changes, so be
71 -Z FLAG unstable / perma-unstable options (only on nightly
73 --sysroot PATH Override the system root
75 URL to send code snippets to, may be reset by
76 --markdown-playground-url or
77 `#![doc(html_playground_url=...)]`
78 --display-doctest-warnings
79 show warnings that originate in doctests
80 --crate-version VERSION
81 crate version to print into documentation
82 --sort-modules-by-appearance
83 sort modules by where they appear in the program,
84 rather than alphabetically
86 Set the default theme. THEME should be the theme name,
87 generally lowercase. If an unknown default theme is
88 specified, the builtin default is used. The set of
89 themes, and the rustdoc built-in default, are not
91 --default-setting SETTING[=VALUE]
92 Default value for a rustdoc setting (used when
93 "rustdoc-SETTING" is absent from web browser Local
94 Storage). If VALUE is not supplied, "true" is used.
95 Supported SETTINGs and VALUEs are not documented and
97 --theme FILES additional themes which will be added to the generated
100 check if given theme is valid
101 --resource-suffix PATH
102 suffix to add to CSS and JavaScript files, e.g.,
103 "light.css" will become "light-suffix.css"
105 edition to use when compiling rust code (default:
107 --color auto|always|never
108 Configure coloring of output:
109 auto = colorize, if output goes to a tty (default);
110 always = always colorize output;
111 never = never colorize output
112 --error-format human|json|short
113 How errors and other messages are produced
114 --diagnostic-width WIDTH
115 Provide width of the output for truncated error
117 --json CONFIG Configure the structure of JSON diagnostics
118 --disable-minification
119 Disable minification applied on JS files
120 -A, --allow LINT Set lint allowed
121 -W, --warn LINT Set lint warnings
124 -D, --deny LINT Set lint denied
125 -F, --forbid LINT Set lint forbidden
127 Set the most restrictive lint level. More restrictive
128 lints are capped at this level. By default, it is at
131 Markdown file to be used as index page
133 To enable generation of the index page
134 --static-root-path PATH
135 Path string to force loading static files from in
136 output pages. If not set, uses combinations of '../'
137 to reach the documentation root.
138 --disable-per-crate-search
139 disables generating the crate selector on the search
141 --persist-doctests PATH
142 Directory to persist doctest executables into
144 calculate percentage of public items with
146 --enable-per-target-ignores
147 parse ignore-foo for ignoring doctests on a per-target
149 --runtool The tool to run tests with when building for a different target than host
151 --runtool-arg One (of possibly many) arguments to pass to the runtool
154 The rustc-like binary to use as the test builder
155 --check Run rustdoc checks
156 --generate-redirect-map
157 Generate JSON file at the top level instead of
158 generating HTML redirection files
159 --emit [unversioned-shared-resources,toolchain-shared-resources,invocation-specific]
160 Comma separated list of types of output for rustdoc to
162 --no-run Compile doctests without running them
164 Include the memory layout of types in the docs
165 --nocapture Don't capture stdout and stderr of tests
166 --generate-link-to-definition
167 Make the identifiers in the HTML source code pages
169 --scrape-examples-output-path collect function call information and output at the given path
171 --scrape-examples-target-crate collect function call information for functions from the target crate
173 --scrape-tests Include test code when scraping examples
174 --with-examples path to function call information (for displaying examples in the documentation)
177 removed, see issue #44136
178 <https://github.com/rust-lang/rust/issues/44136> for
180 --passes PASSES removed, see issue #44136
181 <https://github.com/rust-lang/rust/issues/44136> for
184 removed, see issue #44136
185 <https://github.com/rust-lang/rust/issues/44136> for
187 --no-defaults removed, see issue #44136
188 <https://github.com/rust-lang/rust/issues/44136> for
190 -r, --input-format [rust]
191 removed, see issue #44136
192 <https://github.com/rust-lang/rust/issues/44136> for
195 @path Read newline separated options from `path`
197 More information available at https://doc.rust-lang.org/$CHANNEL/rustdoc/what-is-rustdoc.html