Skip to content

Commit cb00eab

Browse files
committed
Add an incomplete warning to the top page
1 parent 55de6fa commit cb00eab

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

Diff for: book.toml

+1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ 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"

Diff for: src/README.md

+11
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. Documenting everything and rewriting outdated parts take a while.
7+
See the [issue tracker] to check what's missing/outdated, and if there are any mistakes
8+
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,

Diff for: theme/nomicon.css

+40
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)