multimodal
This commit is contained in:
45
lib.typ
45
lib.typ
@@ -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:")
|
||||
|
||||
Reference in New Issue
Block a user