Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
8fbfd2c9
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,发现更多精彩内容 >>
提交
8fbfd2c9
编写于
1月 09, 2018
作者:
C
Corey Farwell
提交者:
GitHub
1月 09, 2018
浏览文件
操作
浏览文件
下载
差异文件
Rollup merge of #47301 - GuillaumeGomez:fix-error-index-display, r=QuietMisdreavus
Fix error index display Fixes #47284. r? @QuietMisdreavus
上级
14a9e264
265b234d
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
325 addition
and
224 deletion
+325
-224
src/doc/rust.css
src/doc/rust.css
+266
-223
src/tools/error_index_generator/main.rs
src/tools/error_index_generator/main.rs
+59
-1
未找到文件。
src/doc/rust.css
浏览文件 @
8fbfd2c9
...
...
@@ -206,7 +206,7 @@ pre {
padding
:
14px
;
padding-right
:
0
;
margin
:
20px
0
;
font-size
:
13
px
;
font-size
:
15
px
;
word-break
:
break-all
;
}
code
{
...
...
@@ -416,3 +416,46 @@ a.test-arrow:hover{
margin-left
:
2em
;
margin-bottom
:
1em
;
}
.error-described
{
position
:
relative
;
}
.information
{
position
:
absolute
;
left
:
-25px
;
margin-top
:
7px
;
z-index
:
1
;
}
.tooltip
{
position
:
relative
;
display
:
inline-block
;
cursor
:
pointer
;
}
.tooltip
.tooltiptext
{
width
:
120px
;
display
:
none
;
text-align
:
center
;
padding
:
5px
3px
;
border-radius
:
6px
;
margin-left
:
5px
;
top
:
-5px
;
left
:
105%
;
z-index
:
1
;
}
.tooltip
:hover
.tooltiptext
{
display
:
inline
;
}
.tooltip
.tooltiptext
::after
{
content
:
" "
;
position
:
absolute
;
top
:
50%
;
left
:
13px
;
margin-top
:
-5px
;
border-width
:
5px
;
border-style
:
solid
;
}
src/tools/error_index_generator/main.rs
浏览文件 @
8fbfd2c9
...
...
@@ -109,7 +109,65 @@ fn error_code_block(&self, output: &mut Write, info: &ErrorMetadata,
}
fn
footer
(
&
self
,
output
:
&
mut
Write
)
->
Result
<
(),
Box
<
Error
>>
{
write!
(
output
,
"</body>
\n
</html>"
)
?
;
write!
(
output
,
r##"<script>
function onEach(arr, func) {{
if (arr && arr.length > 0 && func) {{
for (var i = 0; i < arr.length; i++) {{
func(arr[i]);
}}
}}
}}
function hasClass(elem, className) {{
if (elem && className && elem.className) {{
var elemClass = elem.className;
var start = elemClass.indexOf(className);
if (start === -1) {{
return false;
}} else if (elemClass.length === className.length) {{
return true;
}} else {{
if (start > 0 && elemClass[start - 1] !== ' ') {{
return false;
}}
var end = start + className.length;
if (end < elemClass.length && elemClass[end] !== ' ') {{
return false;
}}
return true;
}}
if (start > 0 && elemClass[start - 1] !== ' ') {{
return false;
}}
var end = start + className.length;
if (end < elemClass.length && elemClass[end] !== ' ') {{
return false;
}}
return true;
}}
return false;
}}
onEach(document.getElementsByClassName('rust-example-rendered'), function(e) {{
if (hasClass(e, 'compile_fail')) {{
e.addEventListener("mouseover", function(event) {{
e.previousElementSibling.childNodes[0].style.color = '#f00';
}});
e.addEventListener("mouseout", function(event) {{
e.previousElementSibling.childNodes[0].style.color = '';
}});
}} else if (hasClass(e, 'ignore')) {{
e.addEventListener("mouseover", function(event) {{
e.previousElementSibling.childNodes[0].style.color = '#ff9200';
}});
e.addEventListener("mouseout", function(event) {{
e.previousElementSibling.childNodes[0].style.color = '';
}});
}}
}});
</script>
</body>
</html>"##
)
?
;
Ok
(())
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录