sub-document rework

This commit is contained in:
David Allemang
2026-06-19 12:47:04 -04:00
parent 50b6578364
commit 50895cc79d
18 changed files with 122 additions and 148 deletions

View File

@@ -2,9 +2,16 @@
#import "/static/index.typ": stylesheets
#let chapter-title = state("chapter-title", context document.title)
#let docs-page(path, header: auto, footer: auto) = main => document(path, html.html(
lang: "en_US",
{
context chapter-title.update(old => context {
let head = query(heading.where(level: 1).after(here())).first(default: none)
return head.body
})
html.head({
html.meta(charset: "utf-8")
html.meta(name: "viewport", content: "width=device-width, initial-scale=1")
@@ -18,10 +25,9 @@
context {
let doc = query(document).first()
link(doc.location(), doc.title)
title(chapter-title.get())
}
title()
context {
let doc = query(selector(document).before(here())).last()
outline(title: none, target: selector(heading).within(doc.location()))
@@ -47,8 +53,6 @@
} else {
header
})
divider()
}
html.main(main)
if (footer != none) {