16 lines
443 B
Typst
16 lines
443 B
Typst
#let state-use-pyscript = state("state-use-pyscript", false)
|
|
#let state-pyscript-version = state("state-pyscript-version", none)
|
|
#let state-pyscript-headers = state("state-pyscript-headers", (:))
|
|
|
|
#let pyscript(body) = {
|
|
show raw.where(block: true, lang: "python"): it => {
|
|
state-use-pyscript.update(x => true)
|
|
it
|
|
html.elem("script", attrs: (
|
|
type: "py",
|
|
terminal: "",
|
|
worker: "",
|
|
), it.text)
|
|
}
|
|
body
|
|
}
|