Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
440c0f07
R
Rust
项目概览
int
/
Rust
接近 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
440c0f07
编写于
8月 16, 2015
作者:
M
Martin Wernstål
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rustdoc: Added issue tracker option and issue data to clean::Stability
上级
e822a18a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
3 deletion
+18
-3
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+4
-1
src/librustdoc/html/render.rs
src/librustdoc/html/render.rs
+10
-1
src/librustdoc/lib.rs
src/librustdoc/lib.rs
+4
-1
未找到文件。
src/librustdoc/clean/mod.rs
浏览文件 @
440c0f07
...
...
@@ -2688,7 +2688,8 @@ pub struct Stability {
pub
feature
:
String
,
pub
since
:
String
,
pub
deprecated_since
:
String
,
pub
reason
:
String
pub
reason
:
String
,
pub
issue
:
Option
<
u32
>
}
impl
Clean
<
Stability
>
for
attr
::
Stability
{
...
...
@@ -2702,6 +2703,7 @@ fn clean(&self, _: &DocContext) -> Stability {
|
istr
|
istr
.to_string
()),
reason
:
self
.reason
.as_ref
()
.map_or
(
""
.to_string
(),
|
interned
|
interned
.to_string
()),
issue
:
self
.issue
,
}
}
}
...
...
@@ -2717,6 +2719,7 @@ fn clean(&self, _: &DocContext) -> Stability {
|
istr
|
istr
.to_string
()),
reason
:
self
.reason
.as_ref
()
.map_or
(
""
.to_string
(),
|
interned
|
interned
.to_string
()),
issue
:
self
.issue
,
}
}
}
...
...
src/librustdoc/html/render.rs
浏览文件 @
440c0f07
...
...
@@ -103,6 +103,9 @@ pub struct Context {
pub
render_redirect_pages
:
bool
,
/// All the passes that were run on this crate.
pub
passes
:
HashSet
<
String
>
,
/// The base-URL of the issue tracker for when an item has been tagged with
/// an issue number.
pub
issue_tracker_base_url
:
Option
<
String
>
,
}
/// Indicates where an external crate can be found.
...
...
@@ -303,7 +306,8 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
pub
fn
run
(
mut
krate
:
clean
::
Crate
,
external_html
:
&
ExternalHtml
,
dst
:
PathBuf
,
passes
:
HashSet
<
String
>
)
->
io
::
Result
<
()
>
{
passes
:
HashSet
<
String
>
,
issue_tracker_base_url
:
Option
<
String
>
)
->
io
::
Result
<
()
>
{
let
src_root
=
match
krate
.src
.parent
()
{
Some
(
p
)
=>
p
.to_path_buf
(),
None
=>
PathBuf
::
new
(),
...
...
@@ -323,6 +327,7 @@ pub fn run(mut krate: clean::Crate,
},
include_sources
:
true
,
render_redirect_pages
:
false
,
issue_tracker_base_url
:
issue_tracker_base_url
,
};
try!
(
mkdir
(
&
cx
.dst
));
...
...
@@ -352,6 +357,10 @@ pub fn run(mut krate: clean::Crate,
}
});
}
clean
::
NameValue
(
ref
x
,
ref
s
)
if
"issue_tracker_base_url"
==
*
x
=>
{
cx
.issue_tracker_base_url
=
Some
(
s
.to_string
());
}
clean
::
Word
(
ref
x
)
if
"html_no_source"
==
*
x
=>
{
cx
.include_sources
=
false
;
...
...
src/librustdoc/lib.rs
浏览文件 @
440c0f07
...
...
@@ -178,6 +178,8 @@ pub fn opts() -> Vec<getopts::OptGroup> {
"FILES"
),
optopt
(
""
,
"markdown-playground-url"
,
"URL to send code snippets to"
,
"URL"
),
optopt
(
""
,
"issue-tracker-base-url"
,
"base URL for issue tracker"
,
"URL"
),
optflag
(
""
,
"markdown-no-toc"
,
"don't include table of contents"
)
)
}
...
...
@@ -284,7 +286,8 @@ pub fn main_args(args: &[String]) -> isize {
Some
(
"html"
)
|
None
=>
{
match
html
::
render
::
run
(
krate
,
&
external_html
,
output
.unwrap_or
(
PathBuf
::
from
(
"doc"
)),
passes
.into_iter
()
.collect
())
{
passes
.into_iter
()
.collect
(),
matches
.opt_str
(
"issue-tracker-base-url"
))
{
Ok
(())
=>
{}
Err
(
e
)
=>
panic!
(
"failed to generate documentation: {}"
,
e
),
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录