Skip to content

Commit fce5aa9

Browse files
committed
Add an incomplete warning to the top page
1 parent b9ca313 commit fce5aa9

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

book.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title = "The Rustonomicon"
44
description = "The Dark Arts of Advanced and Unsafe Rust Programming"
55

66
[output.html]
7+
additional-css = ["theme/nomicon.css"]
78
git-repository-url = "https://github.com/rust-lang/nomicon"
89

910
[output.html.redirect]

src/intro.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# The Rustonomicon
22

3+
<div class="warning">
4+
5+
Warning:
6+
This book is incomplete.
7+
Documenting everything and rewriting outdated parts take a while.
8+
See the [issue tracker] to check what's missing/outdated, and if there are any mistakes or ideas that haven't been reported, feel free to open a new issue there.
9+
10+
</div>
11+
12+
[issue tracker]: https://github.com/rust-lang/nomicon/issues
13+
314
## The Dark Arts of Unsafe Rust
415

516
> THE KNOWLEDGE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF UNLEASHING INDESCRIBABLE HORRORS THAT SHATTER YOUR PSYCHE AND SET YOUR MIND ADRIFT IN THE UNKNOWABLY INFINITE COSMOS.

theme/nomicon.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
Taken from the reference.
3+
Warnings and notes:
4+
Write the <div>s on their own line. E.g.
5+
<div class="warning">
6+
Warning: This is bad!
7+
</div>
8+
*/
9+
main .warning p {
10+
padding: 10px 20px;
11+
margin: 20px 0;
12+
}
13+
14+
main .warning p::before {
15+
content: "⚠️ ";
16+
}
17+
18+
.light main .warning p,
19+
.rust main .warning p {
20+
border: 2px solid red;
21+
background: #ffcece;
22+
}
23+
24+
.rust main .warning p {
25+
/* overrides previous declaration */
26+
border-color: #961717;
27+
}
28+
29+
.coal main .warning p,
30+
.navy main .warning p,
31+
.ayu main .warning p {
32+
background: #542626
33+
}
34+
35+
/* Make the links higher contrast on dark themes */
36+
.coal main .warning p a,
37+
.navy main .warning p a,
38+
.ayu main .warning p a {
39+
color: #80d0d0
40+
}

0 commit comments

Comments
 (0)