2016-08-04 05:12:10 -05:00
|
|
|
.TH RUSTDOC "1" "August 2016" "rustdoc 1.12.0" "User Commands"
|
2013-07-06 23:06:54 -05:00
|
|
|
.SH NAME
|
|
|
|
rustdoc \- generate documentation from Rust source code
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B rustdoc
|
2013-09-30 15:28:30 -05:00
|
|
|
[\fIOPTIONS\fR] \fIINPUT\fR
|
2013-07-06 23:06:54 -05:00
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
This tool generates API reference documentation by extracting comments from
|
2013-09-30 15:28:30 -05:00
|
|
|
source code written in the Rust language, available at
|
2016-02-05 23:32:47 -06:00
|
|
|
<\fBhttps://www.rust-lang.org\fR>. It accepts several input formats and
|
|
|
|
provides several output formats for the generated documentation.
|
2013-07-06 23:06:54 -05:00
|
|
|
|
2013-09-30 15:28:30 -05:00
|
|
|
.SH OPTIONS
|
2013-07-06 23:06:54 -05:00
|
|
|
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-r\fR, \fB\-\-input\-format\fR \fIFORMAT\fR
|
2013-09-30 15:28:30 -05:00
|
|
|
html or json (default: inferred)
|
2013-07-06 23:06:54 -05:00
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-w\fR, \fB\-\-output\-format\fR \fIFORMAT\fR
|
2013-09-30 15:28:30 -05:00
|
|
|
html or json (default: html)
|
2013-07-06 23:06:54 -05:00
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-o\fR, \fB\-\-output\fR \fIOUTPUT\fR
|
|
|
|
where to place the output (default: \fIdoc/\fR for html,
|
|
|
|
\fIdoc.json\fR for json)
|
2013-07-06 23:06:54 -05:00
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-passes\fR \fILIST\fR
|
|
|
|
space\[hy]separated list of passes to run (default: '')
|
2013-09-30 15:28:30 -05:00
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-no\-defaults\fR
|
2013-09-30 15:28:30 -05:00
|
|
|
don't run the default passes
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-plugins\fR \fILIST\fR
|
2013-09-30 15:28:30 -05:00
|
|
|
space-separated list of plugins to run (default: '')
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-plugin\-path\fR \fIDIR\fR
|
|
|
|
directory to load plugins from (default: \fI/tmp/rustdoc_ng/plugins\fR)
|
2013-09-30 15:28:30 -05:00
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-target\fR \fITRIPLE\fR
|
2015-01-17 13:45:59 -06:00
|
|
|
target triple to document
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-crate\-name\fR \fINAME\fR
|
2015-01-17 13:45:59 -06:00
|
|
|
specify the name of this crate
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-L\fR, \fB\-\-library\-path\fR \fIDIR\fR
|
2013-09-30 15:28:30 -05:00
|
|
|
directory to add to crate search path
|
2013-07-06 23:06:54 -05:00
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-cfg\fR \fISPEC\fR
|
|
|
|
pass a \fI\-\-cfg\fR to rustc
|
2015-01-17 13:45:59 -06:00
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-extern\fR \fIVAL\fR
|
|
|
|
pass an \fI\-\-extern\fR to rustc
|
2015-01-17 13:45:59 -06:00
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-test\fR
|
2015-01-17 13:45:59 -06:00
|
|
|
run code examples as tests
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-test\-args\fR \fIARGS\fR
|
2015-01-17 13:45:59 -06:00
|
|
|
pass arguments to the test runner
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-html\-in\-header\fR \fIFILE\fR
|
2014-06-28 05:35:25 -05:00
|
|
|
file to add to <head>
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-html\-before\-content\fR \fIFILE\fR
|
2014-06-28 05:35:25 -05:00
|
|
|
file to add in <body>, before content
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-html\-after\-content\fR \fIFILE\fR
|
2014-06-28 05:35:25 -05:00
|
|
|
file to add in <body>, after content
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-markdown\-css\fR \fIFILE\fR
|
2015-01-17 13:45:59 -06:00
|
|
|
CSS files to include via <link> in a rendered Markdown file
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-markdown\-playground\-url\fR \fIURL\fR
|
2015-01-17 13:45:59 -06:00
|
|
|
URL to send code snippets to
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-\-markdown\-no\-toc\fR
|
2015-01-17 13:45:59 -06:00
|
|
|
don't include table of contents
|
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-h\fR, \fB\-\-help\fR
|
2013-07-06 23:06:54 -05:00
|
|
|
Print help
|
2015-01-17 13:45:59 -06:00
|
|
|
.TP
|
2015-02-26 03:10:17 -06:00
|
|
|
\fB\-V\fR, \fB\-\-version\fR
|
2015-01-17 13:45:59 -06:00
|
|
|
Print rustdoc's version
|
2013-07-06 23:06:54 -05:00
|
|
|
|
|
|
|
.SH "OUTPUT FORMATS"
|
|
|
|
|
2013-09-30 15:28:30 -05:00
|
|
|
The rustdoc tool can generate output in either an HTML or JSON format.
|
|
|
|
|
|
|
|
If using an HTML format, then the specified output destination will be the root
|
2015-02-26 03:10:17 -06:00
|
|
|
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.
|
2013-09-30 15:28:30 -05:00
|
|
|
|
|
|
|
If using a JSON format, then the specified output destination will have the
|
2015-02-26 03:10:17 -06:00
|
|
|
rustdoc output serialized as JSON into it.
|
|
|
|
This output format exists to pre\[hy]compile documentation for crates,
|
|
|
|
and for usage in non\[hy]rustdoc tools.
|
|
|
|
The JSON output is the following hash:
|
2013-09-30 15:28:30 -05:00
|
|
|
|
|
|
|
{
|
|
|
|
"schema": VERSION,
|
|
|
|
"crate": ...,
|
|
|
|
"plugins": ...,
|
|
|
|
}
|
|
|
|
|
2015-02-26 03:10:17 -06:00
|
|
|
The schema version indicates what the structure of crate/plugins will
|
|
|
|
look like.
|
|
|
|
Within a schema version the structure will remain the same.
|
|
|
|
The \fIcrate\fR field will contain all relevant documentation for the
|
|
|
|
source being documented, and the \fIplugins\fR field will contain the
|
|
|
|
output of the plugins run over the crate.
|
2013-07-06 23:06:54 -05:00
|
|
|
|
|
|
|
.SH "EXAMPLES"
|
|
|
|
|
|
|
|
To generate documentation for the source in the current directory:
|
|
|
|
$ rustdoc hello.rs
|
|
|
|
|
2013-09-30 15:28:30 -05:00
|
|
|
List all available passes that rustdoc has, along with default passes:
|
2015-02-26 03:10:17 -06:00
|
|
|
$ rustdoc \-\-passes list
|
2013-09-30 15:28:30 -05:00
|
|
|
|
|
|
|
To precompile the documentation for a crate, and then use it to render html at
|
|
|
|
a later date:
|
2015-02-26 03:10:17 -06:00
|
|
|
$ rustdoc \-w json hello.rs
|
2013-09-30 15:28:30 -05:00
|
|
|
$ rustdoc doc.json
|
2013-07-06 23:06:54 -05:00
|
|
|
|
2013-09-30 15:28:30 -05:00
|
|
|
The generated HTML can be viewed with any standard web browser.
|
2013-07-06 23:06:54 -05:00
|
|
|
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
|
2015-02-26 03:10:17 -06:00
|
|
|
.BR rustc (1)
|
2013-07-06 23:06:54 -05:00
|
|
|
|
|
|
|
.SH "BUGS"
|
2016-02-05 23:32:47 -06:00
|
|
|
See <\fBhttps://github.com/rust\-lang/rust/issues\fR>
|
2015-02-26 03:10:17 -06:00
|
|
|
for issues.
|
2013-07-06 23:06:54 -05:00
|
|
|
|
|
|
|
.SH "AUTHOR"
|
2015-02-26 03:10:17 -06:00
|
|
|
See \fIAUTHORS.txt\fR in the Rust source distribution.
|
2013-07-06 23:06:54 -05:00
|
|
|
|
|
|
|
.SH "COPYRIGHT"
|
2015-02-26 03:10:17 -06:00
|
|
|
This work is dual\[hy]licensed under Apache\ 2.0 and MIT terms.
|
|
|
|
See \fICOPYRIGHT\fR file in the rust source distribution.
|