Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
863555f4
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
863555f4
编写于
9月 30, 2013
作者:
A
Alex Crichton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustdoc: Update the man page
Closes #9622
上级
e523f99f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
60 addition
and
24 deletion
+60
-24
man/rustdoc.1
man/rustdoc.1
+56
-21
src/librustdoc/rustdoc.rs
src/librustdoc/rustdoc.rs
+4
-3
未找到文件。
man/rustdoc.1
浏览文件 @
863555f4
...
...
@@ -3,49 +3,84 @@
rustdoc \- generate documentation from Rust source code
.SH SYNOPSIS
.B rustdoc
[\fIOPTIONS\fR] \fI
CRATEFILE
\fR
[\fIOPTIONS\fR] \fI
INPUT
\fR
.SH DESCRIPTION
This tool generates API reference documentation by extracting comments from
source code written in the Rust language, available at
<\fBhttps://www.rust-
lang.org\fR>. It provides several output formats for the generated
documentation.
source code written in the Rust language, available at
<\fBhttps://www.rust-lang.org\fR>. It accepts several input formats and provides
several output formats for the generated
documentation.
.SH
COMMAND
S
.SH
OPTION
S
.TP
-
-output-dir
<val>
Put documents here (default: .
)
-
r --input-format
<val>
html or json (default: inferred
)
.TP
--output-format <val>
markdown or html
(default: html)
-
w -
-output-format <val>
html or json
(default: html)
.TP
-
-output-style
<val>
doc-per-crate or doc-per-mod (default: doc-per-mod
)
-
o --output
<val>
where to place the output (default: doc/ for html, doc.json for json
)
.TP
--pandoc-cmd <val>
Command for running pandoc
--passes <val>
space-separated list of passes to run (default: '')
.TP
--no-defaults
don't run the default passes
.TP
--plugins <val>
space-separated list of plugins to run (default: '')
.TP
--plugin-path <val>
directory to load plugins from (default: /tmp/rustdoc_ng/plugins)
.TP
-L --library-path <val>
directory to add to crate search path
.TP
-h, --help
Print help
.SH "OUTPUT FORMATS"
The rustdoc tool can generate documentation in either the Markdown
or HTML formats. It requires the pandoc tool
<\fBhttp://johnmacfarlane.net/pandoc/\fR> for conversion features.
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
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.
If using a JSON format, then the specified output destination will have the
rustdoc output serialized as JSON into it. This output format exists to
pre-compile documentation for crates, and for usage in non-rustdoc tools. The
JSON output is the following hash:
{
"schema": VERSION,
"crate": ...,
"plugins": ...,
}
The schema version indicates what the structure of crate/plugins will look
like. Within a schema version the structure will remain the same. The `crate`
field will contain all relevant documentation for the source being documented,
and the `plugins` field will contain the output of the plugins run over the
crate.
.SH "EXAMPLES"
To generate documentation for the source in the current directory:
$ rustdoc hello.rs
To build documentation into a subdirectory named 'doc' in the Markdown
format:
$ rustdoc --output-dir doc --output-format markdown hello.rs
List all available passes that rustdoc has, along with default passes:
$ rustdoc --passes list
To precompile the documentation for a crate, and then use it to render html at
a later date:
$ rustdoc -w json hello.rs
$ rustdoc doc.json
The generated HTML can be viewed with any standard web browser, while
the Markdown version is well-suited for conversion into other formats.
The generated HTML can be viewed with any standard web browser.
.SH "SEE ALSO"
...
...
src/librustdoc/rustdoc.rs
浏览文件 @
863555f4
...
...
@@ -95,7 +95,7 @@ pub fn opts() -> ~[groups::OptGroup] {
"PASSES"
),
optmulti
(
""
,
"plugins"
,
"space separated list of plugins to also load"
,
"PLUGINS"
),
optflag
(
""
,
"nodefaults"
,
"don't run the default passes"
),
optflag
(
""
,
"no
-
defaults"
,
"don't run the default passes"
),
]
}
...
...
@@ -181,7 +181,7 @@ fn acquire_input(matches: &getopts::Matches) -> Result<Output, ~str> {
///
/// This form of input will run all of the plug/cleaning passes
fn
rust_input
(
cratefile
:
&
str
,
matches
:
&
getopts
::
Matches
)
->
Output
{
let
mut
default_passes
=
!
matches
.opt_present
(
"nodefaults"
);
let
mut
default_passes
=
!
matches
.opt_present
(
"no
-
defaults"
);
let
mut
passes
=
matches
.opt_strs
(
"passes"
);
let
mut
plugins
=
matches
.opt_strs
(
"plugins"
);
...
...
@@ -227,7 +227,8 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
}
// Load all plugins/passes into a PluginManager
let
mut
pm
=
plugins
::
PluginManager
::
new
(
Path
(
"/tmp/rustdoc_ng/plugins"
));
let
path
=
matches
.opt_str
(
"plugin-path"
)
.unwrap_or
(
~
"/tmp/rustdoc_ng/plugins"
);
let
mut
pm
=
plugins
::
PluginManager
::
new
(
Path
(
path
));
for
pass
in
passes
.iter
()
{
let
plugin
=
match
PASSES
.iter
()
.position
(|
&
(
p
,
_
,
_
)|
p
==
*
pass
)
{
Some
(
i
)
=>
PASSES
[
i
]
.n1
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录