refine outline

This commit is contained in:
2026-08-22 11:52:12 +09:00
parent 883dbebe88
commit 0269965627
+22 -5
View File
@@ -58,7 +58,7 @@
"0" * calc.max(0, width - s.len()) + s
}
#let make-palette(hue) = (
#let make_palette(hue) = (
cover-surface: color.oklch(97%, 0.01, hue),
callout-surface: color.oklch(97%, 0.02, hue),
callout-border: color.oklch(85%, 0.05, hue),
@@ -68,6 +68,18 @@
accent-faint: color.oklch(70%, 0.02, hue),
)
#let heading_text(it) = {
if it.has("text") {
it.text
} else if it.has("children") {
it.children.map(heading_text).join("")
} else if it == linebreak() {
" "
} else {
""
}
}
// ==================================================
// Body components
@@ -382,7 +394,7 @@
]
// Domain frame template function
#let domain_frame(bg_img_path: none, font_color: color-ink, chrome_color: color-ink-helper, content) = page(
#let domain_frame(title: "", bg_img_path: none, font_color: color-ink, chrome_color: color-ink-helper, content) = page(
background: place(
center + horizon,
if bg_img_path != none {
@@ -393,6 +405,11 @@
footer: footer_template(font_color: chrome_color),
)[
#set text(fill: font_color)
#heading(level: 1)[
#title
]
#content
]
@@ -481,7 +498,7 @@
))
// color palette
let cp = make-palette(main-hue)
let cp = make_palette(main-hue)
color-palette.update(m => (m + cp))
// document & page config
@@ -552,7 +569,7 @@
// outline config
set outline(
indent: 2em,
indent: 1em,
)
show outline: set par(leading: 1em)
@@ -562,7 +579,7 @@
)[
#grid(
columns: (1fr, auto),
it.indented(it.prefix(), it.body()), it.page(),
it.indented(it.prefix(), heading_text(it.body())), it.page(),
)
]