]> git.lizzy.rs Git - rust.git/commitdiff
Improve associated constant rendering in rustdoc
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 18 Feb 2017 23:31:09 +0000 (00:31 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Sun, 26 Feb 2017 14:50:53 +0000 (15:50 +0100)
src/librustdoc/html/render.rs
src/librustdoc/html/static/main.js
src/librustdoc/html/static/rustdoc.css

index ae4c94d4b38c096feb09e98b92b86a48c0528ae6..86b7c9736dab46403818aab59ae2e0ea8a055ee4 100644 (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())?;
 
index c12e1e7d6080db8739e07db05e9744fd57aa745b..200285862276a5f8e63ea479e02fde2268a9538c 100644 (file)
             .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());
index 681d2354056f67b7257a71c933cd978f05decd29..b0bf69b0181f22ae2de2705e1a333788bda169d5 100644 (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;
 }