add support for pygame scripts
This commit is contained in:
parent
fe4b003971
commit
3be22c5654
6 changed files with 180 additions and 89 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#import "./custom_html.typ" as chtml
|
||||
#import "./html_utils.typ": get-css, get-js
|
||||
#import "./pyscript.typ": state-use-pyscript, state-pyscript-headers, state-pyscript-version
|
||||
#import "./html_utils.typ": get-css, get-js, additionnal-head-tags
|
||||
#import "./pyscript.typ": state-use-pyscript, state-pyscript-data-list, state-pyscript-version
|
||||
|
||||
/// Generate the html <head> element for the page.
|
||||
#let html-head(
|
||||
|
|
@ -95,20 +95,25 @@
|
|||
}
|
||||
}}
|
||||
|
||||
html.style(get-css())
|
||||
html.script(get-js())
|
||||
context for tag in additionnal-head-tags.final() {
|
||||
tag
|
||||
}
|
||||
|
||||
context if state-use-pyscript.final() {
|
||||
assert(
|
||||
state-pyscript-version.final() != none,
|
||||
message: "Cannot run python script: pyscript-version is not set"
|
||||
)
|
||||
assert(
|
||||
state-pyscript-version.final() in state-pyscript-headers.final(),
|
||||
state-pyscript-version.final() in state-pyscript-data-list.final(),
|
||||
message: "Cannot run python script: urls for " + state-pyscript-version.final() + " not set in pyscript-urls"
|
||||
)
|
||||
state-pyscript-headers.final().at(state-pyscript-version.final())
|
||||
let pyscript-data = state-pyscript-data-list.final().at(state-pyscript-version.final())
|
||||
html.script(type: "module", src: pyscript-data.core-js-url)
|
||||
pyscript-data.additionnal-head-tags
|
||||
}
|
||||
|
||||
html.style(get-css())
|
||||
html.script(get-js())
|
||||
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue