1
Fork 0

Improve associated constant rendering in rustdoc

This commit is contained in:
Guillaume Gomez 2017-02-19 00:31:09 +01:00
parent 1572bf104d
commit 081336e8eb
3 changed files with 6 additions and 6 deletions

View file

@ -2217,7 +2217,7 @@ fn assoc_const(w: &mut fmt::Formatter,
ty: &clean::Type, ty: &clean::Type,
default: Option<&String>, default: Option<&String>,
link: AssocItemLink) -> fmt::Result { 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), naive_assoc_href(it, link),
it.name.as_ref().unwrap())?; it.name.as_ref().unwrap())?;

View file

@ -979,7 +979,7 @@
.html("[<span class='inner'></span>]"); .html("[<span class='inner'></span>]");
toggle.children(".inner").text(labelForToggleButton(false)); toggle.children(".inner").text(labelForToggleButton(false));
$(".method").each(function() { $(".method, .impl-items > .associatedconstant").each(function() {
if ($(this).next().is(".docblock") || if ($(this).next().is(".docblock") ||
($(this).next().is(".stability") && $(this).next().next().is(".docblock"))) { ($(this).next().is(".stability") && $(this).next().next().is(".docblock"))) {
$(this).children().last().after(toggle.clone()); $(this).children().last().after(toggle.clone());

View file

@ -89,7 +89,7 @@ h2 {
h3 { h3 {
font-size: 1.3em; 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; font-weight: 500;
margin: 20px 0 15px 0; margin: 20px 0 15px 0;
padding-bottom: 6px; padding-bottom: 6px;
@ -99,10 +99,10 @@ h1.fqn {
margin-top: 0; margin-top: 0;
position: relative; 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; 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; font-weight: 600;
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
@ -382,7 +382,7 @@ h4 > code, h3 > code, .invisible > code {
.content .impl-items .docblock, .content .impl-items .stability { .content .impl-items .docblock, .content .impl-items .stability {
margin-left: 40px; 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; margin-left: 20px;
} }