提交 081336e8 编写于 作者: G Guillaume Gomez

Improve associated constant rendering in rustdoc

上级 1572bf10
......@@ -2217,7 +2217,7 @@ fn assoc_const(w: &mut fmt::Formatter,
ty: &clean::Type,
default: Option<&String>,
link: AssocItemLink) -> fmt::Result {
write!(w, "const <a href='{}' class='constant'>{}</a>",
write!(w, "const <a href='{}' class='constant'><b>{}</b></a>",
naive_assoc_href(it, link),
it.name.as_ref().unwrap())?;
......
......@@ -979,7 +979,7 @@
.html("[<span class='inner'></span>]");
toggle.children(".inner").text(labelForToggleButton(false));
$(".method").each(function() {
$(".method, .impl-items > .associatedconstant").each(function() {
if ($(this).next().is(".docblock") ||
($(this).next().is(".stability") && $(this).next().next().is(".docblock"))) {
$(this).children().last().after(toggle.clone());
......
......@@ -89,7 +89,7 @@ h2 {
h3 {
font-size: 1.3em;
}
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
font-weight: 500;
margin: 20px 0 15px 0;
padding-bottom: 6px;
......@@ -99,10 +99,10 @@ h1.fqn {
margin-top: 0;
position: relative;
}
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
border-bottom: 1px solid;
}
h3.impl, h3.method, h4.method, h3.type, h4.type {
h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
font-weight: 600;
margin-top: 10px;
margin-bottom: 10px;
......@@ -382,7 +382,7 @@ h4 > code, h3 > code, .invisible > code {
.content .impl-items .docblock, .content .impl-items .stability {
margin-left: 40px;
}
.content .impl-items .method, .content .impl-items > .type {
.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
margin-left: 20px;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册