From c7d0d324bb06244aad2901464be25159a0b653ab Mon Sep 17 00:00:00 2001 From: David Allemang Date: Fri, 19 Jun 2026 15:35:04 -0400 Subject: [PATCH] wip docs rework --- content/00-index.typ | 4 +- content/01-core.typ | 4 -- content/02-interference.typ | 4 -- content/03-tileset.typ | 4 -- content/04-design.typ | 4 -- content/05-channels.typ | 4 -- content/06-transport.typ | 4 -- content/07-bulk.typ | 4 -- content/08-network.typ | 4 -- main.typ | 74 ++++++++++++++++++++++++++++++++----- 10 files changed, 65 insertions(+), 45 deletions(-) diff --git a/content/00-index.typ b/content/00-index.typ index 2321527..f3e813a 100644 --- a/content/00-index.typ +++ b/content/00-index.typ @@ -1,6 +1,4 @@ -#import "/docs.typ": docs-page, note, warn - -#show: docs-page("index.html", footer: none, header: none) +#let warn = block #title() diff --git a/content/01-core.typ b/content/01-core.typ index c41f1a9..3e20df4 100644 --- a/content/01-core.typ +++ b/content/01-core.typ @@ -1,7 +1,3 @@ -#import "/docs.typ": docs-page, note, tip, warn - -#show: docs-page("/core.html") - = Core Mechanics == Entity IDs diff --git a/content/02-interference.typ b/content/02-interference.typ index 43e0fb2..e9f3361 100644 --- a/content/02-interference.typ +++ b/content/02-interference.typ @@ -1,7 +1,3 @@ -#import "/docs.typ": docs-page, note, tip, warn - -#show: docs-page("interference.html") - = Interference == Other Entities diff --git a/content/03-tileset.typ b/content/03-tileset.typ index 59eea2e..7d1387a 100644 --- a/content/03-tileset.typ +++ b/content/03-tileset.typ @@ -1,7 +1,3 @@ -#import "/docs.typ": docs-page, note, tip, warn - -#show: docs-page("/tilesets.html") - = Global Ticking Order == Tilesets diff --git a/content/04-design.typ b/content/04-design.typ index 797a3f5..de60372 100644 --- a/content/04-design.typ +++ b/content/04-design.typ @@ -1,7 +1,3 @@ -#import "/docs.typ": docs-page, note, tip, warn - -#show: docs-page("/design-tips.html") - = Design Tips == Synchronization diff --git a/content/05-channels.typ b/content/05-channels.typ index e1ed5f9..705f6d8 100644 --- a/content/05-channels.typ +++ b/content/05-channels.typ @@ -1,7 +1,3 @@ -#import "/docs.typ": docs-page, note, tip, warn - -#show: docs-page("/channels.html") - = Channels == Static Channel Allocation diff --git a/content/06-transport.typ b/content/06-transport.typ index 31c075b..0808b06 100644 --- a/content/06-transport.typ +++ b/content/06-transport.typ @@ -1,7 +1,3 @@ -#import "/docs.typ": docs-page, note, tip, warn - -#show: docs-page("/transport-protocols.html") - = Transport Protocols == Mod 4 Binary diff --git a/content/07-bulk.typ b/content/07-bulk.typ index d99a06a..f29313c 100644 --- a/content/07-bulk.typ +++ b/content/07-bulk.typ @@ -1,7 +1,3 @@ -#import "/docs.typ": docs-page, note, tip, warn - -#show: docs-page("/bulk-transport.html") - = Bulk Transport == Tileable Receivers diff --git a/content/08-network.typ b/content/08-network.typ index a1f9ef6..86dd297 100644 --- a/content/08-network.typ +++ b/content/08-network.typ @@ -1,7 +1,3 @@ -#import "/docs.typ": docs-page, note, tip, warn - -#show: docs-page("/network-protocols.html") - = Network Protocols == Collision Prevention diff --git a/main.typ b/main.typ index 539597e..4d49eb7 100644 --- a/main.typ +++ b/main.typ @@ -1,14 +1,68 @@ #set heading(numbering: "1.1 -") #set document(title: [The EID Wireless Masterclass]) -#include "static/index.typ" +#asset("/style.css", read("static/style.css", encoding: none)) -#include "content/00-index.typ" -#include "content/01-core.typ" -#include "content/02-interference.typ" -#include "content/03-tileset.typ" -#include "content/04-design.typ" -#include "content/05-channels.typ" -#include "content/06-transport.typ" -#include "content/07-bulk.typ" -#include "content/08-network.typ" +#let html-title = state("html-title", context document.title) + +#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 html-title.get()) + }) + html.body({ body }) +})) + +#show document: it => { + html-title.update(old => context { + let top = query(selector(heading.where(level: 1, outlined: true)).within(it.location())).first(default: none) + if top != none { return [#top.body - #document.title] } else { return old } + }) + it +} + +#let doc(path, main) = rawdoc(path, { + html.header() + html.main(id: "main", main) + html.footer() +}) + +// #let doc(path, main) = rawdoc(path, ..args, 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({ +// html.header(context { +// let doc = query(document).first() +// par(link(doc.location(), doc.title)) +// +// let doc = query(selector(document).before(here())).last() +// let ch = query(selector(heading.where(level: 1, outlined: true)).within(doc.location())).first() +// outline(title: none, target: selector(heading).within(doc.location())) +// +// let next = query(selector(document).after(doc.location(), inclusive: false)).first(default: none) +// let prev = query(selector(document).before(doc.location(), inclusive: false)).last(default: none) +// }) +// html.main(id: "main", { main }) +// html.footer({}) +// }) +// })) + +#{ + 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") +}