summaryrefslogtreecommitdiff
path: root/docs/typ/cheatsheet-a4.typ
blob: 6f22f723ddb63abf2861563fdfe70f9fbe541066 (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
30
31
32
33
34
35
36
37
38
39
40
// The printable cheatsheet: one A4 side, three columns. The facts are in
// 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, density

#set page(paper: "a4", fill: palette.paper, margin: (x: 9mm, y: 8mm), columns: 3)
#set columns(gutter: 4.5mm)
#set text(font: "Libertinus Serif", size: 8.6pt, fill: palette.ink, lang: "en")
#set par(leading: 0.42em, spacing: 0.55em, justify: false)
#set list(indent: 0pt, body-indent: 3pt, spacing: 0.42em, marker: text(fill: palette.grip)[▸])
#set terms(separator: h(0.5em), spacing: 0.42em, hanging-indent: 0.8em)
#set table(stroke: none, inset: (x: 1.5pt, y: 1.6pt))
#show raw: set text(font: mono, size: 0.92em)
#show strong: set text(fill: palette.tag-name)

// The title is the page's, not the content's: a level-1 heading in the
// content is not drawn here.
#show heading.where(level: 1): none
#place(top + left, float: true, scope: "parent",
  block(width: 100%, inset: (bottom: 2pt), stroke: (bottom: 0.6pt + palette.grip), {
    text(size: 15pt, weight: "bold", fill: palette.tag-name)[pardes]
    h(1fr)
    text(size: 9pt, style: "italic", fill: palette.tag-fg)[acme's tags and three buttons, helix's keys, terminals as panes, the editor as a 9P filesystem]
  }))
#show heading.where(level: 2): it => block(
  width: 100%, fill: palette.tag-bg, inset: (x: 2pt, y: 2pt), above: 0.75em, below: 0.4em,
  sticky: true,
  {
    box(fill: palette.col-grip, width: 0.55em, height: 0.75em, baseline: 0.1em)
    h(3pt)
    text(size: 9pt, weight: "bold", fill: palette.tag-name, it.body)
  },
)

#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))

#density.update("tight")
#include "cheatsheet.typ"