From c1f9ee15d8202e6734920a711050aed8e2920c46 Mon Sep 17 00:00:00 2001 From: starprograms Date: Thu, 21 May 2026 19:06:57 -0400 Subject: [PATCH] [GB-ASM] implemented accordion opening on *print* and *single* 182 Altered the renderer to add a special css page on print, and use the @print media on print. --- book.toml | 5 ++++- css/custom.css | 5 +++++ css/print.css | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 css/print.css diff --git a/book.toml b/book.toml index 50cf18cf..52aedced 100644 --- a/book.toml +++ b/book.toml @@ -27,11 +27,14 @@ command = "cargo run -p renderer --locked -rq --" additional-css = ["css/custom.css"] additional-js = ["js/linenos.js"] smart-punctuation = true -print = { enable = true } fold = { enable = true, level = 0 } git-repository-url = "https://github.com/gbdev/gb-asm-tutorial" edit-url-template = "https://github.com/gbdev/gb-asm-tutorial/edit/master/{path}" site-url = "/gb-asm-tutorial/" +[output.html.print] +enable = true # include support for printable output +additional-css = ["css/print.css"] + [output.linkcheck] optional = true diff --git a/css/custom.css b/css/custom.css index 3c979d9f..9eb9beac 100644 --- a/css/custom.css +++ b/css/custom.css @@ -80,3 +80,8 @@ pre > code.linenos > .line::before { .sprites { margin: 10px; } + +@media print { + details { display: block; } + details summary { display: none; } +} \ No newline at end of file diff --git a/css/print.css b/css/print.css new file mode 100644 index 00000000..2c056159 --- /dev/null +++ b/css/print.css @@ -0,0 +1,7 @@ + +details { + display: block !important; +} +details summary { + display: none !important; +} \ No newline at end of file