Skip to content

Commit 38f48d1

Browse files
committed
---
yaml --- r: 81307 b: refs/heads/snap-stage3 c: 0dce112 h: refs/heads/master i: 81305: c75dfd6 81303: 1c76e05 v: v3
1 parent b595af4 commit 38f48d1

File tree

6 files changed

+295
-114
lines changed

6 files changed

+295
-114
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: ec2b9cc22826fcc109e9a01b0c9d6e64983bea0d
4+
refs/heads/snap-stage3: 0dce112af7af25f55d23223e566bf77147feedae
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/man/rustdoc.1

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,84 @@
33
rustdoc \- generate documentation from Rust source code
44
.SH SYNOPSIS
55
.B rustdoc
6-
[\fIOPTIONS\fR] \fICRATEFILE\fR
6+
[\fIOPTIONS\fR] \fIINPUT\fR
77

88
.SH DESCRIPTION
99
This tool generates API reference documentation by extracting comments from
10-
source code written in the Rust language, available at <\fBhttps://www.rust-
11-
lang.org\fR>. It provides several output formats for the generated
12-
documentation.
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.
1313

14-
.SH COMMANDS
14+
.SH OPTIONS
1515

1616
.TP
17-
--output-dir <val>
18-
Put documents here (default: .)
17+
-r --input-format <val>
18+
html or json (default: inferred)
1919
.TP
20-
--output-format <val>
21-
markdown or html (default: html)
20+
-w --output-format <val>
21+
html or json (default: html)
2222
.TP
23-
--output-style <val>
24-
doc-per-crate or doc-per-mod (default: doc-per-mod)
23+
-o --output <val>
24+
where to place the output (default: doc/ for html, doc.json for json)
2525
.TP
26-
--pandoc-cmd <val>
27-
Command for running pandoc
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
2840
.TP
2941
-h, --help
3042
Print help
3143

3244
.SH "OUTPUT FORMATS"
3345

34-
The rustdoc tool can generate documentation in either the Markdown
35-
or HTML formats. It requires the pandoc tool
36-
<\fBhttp://johnmacfarlane.net/pandoc/\fR> for conversion features.
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.
3769

3870
.SH "EXAMPLES"
3971

4072
To generate documentation for the source in the current directory:
4173
$ rustdoc hello.rs
4274

43-
To build documentation into a subdirectory named 'doc' in the Markdown
44-
format:
45-
$ rustdoc --output-dir doc --output-format markdown hello.rs
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
4682

47-
The generated HTML can be viewed with any standard web browser, while
48-
the Markdown version is well-suited for conversion into other formats.
83+
The generated HTML can be viewed with any standard web browser.
4984

5085
.SH "SEE ALSO"
5186

branches/snap-stage3/mk/docs.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ RUSTDOC = $(HBIN2_H_$(CFG_BUILD_TRIPLE))/rustdoc$(X_$(CFG_BUILD_TRIPLE))
227227
define libdoc
228228
doc/$(1)/index.html: $$(RUSTDOC) $$(TLIB2_T_$(3)_H_$(3))/$(CFG_STDLIB_$(3))
229229
@$$(call E, rustdoc: $$@)
230-
$(Q)$(RUSTDOC) html $(2)
230+
$(Q)$(RUSTDOC) $(2)
231231

232232
DOCS += doc/$(1)/index.html
233233
endef

0 commit comments

Comments
 (0)