pyscript minimum working example

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2026-05-31 15:39:50 +02:00
parent 9d09803ddc
commit 38a192abb6
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
4 changed files with 63 additions and 1 deletions

16
lib/pyscript.typ Normal file
View file

@ -0,0 +1,16 @@
#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
}