Skip to content

Commit c209ed8

Browse files
Improve no result found sentence in doc search
1 parent d586d5d commit c209ed8

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

src/librustdoc/html/static/main.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,16 @@
13401340
output = '<div class="search-failed"' + extraStyle + '>No results :(<br/>' +
13411341
'Try on <a href="https://duckduckgo.com/?q=' +
13421342
encodeURIComponent('rust ' + query.query) +
1343-
'">DuckDuckGo</a>?</div>';
1343+
'">DuckDuckGo</a>?<br/><br/>' +
1344+
'Or try looking in one of these:<ul><li>The <a ' +
1345+
'href="https://doc.rust-lang.org/reference/index.html">Rust Reference</a> for' +
1346+
' technical details about the language.</li><li><a ' +
1347+
'href="https://doc.rust-lang.org/rust-by-example/index.html">Rust By Example' +
1348+
'</a> for expository code examples.</a></li><li>The <a ' +
1349+
'href="https://doc.rust-lang.org/book/index.html">Rust Book</a> for ' +
1350+
'introductions to language features and the language itself.</li><li><a ' +
1351+
'href="https://docs.rs">Docs.rs</a> for documentation of crates released on ' +
1352+
'<a href="https://crates.io/">crates.io</a>.</li></ul></div>';
13441353
}
13451354
return [output, length];
13461355
}

src/librustdoc/html/static/rustdoc.css

+10-3
Original file line numberDiff line numberDiff line change
@@ -658,9 +658,9 @@ a {
658658
padding-right: 10px;
659659
}
660660
.content .search-results td:first-child a:after {
661-
clear: both;
662-
content: "";
663-
display: block;
661+
clear: both;
662+
content: "";
663+
display: block;
664664
}
665665
.content .search-results td:first-child a span {
666666
float: left;
@@ -1116,6 +1116,13 @@ pre.rust {
11161116
margin-top: 20px;
11171117
}
11181118

1119+
.search-failed > ul {
1120+
text-align: left;
1121+
max-width: 570px;
1122+
margin-left: auto;
1123+
margin-right: auto;
1124+
}
1125+
11191126
#titles {
11201127
height: 35px;
11211128
}

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)