Jeff Vander Stoep | 956d143 | 2020-09-18 13:46:24 +0200 | [diff] [blame] | 1 | .TH RUSTDOC "1" "September 2020" "rustdoc 1.46.0" "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 |
| 12 | provides several output formats for the generated documentation. |
| 13 | |
| 14 | .SH OPTIONS |
| 15 | |
| 16 | .TP |
| 17 | \fB\-r\fR, \fB\-\-input\-format\fR \fIFORMAT\fR |
| 18 | rust |
| 19 | .TP |
| 20 | \fB\-w\fR, \fB\-\-output\-format\fR \fIFORMAT\fR |
| 21 | html |
| 22 | .TP |
| 23 | \fB\-o\fR, \fB\-\-output\fR \fIOUTPUT\fR, |
| 24 | where to place the output (default: \fIdoc/\fR for html) |
| 25 | .TP |
| 26 | \fB\-\-passes\fR \fILIST\fR |
| 27 | space\[hy]separated list of passes to run (default: '') |
| 28 | .TP |
| 29 | \fB\-\-no\-defaults\fR |
| 30 | don't run the default passes |
| 31 | .TP |
| 32 | \fB\-\-plugins\fR \fILIST\fR |
| 33 | space-separated list of plugins to run (default: '') |
| 34 | .TP |
| 35 | \fB\-\-plugin\-path\fR \fIDIR\fR |
| 36 | directory to load plugins from (default: \fI/tmp/rustdoc_ng/plugins\fR) |
| 37 | .TP |
| 38 | \fB\-\-target\fR \fITRIPLE\fR |
| 39 | target triple to document |
| 40 | .TP |
| 41 | \fB\-\-crate\-name\fR \fINAME\fR |
| 42 | specify the name of this crate |
| 43 | .TP |
| 44 | \fB\-L\fR, \fB\-\-library\-path\fR \fIDIR\fR |
| 45 | directory to add to crate search path |
| 46 | .TP |
| 47 | \fB\-\-cfg\fR \fISPEC\fR |
| 48 | pass a \fI\-\-cfg\fR to rustc |
| 49 | .TP |
| 50 | \fB\-\-extern\fR \fIVAL\fR |
| 51 | pass an \fI\-\-extern\fR to rustc |
| 52 | .TP |
| 53 | \fB\-\-test\fR |
| 54 | run code examples as tests |
| 55 | .TP |
| 56 | \fB\-\-test\-args\fR \fIARGS\fR |
| 57 | pass arguments to the test runner |
| 58 | .TP |
| 59 | \fB\-\-html\-in\-header\fR \fIFILE\fR |
| 60 | file to add to <head> |
| 61 | .TP |
| 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 |
| 65 | .TP |
| 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 |
| 69 | .TP |
| 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 |
| 73 | .TP |
| 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 |
| 77 | .TP |
| 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 |
| 81 | .TP |
| 82 | \fB\-\-markdown\-playground\-url\fR \fIURL\fR |
| 83 | URL to send code snippets to |
| 84 | .TP |
| 85 | \fB\-\-markdown\-no\-toc\fR |
| 86 | don't include table of contents |
| 87 | .TP |
| 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 |
| 90 | .TP |
| 91 | \fB\-V\fR, \fB\-\-version\fR |
| 92 | Print rustdoc's version |
| 93 | |
| 94 | .SH "OUTPUT FORMATS" |
| 95 | |
| 96 | The rustdoc tool can generate output in an HTML format. |
| 97 | |
| 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. |
| 102 | |
| 103 | .SH "EXAMPLES" |
| 104 | |
| 105 | To generate documentation for the source in the current directory: |
| 106 | $ rustdoc hello.rs |
| 107 | |
| 108 | List all available passes that rustdoc has, along with default passes: |
| 109 | $ rustdoc \-\-passes list |
| 110 | |
| 111 | The generated HTML can be viewed with any standard web browser. |
| 112 | |
| 113 | .SH "SEE ALSO" |
| 114 | |
| 115 | .BR rustc (1) |
| 116 | |
| 117 | .SH "BUGS" |
| 118 | See <\fBhttps://github.com/rust\-lang/rust/issues\fR> |
| 119 | for issues. |
| 120 | |
| 121 | .SH "AUTHOR" |
| 122 | See the version control history or <\fBhttps://thanks.rust\-lang.org\fR> |
| 123 | |
| 124 | .SH "COPYRIGHT" |
| 125 | This work is dual\[hy]licensed under Apache\ 2.0 and MIT terms. |
| 126 | See \fICOPYRIGHT\fR file in the rust source distribution. |