start migration to bundle format
This commit is contained in:
parent
64e270a868
commit
7fe9b99535
13 changed files with 378 additions and 470 deletions
|
|
@ -1,34 +1,7 @@
|
|||
#import "./states.typ": *
|
||||
#import "./figures.typ": show-rule-figure
|
||||
#import "./code.typ": show-rule-code-block
|
||||
|
||||
#let css-list = state("css-list", ())
|
||||
#let js-list = state("js-list", ())
|
||||
#let additionnal-head-tags = state("additionnal-head-tags", ())
|
||||
|
||||
/// Add string `css` to `css-list` if not already present
|
||||
#let add-css(css) = context {
|
||||
css-list.update(x => if css in x { x } else { x + (css,) })
|
||||
}
|
||||
|
||||
/// Add string `js` to `js-list` if not already present
|
||||
#let add-js(js) = context {
|
||||
js-list.update(x => if js in x { x } else { x + (js,) })
|
||||
}
|
||||
|
||||
/// Add additionnal html tag to insert in <head>
|
||||
#let add-tag-in-head(tag) = context {
|
||||
additionnal-head-tags.update(x => if tag in x { x } else { x + (tag, ) })
|
||||
}
|
||||
|
||||
/// Concatenate all css found in css-list at the end of the document
|
||||
#let get-css() = context {
|
||||
html.style(css-list.final().join("\n\n"))
|
||||
}
|
||||
|
||||
/// Concatenate all js found in js-list at the end of the document
|
||||
#let get-js() = context {
|
||||
html.script(js-list.final().join("\n\n"))
|
||||
}
|
||||
|
||||
#let html-show(body) = {
|
||||
show raw: it => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue