summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/typ/README4
-rw-r--r--docs/typ/book.typ3
-rw-r--r--docs/typ/cheatsheet-a4.pdf6
-rw-r--r--docs/typ/cheatsheet-a4.typ4
-rw-r--r--docs/typ/style.typ19
5 files changed, 22 insertions, 14 deletions
diff --git a/docs/typ/README b/docs/typ/README
index 509cec39..048e5d01 100644
--- a/docs/typ/README
+++ b/docs/typ/README
@@ -14,7 +14,7 @@ docs/typ: the Typst documentation corpus
an anchor named by its id, then the tutor.
Wrappers hold layout only, never facts.
-Chapters: `chapters` in style.typ lists them in reading order (guide,
+Chapters: `chapters` in style.typ lists them in reading order (guide, setup,
cheatsheet, scripting, reference, themes, building), each with its content file,
or none while it is not written (the outputs show a placeholder). To add
a topic, write docs/typ/<id>.typ and set its `file`. Wrappers include it
@@ -61,7 +61,7 @@ new function instead.
cmd(c) a shell line, as a block. #cmd("echo Save > $m/pane/$n/ctl")
doc(id, section:)
a pointer to a chapter, or a section of it by the label
- on its heading. Ids: guide cheatsheet scripting
+ on its heading. Ids: guide setup cheatsheet scripting
reference themes building (and the older tags fs
config keys detached, mapped in `topics`). A link in
the book and the HTML; on the A4 sheet, its name.
diff --git a/docs/typ/book.typ b/docs/typ/book.typ
index 803a65e2..a89b52cc 100644
--- a/docs/typ/book.typ
+++ b/docs/typ/book.typ
@@ -13,6 +13,9 @@
#show heading.where(level: 2): set block(above: 2em, below: 0.9em)
#show heading.where(level: 3): set block(above: 1.5em, below: 0.7em)
#show raw: set text(font: mono, size: 0.9em)
+#show raw.where(block: true): it => block(
+ width: 100%, fill: palette.tag-bg.transparentize(50%), radius: 2pt,
+ inset: (x: 6pt, y: 5pt), above: 0.9em, below: 0.9em, it)
#show heading: set text(fill: palette.tag-name)
#show heading.where(level: 1): it => {
pagebreak(weak: true)
diff --git a/docs/typ/cheatsheet-a4.pdf b/docs/typ/cheatsheet-a4.pdf
index 038c0077..52377d2f 100644
--- a/docs/typ/cheatsheet-a4.pdf
+++ b/docs/typ/cheatsheet-a4.pdf
@@ -1740,12 +1740,12 @@ x�}��Kq�?�U�X 94%MQKS��N�#Ԧ��Q�v��B�ˡ�h�Fk ������!
endstream
endobj
477 0 obj
-<</Creator(Typst 0.15.1)/ModDate(D:20260930235320-03'00)/CreationDate(D:20260930235320-03'00)>>
+<</Creator(Typst 0.15.1)/ModDate(D:20261001000615-03'00)/CreationDate(D:20261001000615-03'00)>>
endobj
478 0 obj
<</Length 996/Type/Metadata/Subtype/XML>>
stream
-<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="xmp-writer"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" ><xmp:CreatorTool>Typst 0.15.1</xmp:CreatorTool><dc:language><rdf:Bag><rdf:li>en</rdf:li></rdf:Bag></dc:language><xmp:ModifyDate>2026-09-30T23:53:20-03:00</xmp:ModifyDate><xmp:CreateDate>2026-09-30T23:53:20-03:00</xmp:CreateDate><xmpTPg:NPages>1</xmpTPg:NPages><dc:format>application/pdf</dc:format><xmpMM:InstanceID>shOu/M01zbWZ6Ipooaw4nw==</xmpMM:InstanceID><xmpMM:DocumentID>shOu/M01zbWZ6Ipooaw4nw==</xmpMM:DocumentID><xmpMM:RenditionClass>proof</xmpMM:RenditionClass><pdf:PDFVersion>1.7</pdf:PDFVersion></rdf:Description></rdf:RDF></x:xmpmeta><?xpacket end="r"?>
+<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="xmp-writer"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" ><xmp:CreatorTool>Typst 0.15.1</xmp:CreatorTool><dc:language><rdf:Bag><rdf:li>en</rdf:li></rdf:Bag></dc:language><xmp:ModifyDate>2026-10-01T00:06:15-03:00</xmp:ModifyDate><xmp:CreateDate>2026-10-01T00:06:15-03:00</xmp:CreateDate><xmpTPg:NPages>1</xmpTPg:NPages><dc:format>application/pdf</dc:format><xmpMM:InstanceID>Kbxl1G2nYZIjHwolHmzkUQ==</xmpMM:InstanceID><xmpMM:DocumentID>Kbxl1G2nYZIjHwolHmzkUQ==</xmpMM:DocumentID><xmpMM:RenditionClass>proof</xmpMM:RenditionClass><pdf:PDFVersion>1.7</pdf:PDFVersion></rdf:Description></rdf:RDF></x:xmpmeta><?xpacket end="r"?>
endstream
endobj
479 0 obj
@@ -2234,7 +2234,7 @@ xref
0000114755 00000 n
0000115828 00000 n
trailer
-<</Size 480/Root 479 0 R/Info 477 0 R/ID[(shOu/M01zbWZ6Ipooaw4nw==)(shOu/M01zbWZ6Ipooaw4nw==)]>>
+<</Size 480/Root 479 0 R/Info 477 0 R/ID[(Kbxl1G2nYZIjHwolHmzkUQ==)(Kbxl1G2nYZIjHwolHmzkUQ==)]>>
startxref
116015
%%EOF \ No newline at end of file
diff --git a/docs/typ/cheatsheet-a4.typ b/docs/typ/cheatsheet-a4.typ
index 5ae8b4be..6f22f723 100644
--- a/docs/typ/cheatsheet-a4.typ
+++ b/docs/typ/cheatsheet-a4.typ
@@ -2,7 +2,7 @@
// cheatsheet.typ and the elements' look in style.typ; this is page,
// type and headings only.
// typst compile --ignore-system-fonts docs/typ/cheatsheet-a4.typ
-#import "style.typ": palette, mono, pairs-density
+#import "style.typ": palette, mono, density
#set page(paper: "a4", fill: palette.paper, margin: (x: 9mm, y: 8mm), columns: 3)
#set columns(gutter: 4.5mm)
@@ -36,5 +36,5 @@
#show heading.where(level: 3): it => block(above: 0.6em, below: 0.35em, sticky: true,
text(size: 8.4pt, weight: "bold", fill: palette.grip, it.body))
-#pairs-density.update("tight")
+#density.update("tight")
#include "cheatsheet.typ"
diff --git a/docs/typ/style.typ b/docs/typ/style.typ
index e1bab27d..cf55ae86 100644
--- a/docs/typ/style.typ
+++ b/docs/typ/style.typ
@@ -27,6 +27,7 @@
/// keep working.
#let topics = (
guide: ("guide", none),
+ setup: ("setup", none),
cheatsheet: ("cheatsheet", none),
scripting: ("scripting", none),
reference: ("reference", none),
@@ -50,6 +51,7 @@
/// `ch-<id>`.
#let chapters = (
(id: "guide", title: "Guide", file: "guide.typ"),
+ (id: "setup", title: "Setting up your environment", file: "setup.typ"),
(id: "cheatsheet", title: "Cheatsheet", file: "cheatsheet.typ"),
(id: "scripting", title: "Scripting", file: "scripting.typ"),
(id: "reference", title: "Reference", file: "reference.typ"),
@@ -60,6 +62,10 @@
/// The tutor, shown as it is in the editor (`Tutor`), from the repo root.
#let tutor-path = "/src/tutor.txt"
+/// How much room tables and shell lines get: "roomy" (the book, the HTML)
+/// or "tight" (the A4 sheet sets it).
+#let density = state("density", "roomy")
+
#let html-out() = target() == "html"
#let span(class, body) = html.elem("span", attrs: (class: class), body)
#let m(s, fill: palette.ink) = text(font: mono, size: 0.92em, fill: fill, s)
@@ -159,9 +165,12 @@
/// A shell line.
#let cmd(c) = context if html-out() { raw(c, block: true, lang: "sh") } else {
+ let tight = density.get() == "tight"
block(
- width: 100%, inset: (left: 3pt, y: 1.2pt), spacing: 0.4em,
- stroke: (left: 1pt + palette.rule),
+ width: 100%, spacing: if tight { 0.4em } else { 0.9em },
+ inset: if tight { (left: 3pt, y: 1.2pt) } else { (left: 6pt, y: 3pt) },
+ stroke: (left: (if tight { 1pt } else { 1.5pt }) + palette.rule),
+ fill: if tight { none } else { palette.tag-bg.transparentize(50%) },
text(font: mono, size: 0.85em, fill: palette.ink, c),
)
}
@@ -187,17 +196,13 @@
}
}
-/// How roomy #pairs tables are: "roomy" (the book, the HTML) or "tight"
-/// (the A4 sheet sets it).
-#let pairs-density = state("pairs-density", "roomy")
-
/// Pairs: a thing and what it means, as a two-column table, key column
/// first, rows on alternating tints. `split: 2` sets the rows as that many
/// tables side by side (on paper; HTML gets one table).
#let pairs(split: 1, ..cells) = {
let rows = cells.pos().chunks(2)
context {
- let tight = pairs-density.get() == "tight"
+ let tight = density.get() == "tight"
let one(rows) = table(
columns: (auto, 1fr), stroke: none,
inset: if tight { (x: 2pt, y: 1.6pt) } else { (x: 7pt, y: 4pt) },