Correctly render spoilers with TeX
This commit is contained in:
parent
1fc9c43010
commit
ae57a0d043
20
spoiler1.rkt
20
spoiler1.rkt
|
@ -13,7 +13,8 @@
|
||||||
scribble/decode
|
scribble/decode
|
||||||
scribble/html-properties
|
scribble/html-properties
|
||||||
hyper-literate
|
hyper-literate
|
||||||
(for-syntax syntax/parse))
|
(for-syntax syntax/parse)
|
||||||
|
scriblib/render-cond)
|
||||||
|
|
||||||
(define spoiler-css
|
(define spoiler-css
|
||||||
#"
|
#"
|
||||||
|
@ -115,18 +116,27 @@ EOJS
|
||||||
(chunk #:save-as ck1
|
(chunk #:save-as ck1
|
||||||
#:display-only
|
#:display-only
|
||||||
#:button
|
#:button
|
||||||
(list " " (smaller (spoiler-button-default-to-alt "expand")))
|
(cond-element
|
||||||
|
[html (list " " (smaller
|
||||||
|
(spoiler-button-default-to-alt "expand")))]
|
||||||
|
[else (list)])
|
||||||
name
|
name
|
||||||
default ...)
|
default ...)
|
||||||
|
|
||||||
(chunk #:save-as ck2
|
(chunk #:save-as ck2
|
||||||
#:button
|
#:button
|
||||||
(list " " (smaller (spoiler-button-alt-to-default "collapse")))
|
(cond-element
|
||||||
|
[html (list " " (smaller
|
||||||
|
(spoiler-button-alt-to-default "collapse")))]
|
||||||
|
[else (list)])
|
||||||
name
|
name
|
||||||
expanded ...)
|
expanded ...)
|
||||||
|
|
||||||
(nested-flow spoiler-wrapper-collapsed
|
(cond-block
|
||||||
|
[html (nested-flow spoiler-wrapper-collapsed
|
||||||
(list (nested-flow spoiler-default
|
(list (nested-flow spoiler-default
|
||||||
(decode-flow (ck1)))
|
(decode-flow (ck1)))
|
||||||
(nested-flow spoiler-alt
|
(nested-flow spoiler-alt
|
||||||
(decode-flow (ck2))))))]))
|
(decode-flow (ck2)))))]
|
||||||
|
[else (nested-flow (style #f '())
|
||||||
|
(decode-flow (ck2)))]))]))
|
Loading…
Reference in New Issue
Block a user