big cleanup, minify

This commit is contained in:
David Allemang
2026-06-18 17:03:52 -04:00
parent c522ef877e
commit 50b6578364
27 changed files with 220 additions and 315 deletions

View File

@@ -1,9 +1,7 @@
#import "/docs.typ": docs-page, note, tip, warn #import "/docs.typ": docs-page, note, tip, warn
#show: docs-page.with( #set document(title: [Core Mechanics])
route: "/core/", #show: docs-page("/core.html")
title: [Core Mechanics],
)
#tip[ #tip[
Until version 26.2, this only works on multiplayer servers. See @singleplayer. Until version 26.2, this only works on multiplayer servers. See @singleplayer.

View File

@@ -1,9 +1,7 @@
#import "/docs.typ": docs-page, note, tip, warn #import "/docs.typ": docs-page, note, tip, warn
#show: docs-page.with( #set document(title: [Interference])
route: "/interference/", #show: docs-page("interference.html")
title: [Interference],
)
= Entity Spawns = Entity Spawns
= Single-Player (before 26.2) <singleplayer> = Single-Player (before 26.2) <singleplayer>

View File

@@ -1,9 +1,7 @@
#import "/docs.typ": docs-page, note, tip, warn #import "/docs.typ": docs-page, note, tip, warn
#show: docs-page.with( #set document(title: [Design Considerations])
route: "/design/", #show: docs-page("/design-tips.html")
title: [Design Considerations],
)
= Tilesets = Tilesets
== Binary vs Lexicographic == Binary vs Lexicographic

View File

@@ -1,12 +1,8 @@
#import "/docs.typ": docs-page, note, tip, warn #import "/docs.typ": docs-page, note, tip, warn
#show: docs-page.with( #set document(title: [Channels])
route: "/channels/", #show: docs-page("/channels.html")
title: [Channels],
)
= Static Channel Allocation = Static Channel Allocation
= Dynamic Channel Selectors = Dynamic Channel Selectors
= Looped Connections = Looped Connections

View File

@@ -1,9 +1,7 @@
#import "/docs.typ": docs-page, note, tip, warn #import "/docs.typ": docs-page, note, tip, warn
#show: docs-page.with( #set document(title: [Transport Protocols])
route: "/transport/", #show: docs-page("/transport-protocols.html")
title: [Transport Protocols],
)
= Mod 4 Binary = Mod 4 Binary
= Mod 2 Binary = Mod 2 Binary

View File

@@ -1,9 +1,7 @@
#import "/docs.typ": docs-page, note, tip, warn #import "/docs.typ": docs-page, note, tip, warn
#show: docs-page.with( #set document(title: [Bulk Transport])
route: "/bulk/", #show: docs-page("/bulk-transport.html")
title: [Bulk Transport],
)
= Tileable Receivers = Tileable Receivers
= Interleaved vs Sequential Channels = Interleaved vs Sequential Channels

View File

@@ -1,9 +1,7 @@
#import "/docs.typ": docs-page, note, tip, warn #import "/docs.typ": docs-page, note, tip, warn
#show: docs-page.with( #set document(title: [Network Protocols])
route: "/network/", #show: docs-page("/network-protocols.html")
title: [Network Protocols],
)
= Collision Prevention = Collision Prevention
== Checkbit == Checkbit

162
docs.typ
View File

