pyscript minimum working example
This commit is contained in:
parent
9d09803ddc
commit
38a192abb6
4 changed files with 63 additions and 1 deletions
16
lib/pyscript.typ
Normal file
16
lib/pyscript.typ
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue