multimodal

This commit is contained in:
2026-06-20 01:32:32 -04:00
parent 0e93efe76d
commit 7575c514c3
3 changed files with 111 additions and 76 deletions

45
lib.typ
View File

@@ -1,16 +1,39 @@
#let callout(kind: str, label: str, body) = html.section(class: kind + " callout", context {
let depth = counter(heading).at(here()).len() + 1
heading(
depth: depth,
outlined: false,
numbering: none,
label,
#let callout(kind: str, label: str, body) = context if target() == "html" {
html.section(class: kind + " callout", context {
let depth = counter(heading).at(here()).len() + 1
heading(
depth: depth,
outlined: false,
numbering: none,
label,
)
" "
body
})
} else {
let col = (
note: color.rgb("#0000cd"),
warn: color.rgb("#a52a2a"),
tip: color.rgb("#228b22"),
todo: color.rgb("#ff0000"),
).at(kind)
block(
fill: col.transparentize(85%),
stroke: (y: col),
width: 100%,
outset: (x: 1em, y: 0.5em),
spacing: par.spacing + 0.5em,
inset: (y: 0.5em),
{
set text(fill: col)
strong(label)
body
},
)
" "
body
})
}
#let note = callout.with(kind: "note", label: "Note:")
}#let note = callout.with(kind: "note", label: "Note:")
#let warn = callout.with(kind: "warn", label: "Warning:")
#let tip = callout.with(kind: "tip", label: "Tip:")
#let todo = callout.with(kind: "todo", label: "TODO:")