@@ -1,86 +1,116 @@
#let site-title = [The Wireless Masterclass]
#import "/static/index.typ": stylesheets #import "/static/index.typ": stylesheets
#let docs-page(title: none, route: none, content) = { #let docs-page(path, header: auto, footer: auto) = main => document(path, html.html(
document( lang: "en_US",
route + "index.html", {
title: title, html.head({
html.html({ html.meta(charset: "utf-8")
html.head({ html.meta(name: "viewport", content: "width=device-width, initial-scale=1")
html.meta(charset: "utf-8") html.meta(name: "color-scheme", content: "dark light")
html.meta(name: "viewport", content: "width=device-width, initial-scale=1") for stylesheet in stylesheets { html.link(rel: "stylesheet", href: stylesheet) }
html.meta(name: "color-scheme", content: "dark light") html.title(context document.title)
for stylesheet in stylesheets { })
html.link(rel: "stylesheet", href: stylesheet) html.body({
} if (header != none) {
html.title(context title) html.header(if (header == auto) {
}) context {
html.body({ let doc = query(document).first()
html.a(href: "#main", [Skip to content]) link(doc.location(), doc.title)
}
// html.header([header]) title()
html.nav(aria-label: "Table of Contents", context { context {
html.ul({ let doc = query(selector(document).before(here())).last()
for doc in query(document) { outline(title: none, target: selector(heading).within(doc.location()))
html.li({ }
html.details(open: doc == query(selector(document).before(here())).last(), {
html.summary(link(doc.location(), doc.title))
html.ul(context for sec in query(selector(heading.where(level: 1)).within(doc.location())) {
html.li(link(
sec.location(),
[#counter(heading).display(at: sec.location()) #sec.body],
))
})
})
})
}
})
})
html.nav(aria-label: "Outline", context {
let doc = query(selector(document).before(here())).last()
show html.elem.where(tag: "nav"): it => it.body
show html.elem.where(tag: "ol"): it => html.elem("ul", it.body)
outline(title: none, depth: 2, target: selector(heading).within(doc.location()))
})
html.main(id: "main", {
html.h1(title)
content
html.nav(aria-label: "Page Navigation", context { html.nav(aria-label: "Page Navigation", context {
let prevs = query(selector(document).before(here())) html.ol(style: "list-style-type: none", {
let nexts = query(selector(document).after(here())) let nexts = query(selector(document).after(here()))
if (nexts.len() > 0) {
html.ul({
if (prevs.len() > 1) {
let prev = prevs.at(-2)
html.li( html.li(
aria-label: "Prev Page", link(nexts.at(0).location(), [Next: #nexts.at(0).title]),
link(prev.location(), prev.title),
) )
} }
if (nexts.len() > 0) { let prevs = query(selector(document).before(here()))
show html.elem.where(tag: "a"): it => it if (prevs.len() > 1) {
let next = nexts.at(0)
html.li( html.li(
aria-label: "Next Page", link(prevs.at(-2).location(), [Previous: #prevs.at(-1).title]),
link(next.location(), next.title),
) )
} }
}) })
}) })
} else {
header
}) })
// html.footer([footer]) divider()
}) }
}), html.main(main)
if (footer != none) {
divider()
html.footer({
if (footer == auto) {
html.nav(aria-label: "Page Navigation", context {
html.ol(style: "list-style-type: none", {
let nexts = query(selector(document).after(here()))
if (nexts.len() > 0) {
html.li(
link(nexts.at(0).location(), [Next: #nexts.at(0).title]),
)
}
let prevs = query(selector(document).before(here()))
if (prevs.len() > 1) {
html.li(
link(prevs.at(-2).location(), [Previous: #prevs.at(-1).title]),
)
}
})
})
} else {
footer
}
})
}
})
},
))
#let callout(kind: str, label: str, body) = html.section(class: kind + " callout", context {
let depth = counter(heading).at(here()).len() + 1
heading(
depth: depth,
outlined: false,
numbering: none,
label,
) )
} " "
body
})
#let callout(kind: str, body) = html.aside(aria-label: kind, body) #let note = callout.with(kind: "note", label: "Note:")
#let warn = callout.with(kind: "warn", label: "Warning:")
#let tip = callout.with(kind: "tip", label: "Tip:")
#let note = callout.with(kind: "note")
#let warn = callout.with(kind: "warn") #let callout(kind: str, label: str, body) = html.section(class: kind + " callout", context {
#let tip = callout.with(kind: "tip") let depth = counter(heading).at(here()).len() + 1
heading(
depth: depth,
outlined: false,
numbering: none,
label,
)
" "
body
})
#let note = callout.with(kind: "note", label: "Note:")
#let warn = callout.with(kind: "warn", label: "Warning:")
#let tip = callout.with(kind: "tip", label: "Tip:")

View File

@@ -1,20 +1,26 @@
#import "/docs.typ": docs-page, note, tip, warn #import "/docs.typ": docs-page, note
#show: docs-page.with( #set document(title: [The Wireless Masterclass])
route: "/", #show: docs-page("index.html", footer: none, header: none)
title: [The Wireless Masterclass],
)
= Entity ID Wireless Redstone <home> #title()
Welcome! Here, we will talk about Entity ID based wireless redstone (EID Wireless) for Minecraft Java Edition 1.14+. Everything I know about Entity ID based wireless redstone (EID Wireless) for Minecraft Java Edition 1.14+.
#note[ #note[ Until version 26.2, this only works on multiplayer servers. See @singleplayer. ]
Until version 26.2, this only works on multiplayer servers. See @singleplayer.
]
```python #context {
def foo(): heading(numbering: none, outlined: false)[Outline]
pass
```
html.nav({
html.ol(style: "list-style-type: none", {
for doc in query(selector(document).after(here())) {
show html.elem.where(tag: "nav"): it => it.body
html.li({
html.div(link(doc.location(), doc.title))
outline(title: none, depth: 1, target: selector(heading).within(doc.location()))
})
}
})
})
}

