]> git.lizzy.rs Git - rust.git/commitdiff
Improve no result found sentence in doc search
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 1 Nov 2018 01:20:49 +0000 (02:20 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 21 Nov 2018 18:45:04 +0000 (19:45 +0100)
src/librustdoc/html/static/main.js
src/librustdoc/html/static/rustdoc.css
src/librustdoc/html/static/themes/dark.css
src/librustdoc/html/static/themes/light.css

index 3174c1be3adc80a26824d8dbfc2f7569e15c1834..27b1dfc9ce39ae8246f7aa53a53bdac97fb821fb 100644 (file)
                 output = '<div class="search-failed"' + extraStyle + '>No results :(<br/>' +
                     'Try on <a href="https://duckduckgo.com/?q=' +
                     encodeURIComponent('rust ' + query.query) +
-                    '">DuckDuckGo</a>?</div>';
+                    '">DuckDuckGo</a>?<br/><br/>' +
+                    'Or try looking in one of these:<ul><li>The <a ' +
+                    'href="https://doc.rust-lang.org/reference/index.html">Rust Reference</a> for' +
+                    ' technical details about the language.</li><li><a ' +
+                    'href="https://doc.rust-lang.org/rust-by-example/index.html">Rust By Example' +
+                    '</a> for expository code examples.</a></li><li>The <a ' +
+                    'href="https://doc.rust-lang.org/book/index.html">Rust Book</a> for ' +
+                    'introductions to language features and the language itself.</li><li><a ' +
+                    'href="https://docs.rs">Docs.rs</a> for documentation of crates released on ' +
+                    '<a href="https://crates.io/">crates.io</a>.</li></ul></div>';
             }
             return [output, length];
         }
index 8bcb828a5ade1e22f961bf5d68fb3ac1ed1eec5d..aa43a0bb58ad9795c98f099da176d8a47301699d 100644 (file)
@@ -658,9 +658,9 @@ a {
        padding-right: 10px;
 }
 .content .search-results td:first-child a:after {
-    clear: both;
-    content: "";
-    display: block;
+       clear: both;
+       content: "";
+       display: block;
 }
 .content .search-results td:first-child a span {
        float: left;
@@ -1116,6 +1116,13 @@ pre.rust {
        margin-top: 20px;
 }
 
+.search-failed > ul {
+       text-align: left;
+       max-width: 570px;
+       margin-left: auto;
+       margin-right: auto;
+}
+
 #titles {
        height: 35px;
 }
index 4a8950b236c62da6175a83280fb122b3cb134bb0..9c90c9485811603a7fbc4ce6c111918cd56804d5 100644 (file)
@@ -285,7 +285,7 @@ pre.ignore:hover, .information:hover + pre.ignore {
        color: rgba(255,142,0,1);
 }
 
-.search-failed a {
+.search-failed a {
        color: #0089ff;
 }
 
index b3b0b6b2ea9e869f1bb3a07c39f292611805ccaa..e839fc3f2783f5e64b381befc6436afd1baa70b1 100644 (file)
@@ -279,7 +279,7 @@ pre.ignore:hover, .information:hover + pre.ignore {
        color: rgba(255,142,0,1);
 }
 
-.search-failed a {
+.search-failed a {
        color: #0089ff;
 }