Skip to content

Commit 15acd66

Browse files
OnStarProgramsstarprograms
andauthored
Implemented accordion opening on *print* and *single* (#193), fix #182
Altered the renderer to add a special css page on print, and use the @print media on print. Co-authored-by: starprograms <thomas@starprograms.dev>
1 parent f2c855b commit 15acd66

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

book.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ command = "cargo run -p renderer --locked -rq --"
2727
additional-css = ["css/custom.css"]
2828
additional-js = ["js/linenos.js"]
2929
smart-punctuation = true
30-
print = { enable = true }
3130
fold = { enable = true, level = 0 }
3231
git-repository-url = "https://github.com/gbdev/gb-asm-tutorial"
3332
edit-url-template = "https://github.com/gbdev/gb-asm-tutorial/edit/master/{path}"
3433
site-url = "/gb-asm-tutorial/"
3534

35+
[output.html.print]
36+
enable = true # include support for printable output
37+
additional-css = ["css/print.css"]
38+
3639
[output.linkcheck]
3740
optional = true

css/custom.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,8 @@ pre > code.linenos > .line::before {
8080
.sprites {
8181
margin: 10px;
8282
}
83+
84+
@media print {
85+
details { display: block; }
86+
details summary { display: none; }
87+
}

css/print.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
details {
3+
display: block !important;
4+
}
5+
details summary {
6+
display: none !important;
7+
}

0 commit comments

Comments
 (0)