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,
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())?;

View File

@ -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());

View File

@ -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;
}