View File

@@ -1,12 +1,32 @@
#set heading(numbering: "1.") #set heading(numbering: "1.")
#include "static/index.typ" // #import "docs.typ": docs-page
#include "index.typ"
#include "content/core.typ" // #show: it => document("/index.html", it)
#include "content/interference.typ"
#include "content/design.typ" // #include "static/index.typ"
#include "content/channels.typ"
#include "content/transport.typ" // #docs-page(include "index.typ") <index>
#include "content/bulk.typ" // #docs-page(include "content/00-intro.typ")
#include "content/network.typ"
// #let docs-page(it) = document("index.html", {
// context {
// repr(query(selector(metadata).before(<front-matter>)))
// }
// it
// })
// #let docs-page(it) = context {
// }
#include "static/index.typ"
#include "index.typ"
#include "content/01-core.typ"
#include "content/02-interference.typ"
#include "content/03-design.typ"
#include "content/04-channels.typ"
#include "content/05-transport.typ"
#include "content/06-bulk.typ"
#include "content/07-network.typ"

Binary file not shown.

View File

@@ -1,19 +1,5 @@
#let fonts = ( #let fonts = (
(src: "/font/Minecraft-Seven_v2.woff2", name: "Mojangles", style: "normal", weight: 400), (src: "/font/minecraft-seven-ascii.woff2", name: "Mojangles", style: "normal", weight: 400, unicodes: "U+0000-007F"),
(src: "/font/LibertinusKeyboard-Regular.woff2", name: "Libertinus Keyboard", style: "normal", weight: 400),
(src: "/font/LibertinusMath-Regular.woff2", name: "Libertinus Math", style: "normal", weight: 400),
(src: "/font/LibertinusMono-Regular.woff2", name: "Libertinus Mono", style: "normal", weight: 400),
(src: "/font/LibertinusSans-Bold.woff2", name: "Libertinus Sans", style: "normal", weight: 700),
(src: "/font/LibertinusSans-Italic.woff2", name: "Libertinus Sans", style: "italic", weight: 400),
(src: "/font/LibertinusSans-Regular.woff2", name: "Libertinus Sans", style: "normal", weight: 400),
(src: "/font/LibertinusSerif-Bold.woff2", name: "Libertinus Serif", style: "normal", weight: 700),
(src: "/font/LibertinusSerif-BoldItalic.woff2", name: "Libertinus Serif", style: "italic", weight: 700),
(src: "/font/LibertinusSerif-Italic.woff2", name: "Libertinus Serif", style: "italic", weight: 400),
(src: "/font/LibertinusSerif-Regular.woff2", name: "Libertinus Serif", style: "normal", weight: 400),
(src: "/font/LibertinusSerif-Semibold.woff2", name: "Libertinus Serif", style: "normal", weight: 600),
(src: "/font/LibertinusSerif-SemiboldItalic.woff2", name: "Libertinus Serif", style: "italic", weight: 600),
(src: "/font/LibertinusSerifDisplay-Regular.woff2", name: "Libertinus Display", style: "normal", weight: 400),
(src: "/font/LibertinusSerifInitials-Regular.woff2", name: "Libertinus Initials", style: "normal", weight: 400),
) )
#asset( #asset(
@@ -25,6 +11,7 @@
"font-style:" + str(it.style) + ";" "font-style:" + str(it.style) + ";"
"font-weight:" + str(it.weight) + ";" "font-weight:" + str(it.weight) + ";"
"src: url(" + repr(it.src) + ");" "src: url(" + repr(it.src) + ");"
if ("unicodes" in it) { "unicode-range: " + str(it.unicodes) + ";" }
"}" "}"
}) })
.join(" "), .join(" "),

View File

