Files
wireless-docs/main.typ
2026-06-19 18:50:10 -04:00

64 lines
2.1 KiB
Typst

#set heading(numbering: "1.1 -")
#set document(title: [The EID Wireless Masterclass])
#asset("/mojangles-ascii.woff2", read("static/mojangles-ascii.woff2", encoding: none))
#asset("/style.css", read("static/style.css", encoding: none))
#let index() = query(document).first()
#let chapter = state("chapter", context (doc: index(), top: none, loc: index().location()))
#let rawdoc(path, body) = document(path, 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")
html.link(rel: "stylesheet", href: "/style.css")
html.title(context document.title)
})
html.body({
body
})
}))
#show document: it => {
set document(title: context {
let top = query(selector(heading.where(level: 1, outlined: true)).within(it.location())).first(default: none)
chapter.update(old => (doc: it, top: top, loc: it.location()))
if top != none {
[#top.body - #it.title]
} else {
[#it.title]
}
})
it
}
#let doc(path, main) = rawdoc(path, {
html.header(context {
link(index().location(), title(index().title))
let target = selector(heading).within(chapter.get().loc).or(heading.where(level: 1))
outline(title: none, target: target)
})
html.main(id: "main", main)
html.footer(context {
let next = query(selector(heading.where(level: 1, outlined: true)).after(here())).first(default: none)
if next != none {
show outline.entry: it => [Next: #it]
outline(title: none, target: next.location())
}
})
})
#{
rawdoc("/index.html", include "content/00-index.typ")
doc("/core.html", include "content/01-core.typ")
doc("/interference.html", include "content/02-interference.typ")
doc("/tileset.html", include "content/03-tileset.typ")
doc("/design.html", include "content/04-design.typ")
doc("/channels.html", include "content/05-channels.typ")
doc("/transport.html", include "content/06-transport.typ")
doc("/bulk.html", include "content/07-bulk.typ")
doc("/network.html", include "content/08-network.typ")
}