style code

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2026-03-17 00:31:21 +01:00
parent 73943c5022
commit 7e0235fb88
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
6 changed files with 51 additions and 24 deletions

View file

@ -1,3 +1,5 @@
#import "./custom_html.typ": code-block
#let css-list = state("css-list", ())
/// Add string `css` to `css-list` if not already present
@ -11,6 +13,16 @@
}
#let html_show(body) = {
show raw.where(lang: "raw-css"): it => add-css(it.text)
show raw: it => {
if it.lang == "raw-css" {
// remove code and add it to css style
add-css(it.text)
} else if it.block {
// wrap <pre><code> inside a <code-block>
code-block(it)
} else {
it
}
}
body
}