Skip to content

Commit

Permalink
Rollup merge of #78103 - GuillaumeGomez:rustdoc-book, r=jyn514
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored Oct 19, 2020
2 parents 81180f4 + 880d644 commit cbcf8d4
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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);

Expand Down
12 changes: 10 additions & 2 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 6 additions & 1 deletion src/librustdoc/html/static/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -275,6 +276,10 @@ a {
border-radius: 4px;
}

#help > div > span {
border-bottom-color: #5c6773;
}

.since {
color: grey;
}
Expand Down
7 changes: 6 additions & 1 deletion src/librustdoc/html/static/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion src/librustdoc/html/static/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -229,6 +230,10 @@ a.test-arrow {
border-color: #bfbfbf;
}

#help > div > span {
border-bottom-color: #bfbfbf;
}

.since {
color: grey;
}
Expand Down

0 comments on commit cbcf8d4

Please sign in to comment.