Files
wireless-docs/docs.typ
David Allemang c063b72c41 working on toc
2026-06-17 11:06:41 -04:00

51 lines
1.5 KiB
Typst

#import "/static/index.typ": stylesheets
#let docs-page(title: none, route: none, content) = {
document(
route + "index.html",
title: title,
html.html({
html.head({
html.meta(charset: "utf-8")
html.meta(name: "viewport", content: "width=device-width, initial-scale=1")
html.meta(name: "color-scheme", content: "dark light")
for stylesheet in stylesheets {
html.link(rel: "stylesheet", href: stylesheet)
}
html.title(context title)
})
html.body({
html.header(context {
html.h1(title)
})
})
html.main(content)
html.footer(context {
let prev = query(selector(document).before(here()))
let next = query(selector(document).after(here()))
html.nav(class: "panel", {
if (prev.len() > 1) {
link(prev.at(-2).location(), html.span(class: "go-prev", prev.at(-2).title))
}
if (next.len() > 0) {
link(next.at(0).location(), html.span(class: "go-next", next.at(0).title))
}
})
// html.nav(class: "panel", {
// let main = query(selector(document).before(<home>)).last()
// link(main.location(), html.span(class: "go-home", main.title))
// })
})
}),
)
}
#let callout(kind: str, body) = html.div(class: "callout " + kind, body)
#let note = callout.with(kind: "note")
#let warn = callout.with(kind: "caution")
#let tip = callout.with(kind: "tip")