typst-web-template/lib/html_utils.typ
Jean-Marie 'Histausse' Mineau 7fe9b99535
start migration to bundle format
2026-06-17 12:40:20 +02:00

23 lines
543 B
Typst

#import "./states.typ": *
#import "./figures.typ": show-rule-figure
#import "./code.typ": show-rule-code-block
#let html-show(body) = {
show raw: it => {
if it.lang == "raw-css" {
// remove code and add it to css style
add-css(it.text)
} else if it.lang == "raw-js" {
// remove code and add it to css style
add-js(it.text)
} else if it.block {
// wrap <pre><code> inside a <code-block>
show-rule-code-block(it)
} else {
it
}
}
show figure: show-rule-figure
body
}