Skip to content

Commit 1bca455

Browse files
authored
Rollup merge of rust-lang#55563 - GuillaumeGomez:doc-search-sentence, r=QuietMisdreavus
Improve no result found sentence in doc search Fixes rust-lang#55531. Look: <img width="1440" alt="screenshot 2018-11-01 at 02 21 56" src="https://user-images.githubusercontent.com/3050060/47827257-f6236c80-dd7c-11e8-9ea9-99c8cb4b2de5.png"> r? @QuietMisdreavus
2 parents 7ffd99e + c209ed8 commit 1bca455

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

src/librustdoc/html/static/main.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,16 @@ if (!String.prototype.endsWith) {
13001300
output = '<div class="search-failed"' + extraStyle + '>No results :(<br/>' +
13011301
'Try on <a href="https://duckduckgo.com/?q=' +
13021302
encodeURIComponent('rust ' + query.query) +
1303-
'">DuckDuckGo</a>?</div>';
1303+
'">DuckDuckGo</a>?<br/><br/>' +
1304+
'Or try looking in one of these:<ul><li>The <a ' +
1305+
'href="https://doc.rust-lang.org/reference/index.html">Rust Reference</a> for' +
1306+
' technical details about the language.</li><li><a ' +
1307+
'href="https://doc.rust-lang.org/rust-by-example/index.html">Rust By Example' +
1308+
'</a> for expository code examples.</a></li><li>The <a ' +
1309+
'href="https://doc.rust-lang.org/book/index.html">Rust Book</a> for ' +
1310+
'introductions to language features and the language itself.</li><li><a ' +
1311+
'href="https://docs.rs">Docs.rs</a> for documentation of crates released on ' +
1312+
'<a href="https://crates.io/">crates.io</a>.</li></ul></div>';
13041313
}
13051314
return [output, length];
13061315
}

src/librustdoc/html/static/rustdoc.css

+7
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,13 @@ pre.rust {
11321132
margin-top: 20px;
11331133
}
11341134

1135+
.search-failed > ul {
1136+
text-align: left;
1137+
max-width: 570px;
1138+
margin-left: auto;
1139+
margin-right: auto;
1140+
}
1141+
11351142
#titles {
11361143
height: 35px;
11371144
}

src/librustdoc/html/static/themes/dark.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ pre.ignore:hover, .information:hover + pre.ignore {
285285
color: rgba(255,142,0,1);
286286
}
287287

288-
.search-failed > a {
288+
.search-failed a {
289289
color: #0089ff;
290290
}
291291

src/librustdoc/html/static/themes/light.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ pre.ignore:hover, .information:hover + pre.ignore {
279279
color: rgba(255,142,0,1);
280280
}
281281

282-
.search-failed > a {
282+
.search-failed a {
283283
color: #0089ff;
284284
}
285285

0 commit comments

Comments
 (0)