@@ -1,217 +1,95 @@
:root { :root {
font-family: "Libertinus Serif", serif; font: 1rem / 1.5 sans-serif;
line-height: 1.3em;
} }
@media (prefers-color-scheme: light) { .tip {
:root { color: forestgreen;
--fg: black;
--bg: white;
}
[aria-label="note"] {
--fg: mediumblue;
}
[aria-label="warn"] {
--fg: brown;
}
[aria-label="tip"] {
--fg: forestgreen;
}
} }
@media (prefers-color-scheme: dark) { .warn {
:root { color: brown;
--fg: rgb(240 240 240);
--bg: rgb(30 30 30);
}
[aria-label="note"] {
--fg: cyan;
}
[aria-label="warn"] {
--fg: coral;
}
[aria-label="tip"] {
--fg: springgreen;
}
} }
nav, h1, h2, h3, h4, h5, h6 { .note {
font-family: "Mojangles", "monospace"; color: mediumblue;
}
math {
font-family: "Libertinus Math", math;
}
code {
font-family: "Libertinus Mono", monospace;
}
nav a {
text-decoration: none;
}
nav a:hover {
text-decoration: underline;
} }
a { a {
color: var(--fg); color: inherit;
} }
nav ul { a:hover {
list-style-type: none; color: LinkText;
padding-inline: 2ch;
} }
nav > ul { @media (prefers-color-scheme: dark) {
padding-inline: 0; .tip {
color: springgreen;
}
.warn {
color: coral;
}
.note {
color: cyan;
}
} }
nav li { h1, h2, h3, h4, h5, h6, nav {
margin-block: 0.5em; font-family: Mojangles, monospace;
} }
nav summary { ol {
display: block; padding-inline-start: 2ch;
} }
nav details summary:hover::after { nav > ol {
content: "⮞"; padding-inline-start: 0;
float: right;
} }
nav details[open] summary::after { ol ol {
content: "⮟"; margin-block-end: 1em;
float: right;
}
html {
display: flex;
justify-content: center;
min-height: 100%;
min-width: 100%;
} }
body { body {
display: grid; max-width: 800px;
grid-template-columns: 25ch 80ch 25ch; margin: 40px auto;
grid-template-rows: auto auto 1fr auto; padding: 0 10px;
grid-gap: 4ch;
width: auto;
min-height: 100%;
margin-inline: auto;
} }
body > a[href="#main"] { .callout {
position: absolute; margin: 1em -1em;
top: 0; padding: 0.5em 1em;
left: 0; background: rgb(from currentColor r g b / 5%);
border: solid currentColor;
border-width: 1px 0;
} }
body > a[href="#main"]:not(:focus) { hr {
transform: translateY(-2em); margin: 0 -1em;
} }
body > header { header p:has(+h1) {
grid-column: 1 / 3; margin-block-end: 0;
grid-row: 1; font-family: Mojangles, monospace;
} }
nav[aria-label="Table of Contents"] { header p + h1 {
grid-column: 1; margin-block-start: 0;
grid-row: 2;
} }
nav[aria-label="Outline"] { .callout h1,
grid-column: 3; .callout h2,
grid-row: 2; .callout h3,
} .callout h4,
.callout h5,
nav[aria-label="Outline"]:before { .callout h6,
content: "On this Page"; .callout h1 + p,
display: block; .callout h2 + p,
margin-block: 1em; .callout h3 + p,
} .callout h4 + p,
.callout h5 + p,
nav[aria-label="Page Navigation"] > ul { .callout h6 + p {
grid-column: 2; display: inline;
grid-row: 3;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 4pt;
}
nav[aria-label="Page Navigation"] > ul > li > a {
display: block;
text-align: center;
padding: 1em;
background: rgb(from var(--fg) r g b / 15%);
border: 1pt solid rgb(from var(--fg) r g b / 50%);
border-radius: 3pt;
}
li[aria-label="Next Page"] {
grid-column: 2;
}
li[aria-label="Prev Page"] {
grid-column: 1;
}
li[aria-label="Next Page"] > a:after {
content: "Next Page";
display: block;
font-size: small;
}
li[aria-label="Prev Page"] > a:after {
content: "Previous Page";
display: block;
font-size: small;
}
body > main {
grid-column: 2;
grid-row: 2;
}
body > footer {
grid-column: 1 / 4;
grid-row: 4;
}
aside {
border-block: 1pt solid rgba(from var(--fg) r g b / 50%);
background: rgba(from var(--fg) r g b / 15%);
color: var(--fg);
margin-block: 1em;
padding-block: 1ch;
padding-inline: 1em;
margin-inline: -1em;
}
aside[aria-label="note"]:before {
content: "Note:";
margin-inline-end: 1ch;
font-family: "Mojangles", monospace;
}
aside[aria-label="warn"]:before {
content: "Caution:";
margin-inline-end: 1ch;
font-family: "Mojangles", monospace;
}
aside[aria-label="tip"]:before {
content: "Tip:";
margin-inline-end: 1ch;
font-family: "Mojangles", monospace;
} }