23 lines
543 B
Typst
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
|
|
}
|