diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 15:33:35 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 15:42:55 -0300 |
| commit | 4bdca090abc970b742f0653a02aa77d9adc95602 (patch) | |
| tree | 253a10e5617113dd7f44010dd57bf48e0ab34200 /docs/site/site.typ | |
| parent | 9b947777a2f693d10da1101c3eab4af3a5ef5a10 (diff) | |
| download | pardes-4bdca090abc970b742f0653a02aa77d9adc95602.tar.gz pardes-4bdca090abc970b742f0653a02aa77d9adc95602.zip | |
The guide's glossary is a definition list, and the site's tutor links its pointers into the guide
On the site the glossary is a <dl> of terms and meanings inside its
<details>, with no stray count, so a text browser reads each term then
its meaning. The tutor page links docs/typ/<chapter>.typ to that page,
each "-> Guide: <section>" to the guide's section of that title (read
from guide.typ's headings), and URLs; the tutor itself keeps its text.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'docs/site/site.typ')
| -rw-r--r-- | docs/site/site.typ | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/docs/site/site.typ b/docs/site/site.typ index f50a8d9b..47903d6e 100644 --- a/docs/site/site.typ +++ b/docs/site/site.typ @@ -254,11 +254,27 @@ /// chords it writes 1-2 (hold 1, click 2) become the docs' mouse glyphs, /// each with its hidden words, inside the preformatted block. #let tutor-text(t) = { + // the guide's sections by title, for "-> Guide: Modes, Config" + let guide-sections = (:) + for m in read("../typ/guide.typ").matches(regex("(?m)^= (.+?) <([a-z0-9-]+)>$")) { + guide-sections.insert(m.captures.at(0), m.captures.at(1)) + } + let tokens = regex("\\bB([123])\\b|\\b([123])-([123])\\b|docs/typ/([a-z]+)\\.typ|(?m)(?:^ -> Guide: )(.+)$|https://[^\\s)]+") let at = 0 - for m in t.matches(regex("\\bB([123])\\b|\\b([123])-([123])\\b")) { + for m in t.matches(tokens) { t.slice(at, m.start) - if m.captures.at(0) != none { btn("B" + m.captures.at(0)) } - else { chord("B" + m.captures.at(1), "B" + m.captures.at(2)) } + let (b, c1, c2, page, sections) = m.captures + if b != none { btn("B" + b) } + else if c1 != none { chord("B" + c1, "B" + c2) } + else if page != none { link(page + ".html", m.text) } + else if sections != none { + " -> Guide: " + sections.split(", ").map(name => { + let l = guide-sections.at(name, default: none) + if l != none { link("guide.html#" + l, name) } else { name } + }).join(", ") + } + else { link(m.text, m.text) } at = m.end } t.slice(at) |
