style code
This commit is contained in:
parent
73943c5022
commit
7e0235fb88
6 changed files with 51 additions and 24 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue