add options to configure pyscript interpreter

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2026-06-03 00:24:20 +02:00
parent 25cb9c6403
commit 62c020ca7b
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
2 changed files with 25 additions and 6 deletions

View file

@ -2,7 +2,7 @@
#import "./html_body.typ": html-body
#import "./html_utils.typ": html-show
#import "./summary.typ": summary, card-list
#import "./pyscript.typ": state-use-pyscript, state-pyscript-headers, state-pyscript-version, pyscript-show
#import "./pyscript.typ": state-use-pyscript, state-pyscript-headers, state-pyscript-version, state-pyscript-interpreters, state-pyscript-default-interpreter, pyscript-show
#import "./rss.typ": rss
#import "./icons.typ"
@ -34,8 +34,12 @@
me-links: (),
/// Dictionnary of available tags to add in header for each versions of pyscript
pyscript-headers: (:),
/// Dictionnary of available python version to add in header for each pyscript interpreter
pyscript-interpreters: (:),
/// Pyscript version to use
pyscript-version: none,
/// Default python version to use for selecting the pyscript interpreter
pyscript-default-interpreter: none,
//-- Body --
/// Array of element to add on the top left of the page
nav-elements: none,
@ -54,7 +58,9 @@
assert(type(url) == str, message: "A page must have an url")
context {
state-pyscript-headers.update(x => pyscript-headers)
state-pyscript-interpreters.update(x => pyscript-interpreters)
state-pyscript-version.update(x => pyscript-version)
state-pyscript-default-interpreter.update(x => pyscript-default-interpreter)
}
show: html-show
show raw.where(block: true, lang: "python"): pyscript-show