-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate error index with mdbook instead of raw HTML pages
- Loading branch information
1 parent
7a42ca9
commit 1171697
Showing
8 changed files
with
214 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[book] | ||
title = "Error codes index" | ||
description = "Book listing all Rust error codes" | ||
src = "" | ||
|
||
[output.html] | ||
git-repository-url = "https://github.com/rust-lang/rust/" | ||
additional-css = ["error-index.css"] | ||
additional-js = ["error-index.js"] | ||
|
||
[output.html.search] | ||
enable = true | ||
limit-results = 20 | ||
use-boolean-and = true | ||
boost-title = 2 | ||
boost-hierarchy = 2 | ||
boost-paragraph = 1 | ||
expand = true | ||
heading-split-level = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
code.compile_fail { | ||
border-left: 2px solid red; | ||
} | ||
|
||
pre .tooltip { | ||
position: absolute; | ||
left: -25px; | ||
top: 0; | ||
z-index: 1; | ||
color: red; | ||
cursor: pointer; | ||
} | ||
pre .tooltip::after { | ||
display: none; | ||
content: "This example deliberately fails to compile"; | ||
background-color: #000; | ||
color: #fff; | ||
border-color: #000; | ||
text-align: center; | ||
padding: 5px 3px 3px 3px; | ||
border-radius: 6px; | ||
margin-left: 5px; | ||
} | ||
pre .tooltip::before { | ||
display: none; | ||
border-color: transparent black transparent transparent; | ||
content: " "; | ||
position: absolute; | ||
top: 50%; | ||
left: 16px; | ||
margin-top: -5px; | ||
border-width: 5px; | ||
border-style: solid; | ||
} | ||
|
||
pre .tooltip:hover::before, pre .tooltip:hover::after { | ||
display: inline; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
for (const elem of document.querySelectorAll("pre.playground")) { | ||
if (elem.querySelector(".compile_fail") === null) { | ||
continue; | ||
} | ||
const child = document.createElement("div"); | ||
child.className = "tooltip"; | ||
child.textContent = "ⓘ"; | ||
elem.appendChild(child); | ||
} |
Oops, something went wrong.