Skip to content

Commit 3f65069

Browse files
committed
ensure diagrams render properly without JavaScript
1 parent 1d6dd2c commit 3f65069

File tree

7 files changed

+41
-38
lines changed

7 files changed

+41
-38
lines changed

_hardware/usb-standard.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ reading the rest of the keyboard keys (second mention of the keyboard usage page
5050

5151
Given this descriptor, the payload sent from the keyboard to the computer looks like this:
5252

53-
<div class="diagram">
53+
<pre class="diagram">
5454
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
5555
| ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ |
5656
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
5757
╰──────┬──────╯ ╰──────┬──────╯ ╰──────┬──────╯ ╰──────┬──────╯ ╰──────┬──────╯ ╰──────┬──────╯ ╰──────┬──────╯ ╰──────┬───────┘
5858
Modifiers Reserved Scancode 1 Scancode 2 Scancode 3 Scancode 4 Scancode 5 Scancode 6
59-
</div>
59+
</pre>
6060

6161
This means that each report can report the scancodes of at most 6 simultanouesly pressed keys,
6262
a limitation often described with the term _6KRO_ (six key roll-over).
@@ -65,7 +65,7 @@ Various approaches have been tried to work around this limitation in the past, b
6565

6666
### Universal Report Format for Keyboards
6767

68-
<div class="diagram">
68+
<pre class="diagram">
6969
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+┅
7070
| ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ |
7171
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+┅
@@ -86,11 +86,11 @@ Various approaches have been tried to work around this limitation in the past, b
8686
┅+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
8787
┈───────┬──────────────────────╯ ╰──────────────────────┬──────────────────────╯ ╰──────────────────────┬──────────────────────╯
8888
Universal code 8 Universal code 9 Universal code 10
89-
</div>
89+
</pre>
9090

9191
#### Universal Code – Unicode codepoints
9292

93-
<div class="diagram">
93+
<pre class="diagram">
9494
+---------------+---------------+---------------+
9595
|0┊ ┊ ┊u┊u┊u┊u┊u|u┊u┊u┊u┊u┊u┊u┊u|u┊u┊u┊u┊u┊u┊u┊u|
9696
+---------------+---------------+---------------+
@@ -120,13 +120,13 @@ Various approaches have been tried to work around this limitation in the past, b
120120
+------┅
121121
╰─┬─╯
122122
Multiple codepoints – end
123-
</div>
123+
</pre>
124124

125125

126126

127127
#### Universal Code – Legacy Usage Pages
128128

129-
<div class="diagram">
129+
<pre class="diagram">
130130
+---------------+---------------+---------------+
131131
|1┊s┊s┊s┊s┊s┊s┊s|p┊p┊p┊p┊p┊p┊p┊p|p┊p┊p┊p┊p┊p┊p┊p|
132132
+---------------+---------------+---------------+
@@ -140,4 +140,4 @@ Legacy Selector
140140
╰─────┬─────╯ ╰──────────────┬──────────────╯
141141
Keyboard Page 0x07 Usage ID 0x04 (letter "A")
142142

143-
</div>
143+
</pre>

_interfaces/x86-prefixes-and-escape-opcodes-flowchart.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ update: 2025-04-27
55
markdeep: true
66
---
77

8-
<div class="diagram">
8+
<pre class="diagram">
99
start here
1010
|
1111
v ╔══════════════════════════════════════════════════╗
@@ -51,9 +51,9 @@ markdeep: true
5151
| ╔══════════════════════════════════════════════════╗
5252
+->║ AVX512-Float16 instructions (map 5/6) ║
5353
╚══════════════════════════════════════════════════╝
54-
</div>
54+
</pre>
5555

56-
<div class="diagram">
56+
<pre class="diagram">
5757
┏━┯━┯━┯━┯━┯━┯━┯━┓ ┏━┯━┯━┯━┯━┯━┯━┯━┳━┯━┯━┯━┯━┯━┯━┯━┓
5858
┃0 1 0 0 W R X B┃ ┃1 1 0 1 0 1 0 1┃M R X B W R X B┃
5959
┗━┷━┷━┷━┷━┷━┷━┷━┛ ┗━┷━┷━┷━┷━┷━┷━┷━┻━┷━┷━┷━┷━┷━┷━┷━┛
@@ -95,4 +95,4 @@ EVEX (4-byte prefix) AVX-512 (2013/2017) - let
9595
- Ŀ selects vector length (512bit) or rounding control mode (with L)
9696
- L selects vector length (256bit)
9797
- b encodes source broadcast or rounding control (with Ŀ and L) or exception suppression
98-
</div>
98+
</pre>

_languages/drop-break-and-continue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Of those 90 loops with `break`s, 80 are easily convertible to equivalent code no
2828

2929
Of the 10 loops with `continue`s maybe 5 are easily convertible.
3030

31-
<div class="diagram">
31+
<pre class="diagram">
3232
.------------------------------------------------.
3333
| all loops |
3434
| |
@@ -38,7 +38,7 @@ Of the 10 loops with `continue`s maybe 5 are easily convertible.
3838
| +---+
3939
| loops with continue--->| |
4040
'--------------------------------------------+---'
41-
</div>
41+
</pre>
4242

4343
This means that out of 1000 loops, supporting `break` and `continue` focuses on making 1.5% of the loops more convenient,
4444
to the detriment of the other 98.5% of the loops.

_runtimes/header-compression.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Consider a reference-based class definition `class Cat(name: String, lives: Int6
1111

1212
Then an instance `Cat("Colin", 9)` may be represented in memory like this:
1313

14-
<div class="diagram">
14+
<pre class="diagram">
1515
+---------------+---------------+---------------+
1616
| header | reference | 9 |
1717
+---------------+---------------+---------------+
1818
|
1919
v
2020
"Colin"
21-
</div>
21+
</pre>
2222

2323
- The header needs to include information on the instance's type for dynamic dispatch and garbage-collection purposes.
2424
- The runtime may need a number of bits for miscellaneous uses.
@@ -40,18 +40,18 @@ Schemes to decrease header size often trade in a more compressed representation
4040

4141
##### 4-byte instance header
4242

43-
<div class="diagram">
43+
<pre class="diagram">
4444
+---------------+---------------+---------------+---------------+
4545
| ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ |
4646
+---------------+---------------+---------------+---------------+
4747
╰──────────────────────┬──────────────────────╯ ╰──────┬──────╯
4848
24 bits: vtable/type/class pointer 8 bits: other uses
4949
64 byte granularity, 1 GiB address space (type 7)¹ .
50-
</div>
50+
</pre>
5151

5252
##### 8-byte instance header, with space for a forwarding pointer
5353

54-
<div class="diagram">
54+
<pre class="diagram">
5555
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
5656
| ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ |
5757
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
@@ -64,7 +64,7 @@ Schemes to decrease header size often trade in a more compressed representation
6464
- pinned bit
6565
- locked bit
6666
- forwarding (failed) bit
67-
</div>
67+
</pre>
6868

6969
---
7070
¹: [Pointer Compression Type 7](pointer-compression#type-7-vtabletypeclass-reference-64-byte-granularity-1-gib-address-space)<br/>

_runtimes/pointer-compression.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,91 +19,91 @@ _**TL;DR:** How large is a pointer on 64-bit systems – and how small can it pr
1919

2020
##### type 1: normal reference, 1 byte granularity, 256 TiB address space
2121

22-
<div class="diagram">
22+
<pre class="diagram">
2323
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
2424
| ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ |
2525
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
2626
╰──────────────┬──────────────╯ ╰──────────────────────────────┬──────────────────────────────────────────────────────────────╯
2727
bits 63 to 48 (16 bits): unused bits 47 to 0 (48 bits): address
2828

29-
</div>
29+
</pre>
3030

3131
<small>→ 48 bits address, 16 "free" bits</small>
3232

3333
##### type 2: normal reference, 8 byte granularity, 128 TiB address space
3434

35-
<div class="diagram">
35+
<pre class="diagram">
3636
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
3737
| ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ |
3838
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
3939
╰──────────────┬────────────────╯ ╰──────────────────────────────┬──────────────────────────────────────────────────────╯ ╰─┬─╯
4040
bits 63 to 47 (17 bits): unused bits 46 to 3 (44 bits): address bits 2 to 0 (3 bits): unused
4141

42-
</div>
42+
</pre>
4343

4444
<small>→ 44 bits address, 20 "free" bits</small>
4545

4646
##### type 3: normal reference, 8 byte granularity, 8 TiB address space
4747

48-
<div class="diagram">
48+
<pre class="diagram">
4949
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
5050
| ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ |
5151
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
5252
╰──────────────┬────────────────────────╯ ╰──────────────────────┬──────────────────────────────────────────────────────╯ ╰─┬─╯
5353
bits 63 to 43 (21 bits): unused bits 42 to 3 (40 bits): address bits 2 to 0 (3 bits): unused
5454

55-
</div>
55+
</pre>
5656

5757
<small>→ 40 bits address, 24 "free" bits</small>
5858

5959
##### type 4: normal reference, 8 byte granularity, 512 GiB address space
6060

61-
<div class="diagram">
61+
<pre class="diagram">
6262
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
6363
| ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ |
6464
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
6565
╰──────────────┬────────────────────────────────╯ ╰──────────────┬──────────────────────────────────────────────────────╯ ╰─┬─╯
6666
bits 63 to 39 (25 bits): unused bits 38 to 3 (36 bits): address bits 2 to 0 (3 bits): unused
6767

68-
</div>
68+
</pre>
6969

7070
<small>→ 36 bits address, 28 "free" bits</small>
7171

7272
##### type 5: vtable/type/class reference, 128 byte granularity, 128 TiB address space
7373

74-
<div class="diagram">
74+
<pre class="diagram">
7575
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
7676
| ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ |
7777
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
7878
╰──────────────┬────────────────╯ ╰──────────────────────────────┬──────────────────────────────────────────────╯ ╰─────┬─────╯
7979
bits 63 to 47 (17 bits): unused bits 46 to 7 (40 bits): address bits 6 to 0 (7 bits): unused
8080

81-
</div>
81+
</pre>
8282

8383
<small>→ 40 bits address, 24 "free" bits</small>
8484

8585
##### type 6: vtable/type/class reference, 128 byte granularity, 512 GiB address space
8686

87-
<div class="diagram">
87+
<pre class="diagram">
8888
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
8989
| ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ |
9090
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
9191
╰──────────────┬────────────────────────────────╯ ╰──────────────┬──────────────────────────────────────────────╯ ╰─────┬─────╯
9292
bits 63 to 39 (25 bits): unused bits 38 to 7 (32 bits): address bits 6 to 0 (7 bits): unused
9393

94-
</div>
94+
</pre>
9595

9696
<small>→ 32 bits address, 32 "free" bits</small>
9797

9898
##### type 7: vtable/type/class reference, 64 byte granularity, 1 GiB address space
9999

100-
<div class="diagram">
100+
<pre class="diagram">
101101
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
102102
| ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ | ┊ ┊ ┊ ┊ ┊ ┊ ┊ |
103103
+---------------+---------------+---------------+---------------+---------------+---------------+---------------+---------------+
104104
╰──────────────┬──────────────────────────────────────────────────╯ ╰──────────┬──────────────────────────────────╯ ╰───┬─────╯
105105
bits 63 to 30 (34 bits): unused bits 29 to 6 (24 bits): address bits 5 to 0 (6 bits): unused
106106

107-
</div>
107+
</pre>
108108

109109
<small>→ 24 bits address, 40 "free" bits</small>

_sass/base/_base.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ pre {
313313
padding-left: 0;
314314
border: 0;
315315
}
316+
& .diagram {
317+
font-size: 60%;
318+
}
316319
}
317320

318321
.obsolete {

0 commit comments

Comments
 (0)