Add link to rustdoc book in rustdoc help popup

This commit is contained in:
Guillaume Gomez 2020-10-19 13:44:27 +02:00
parent 98e16884b1
commit 880d644a50
5 changed files with 33 additions and 5 deletions

View File

@ -2792,6 +2792,10 @@ function defocusSearchBar() {
addClass(popup, "hidden");
popup.id = "help";
var book_info = document.createElement("span");
book_info.innerHTML = "You can find more information in \
<a href=\"https://doc.rust-lang.org/rustdoc/\">the rustdoc book</a>.";
var container = document.createElement("div");
var shortcuts = [
["?", "Show this help dialog"],
@ -2825,6 +2829,7 @@ function defocusSearchBar() {
addClass(div_infos, "infos");
div_infos.innerHTML = "<h2>Search Tricks</h2>" + infos;
container.appendChild(book_info);
container.appendChild(div_shortcuts);
container.appendChild(div_infos);

View File

@ -796,14 +796,22 @@ body.blur > :not(#help) {
clear: left;
display: block;
}
#help > div > span {
text-align: center;
display: block;
margin: 10px 0;
font-size: 18px;
border-bottom: 1px solid #ccc;
padding-bottom: 4px;
margin-bottom: 6px;
}
#help dd { margin: 5px 35px; }
#help .infos { padding-left: 0; }
#help h1, #help h2 { margin-top: 0; }
#help > div div {
width: 50%;
float: left;
padding: 20px;
padding-left: 17px;
padding: 0 20px 20px 17px;;
}
.stab {

View File

@ -219,7 +219,8 @@ a {
}
.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),
.docblock-short a:not(.srclink):not(.test-arrow), .stability a {
.docblock-short a:not(.srclink):not(.test-arrow), .stability a,
#help a {
color: #39AFD7;
}
@ -275,6 +276,10 @@ a {
border-radius: 4px;
}
#help > div > span {
border-bottom-color: #5c6773;
}
.since {
color: grey;
}

View File

@ -177,7 +177,8 @@ a {
}
.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),
.docblock-short a:not(.srclink):not(.test-arrow), .stability a {
.docblock-short a:not(.srclink):not(.test-arrow), .stability a,
#help a {
color: #D2991D;
}
@ -231,6 +232,10 @@ a.test-arrow {
border-color: #bfbfbf;
}
#help > div > span {
border-bottom-color: #bfbfbf;
}
#help dt {
border-color: #bfbfbf;
background: rgba(0,0,0,0);

View File

@ -175,7 +175,8 @@ a {
}
.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),
.docblock-short a:not(.srclink):not(.test-arrow), .stability a {
.docblock-short a:not(.srclink):not(.test-arrow), .stability a,
#help a {
color: #3873AD;
}
@ -229,6 +230,10 @@ a.test-arrow {
border-color: #bfbfbf;
}
#help > div > span {
border-bottom-color: #bfbfbf;
}
.since {
color: grey;
}