Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
772a8028
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,发现更多精彩内容 >>
提交
772a8028
编写于
3月 28, 2018
作者:
G
Guillaume Gomez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename main theme into light theme
上级
14ac1b5f
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
18 addition
and
18 deletion
+18
-18
src/doc/rustdoc/src/unstable-features.md
src/doc/rustdoc/src/unstable-features.md
+3
-3
src/librustdoc/html/layout.rs
src/librustdoc/html/layout.rs
+1
-1
src/librustdoc/html/render.rs
src/librustdoc/html/render.rs
+6
-6
src/librustdoc/html/static/storage.js
src/librustdoc/html/static/storage.js
+1
-1
src/librustdoc/html/static/themes/light.css
src/librustdoc/html/static/themes/light.css
+0
-0
src/librustdoc/lib.rs
src/librustdoc/lib.rs
+4
-4
src/tools/error_index_generator/main.rs
src/tools/error_index_generator/main.rs
+2
-2
src/tools/rustdoc-themes/main.rs
src/tools/rustdoc-themes/main.rs
+1
-1
未找到文件。
src/doc/rustdoc/src/unstable-features.md
浏览文件 @
772a8028
...
...
@@ -305,7 +305,7 @@ $ rustdoc src/lib.rs -Z unstable-options --themes theme.css
Giving this flag to
`rustdoc`
will make it copy your theme into the generated crate docs and enable
it in the theme selector. Note that
`rustdoc`
will reject your theme file if it doesn't style
everything the "
main
" theme does. See
`--theme-checker`
below for details.
everything the "
light
" theme does. See
`--theme-checker`
below for details.
### `--theme-checker`: verify theme CSS for validity
...
...
@@ -316,7 +316,7 @@ $ rustdoc -Z unstable-options --theme-checker theme.css
```
Before including your theme in crate docs,
`rustdoc`
will compare all the CSS rules it contains
against the "
main
" theme included by default. Using this flag will allow you to see which rules are
against the "
light
" theme included by default. Using this flag will allow you to see which rules are
missing if
`rustdoc`
rejects your theme.
### `--resource-suffix`: modifying the name of CSS/JavaScript in crate docs
...
...
@@ -330,7 +330,7 @@ $ rustdoc src/lib.rs -Z unstable-options --resource-suffix suf
When rendering docs,
`rustdoc`
creates several CSS and JavaScript files as part of the output. Since
all these files are linked from every page, changing where they are can be cumbersome if you need to
specially cache them. This flag will rename all these files in the output to include the suffix in
the filename. For example,
`
main.css`
would become
`main
-suf.css`
with the above command.
the filename. For example,
`
light.css`
would become
`light
-suf.css`
with the above command.
### `--display-warnings`: display warnings when documenting or running documentation tests
...
...
src/librustdoc/html/layout.rs
浏览文件 @
772a8028
...
...
@@ -53,7 +53,7 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
id="mainThemeStyle">
{themes}
<link rel="stylesheet" type="text/css" href="{root_path}dark{suffix}.css">
<link rel="stylesheet" type="text/css" href="{root_path}
main
{suffix}.css" id="themeStyle">
<link rel="stylesheet" type="text/css" href="{root_path}
light
{suffix}.css" id="themeStyle">
<script src="{root_path}storage{suffix}.js"></script>
{css_extension}
...
...
src/librustdoc/html/render.rs
浏览文件 @
772a8028
...
...
@@ -129,8 +129,8 @@ pub struct SharedContext {
pub
sort_modules_alphabetically
:
bool
,
/// Additional themes to be added to the generated docs.
pub
themes
:
Vec
<
PathBuf
>
,
/// Suffix to be added on resource files (if suffix is "-v2" then "
main
.css" becomes
/// "
main
-v2.css").
/// Suffix to be added on resource files (if suffix is "-v2" then "
light
.css" becomes
/// "
light
-v2.css").
pub
resource_suffix
:
String
,
}
...
...
@@ -743,7 +743,7 @@ fn write_shared(cx: &Context,
write
(
cx
.dst
.join
(
&
format!
(
"rustdoc{}.css"
,
cx
.shared.resource_suffix
)),
include_bytes!
(
"static/rustdoc.css"
))
?
;
// To avoid "
main
.css" to be overwritten, we'll first run over the received themes and only
// To avoid "
light
.css" to be overwritten, we'll first run over the received themes and only
// then we'll run over the "official" styles.
let
mut
themes
:
HashSet
<
String
>
=
HashSet
::
new
();
...
...
@@ -761,9 +761,9 @@ fn write_shared(cx: &Context,
write
(
cx
.dst
.join
(
&
format!
(
"brush{}.svg"
,
cx
.shared.resource_suffix
)),
include_bytes!
(
"static/brush.svg"
))
?
;
write
(
cx
.dst
.join
(
&
format!
(
"
main
{}.css"
,
cx
.shared.resource_suffix
)),
include_bytes!
(
"static/themes/
main
.css"
))
?
;
themes
.insert
(
"
main
"
.to_owned
());
write
(
cx
.dst
.join
(
&
format!
(
"
light
{}.css"
,
cx
.shared.resource_suffix
)),
include_bytes!
(
"static/themes/
light
.css"
))
?
;
themes
.insert
(
"
light
"
.to_owned
());
write
(
cx
.dst
.join
(
&
format!
(
"dark{}.css"
,
cx
.shared.resource_suffix
)),
include_bytes!
(
"static/themes/dark.css"
))
?
;
themes
.insert
(
"dark"
.to_owned
());
...
...
src/librustdoc/html/static/storage.js
浏览文件 @
772a8028
...
...
@@ -67,4 +67,4 @@ function switchTheme(styleElem, mainStyleElem, newTheme) {
}
}
switchTheme
(
currentTheme
,
mainTheme
,
getCurrentValue
(
'
rustdoc-theme
'
)
||
'
main
'
);
switchTheme
(
currentTheme
,
mainTheme
,
getCurrentValue
(
'
rustdoc-theme
'
)
||
'
light
'
);
src/librustdoc/html/static/themes/
main
.css
→
src/librustdoc/html/static/themes/
light
.css
浏览文件 @
772a8028
文件已移动
src/librustdoc/lib.rs
浏览文件 @
772a8028
...
...
@@ -266,8 +266,8 @@ pub fn opts() -> Vec<RustcOptGroup> {
unstable
(
"resource-suffix"
,
|
o
|
{
o
.optopt
(
""
,
"resource-suffix"
,
"suffix to add to CSS and JavaScript files, e.g.
\"
main
.css
\"
will become
\
\"
main
-suffix.css
\"
"
,
"suffix to add to CSS and JavaScript files, e.g.
\"
light
.css
\"
will become
\
\"
light
-suffix.css
\"
"
,
"PATH"
)
}),
]
...
...
@@ -321,7 +321,7 @@ pub fn main_args(args: &[String]) -> isize {
let
to_check
=
matches
.opt_strs
(
"theme-checker"
);
if
!
to_check
.is_empty
()
{
let
paths
=
theme
::
load_css_paths
(
include_bytes!
(
"html/static/themes/
main
.css"
));
let
paths
=
theme
::
load_css_paths
(
include_bytes!
(
"html/static/themes/
light
.css"
));
let
mut
errors
=
0
;
println!
(
"rustdoc: [theme-checker] Starting tests!"
);
...
...
@@ -392,7 +392,7 @@ pub fn main_args(args: &[String]) -> isize {
let
mut
themes
=
Vec
::
new
();
if
matches
.opt_present
(
"themes"
)
{
let
paths
=
theme
::
load_css_paths
(
include_bytes!
(
"html/static/themes/
main
.css"
));
let
paths
=
theme
::
load_css_paths
(
include_bytes!
(
"html/static/themes/
light
.css"
));
for
(
theme_file
,
theme_s
)
in
matches
.opt_strs
(
"themes"
)
.iter
()
...
...
src/tools/error_index_generator/main.rs
浏览文件 @
772a8028
...
...
@@ -61,8 +61,8 @@ fn header(&self, output: &mut Write) -> Result<(), Box<Error>> {
<head>
<title>Rust Compiler Error Index</title>
<meta charset="utf-8">
<!-- Include rust.css after
main
.css so its rules take priority. -->
<link rel="stylesheet" type="text/css" href="
main
.css"/>
<!-- Include rust.css after
light
.css so its rules take priority. -->
<link rel="stylesheet" type="text/css" href="
light
.css"/>
<link rel="stylesheet" type="text/css" href="rust.css"/>
<style>
.error-undescribed {{
...
...
src/tools/rustdoc-themes/main.rs
浏览文件 @
772a8028
...
...
@@ -13,7 +13,7 @@
use
std
::
path
::
Path
;
use
std
::
process
::{
Command
,
exit
};
const
FILES_TO_IGNORE
:
&
[
&
str
]
=
&
[
"
main
.css"
];
const
FILES_TO_IGNORE
:
&
[
&
str
]
=
&
[
"
light
.css"
];
fn
get_folders
<
P
:
AsRef
<
Path
>>
(
folder_path
:
P
)
->
Vec
<
String
>
{
let
mut
ret
=
Vec
::
with_capacity
(
10
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录