]> git.lizzy.rs Git - rust.git/blob - man/rustdoc.1
auto merge of #11265 : c-a/rust/byteswap_from, r=alexcrichton
[rust.git] / man / rustdoc.1
1 .TH RUSTDOC "1" "July 2013" "rustdoc 0.7" "User Commands"
2 .SH NAME
3 rustdoc \- generate documentation from Rust source code
4 .SH SYNOPSIS
5 .B rustdoc
6 [\fIOPTIONS\fR] \fIINPUT\fR
7
8 .SH DESCRIPTION
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 provides
12 several output formats for the generated documentation.
13
14 .SH OPTIONS
15
16 .TP
17 -r --input-format <val>
18 html or json (default: inferred)
19 .TP
20 -w --output-format <val>
21 html or json (default: html)
22 .TP
23 -o --output <val>
24 where to place the output (default: doc/ for html, doc.json for json)
25 .TP
26 --passes <val>
27 space-separated list of passes to run (default: '')
28 .TP
29 --no-defaults
30 don't run the default passes
31 .TP
32 --plugins <val>
33 space-separated list of plugins to run (default: '')
34 .TP
35 --plugin-path <val>
36 directory to load plugins from (default: /tmp/rustdoc_ng/plugins)
37 .TP
38 -L --library-path <val>
39 directory to add to crate search path
40 .TP
41 -h, --help
42 Print help
43
44 .SH "OUTPUT FORMATS"
45
46 The rustdoc tool can generate output in either an HTML or JSON format.
47
48 If using an HTML format, then the specified output destination will be the root
49 directory of an HTML structure for all the documentation. Pages will be placed
50 into this directory, and source files will also possibly be rendered into it as
51 well.
52
53 If using a JSON format, then the specified output destination will have the
54 rustdoc output serialized as JSON into it. This output format exists to
55 pre-compile documentation for crates, and for usage in non-rustdoc tools. The
56 JSON output is the following hash:
57
58     {
59         "schema": VERSION,
60         "crate": ...,
61         "plugins": ...,
62     }
63
64 The schema version indicates what the structure of crate/plugins will look
65 like. Within a schema version the structure will remain the same. The `crate`
66 field will contain all relevant documentation for the source being documented,
67 and the `plugins` field will contain the output of the plugins run over the
68 crate.
69
70 .SH "EXAMPLES"
71
72 To generate documentation for the source in the current directory:
73     $ rustdoc hello.rs
74
75 List all available passes that rustdoc has, along with default passes:
76     $ rustdoc --passes list
77
78 To precompile the documentation for a crate, and then use it to render html at
79 a later date:
80     $ rustdoc -w json hello.rs
81     $ rustdoc doc.json
82
83 The generated HTML can be viewed with any standard web browser.
84
85 .SH "SEE ALSO"
86
87 rustc, rustpkg
88
89 .SH "BUGS"
90 See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
91
92 .SH "AUTHOR"
93 See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
94 <\fIgraydon@mozilla.com\fR> is the project leader.
95
96 .SH "COPYRIGHT"
97 This work is dual-licensed under Apache 2.0 and MIT terms.  See \fBCOPYRIGHT\fR
98 file in the rust source distribution.