summaryrefslogtreecommitdiff
path: root/docs/typ/README
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 21:05:07 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commitdb2a259a18b9247edc23b1128dcfda703858f120 (patch)
tree11a877ab15b552be8fe7d79a4f1402a54b9f3d58 /docs/typ/README
parent68dd567218505838814d73473460a0c0ff8e97b3 (diff)
downloadpardes-db2a259a18b9247edc23b1128dcfda703858f120.tar.gz
pardes-db2a259a18b9247edc23b1128dcfda703858f120.zip
A one-page A4 cheatsheet, the first file of a Typst docs corpus in docs/typ
docs/typ/cheatsheet.typ holds the facts as semantic calls (#key, #btn, #chord, #word, #tag, #addr, #file, #cmd, #doc); docs/typ/style.typ defines those once, drawing them for paged output and emitting HTML elements under --features html; docs/typ/cheatsheet-a4.typ is the page. `zig build cheatsheet` renders it when typst is on PATH. A config.zig test reads every .typ in docs/typ and fails when one names a builtin, key binding or default tag pardes no longer has. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'docs/typ/README')
-rw-r--r--docs/typ/README29
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/typ/README b/docs/typ/README
new file mode 100644
index 00000000..175a7abb
--- /dev/null
+++ b/docs/typ/README
@@ -0,0 +1,29 @@
+docs/typ: the Typst documentation corpus
+
+ style.typ the semantic elements (key btn chord word tag addr file
+ cmd doc), the palette and the topic ids; the only place
+ they are defined. Each element looks at target() and
+ draws itself for paged output or emits HTML elements.
+ cheatsheet.typ content: facts as markup and element calls, no layout.
+ Later topics (tags, fs, config, ...) go beside it as
+ their own content files, importing from style.typ.
+ cheatsheet-a4.typ
+ an output wrapper: page, type, headings, then #include
+ of the content. Future wrappers (book.typ, html.typ)
+ sit beside it; wrappers hold no facts.
+
+Build (from the repo root):
+
+ typst compile --ignore-system-fonts docs/typ/cheatsheet-a4.typ
+ zig build cheatsheet -Dplatform=tty --prefix DIR # DIR/share/doc/pardes/cheatsheet.pdf
+ typst compile --features html --format html docs/typ/cheatsheet.typ out.html
+
+Write #word("Name") for a builtin, #key("SPC f c") or #key("Ctrl-w") for
+keys, #tag("words", path: ...) for a default tagline, #doc("fs", section:
+"edit") to point at a topic. The unit test "docs/typ names only words,
+keys and default tags that exist" (src/config.zig) reads every .typ here
+and fails when one names a builtin, key binding or default tag that pardes
+no longer has. Only embedded fonts (Libertinus Serif, DejaVu Sans Mono),
+so output is the same on every machine. docs/typ/cheatsheet-a4.pdf is
+committed, as the other docs PDFs are; re-render it when the content
+changes.