small refactor

This commit is contained in:
2025-07-22 23:36:20 +02:00
parent 8053caf1db
commit c9d8f8db60
7 changed files with 89 additions and 51 deletions

View File

@@ -28,14 +28,30 @@
#set text(font: "DejaVu Sans Mono", size: default-font-size)
#show raw: it => box(
stroke: black,
radius: 2pt,
inset: if is-html() { 1.4pt } else { 4pt },
outset: 0pt,
baseline: 3.1pt,
text(it)
)
#show raw: it => if type(it.lang) == str and it.lang != "" and is-nano == false {
// TODO: after typst fix html exporter breaking line :sob:
// context html-frame(context
box(
stroke: black,
radius: 2pt,
inset: if is-html() { 1.4pt } else { 5pt },
outset: 0pt,
baseline: 3.1pt,
text(it)
)
} else if is-nano == true {
html-code(text(it))
} else {
box(
stroke: black,
radius: 2pt,
inset: if is-html() { 1.4pt } else { 5pt },
outset: 0pt,
baseline: 3.1pt,
text(it)
)
}
#show box: it => {
context if is-html() {
@@ -119,6 +135,12 @@ html.elem("style", "
.current {
font-weight: bold;
}
pre {
margin-top: 0px;
margin-bottom: 0px;
display: inline;
}
")
}