summaryrefslogtreecommitdiff
path: root/docs/typ/README
blob: 175a7abb7a20036a10fe438b79739e514340accc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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.