Skip to content

Commit

Permalink
Improve associated constant rendering in rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 26, 2017
1 parent 1572bf1 commit 081336e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/html/render.rs
Expand Up @@ -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())?;

Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/main.js
Expand Up @@ -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());
Expand Down
8 changes: 4 additions & 4 deletions src/librustdoc/html/static/rustdoc.css
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 081336e

Please sign in to comment.