Skip to content
This repository was archived by the owner on Sep 27, 2025. It is now read-only.

Commit 84d555f

Browse files
chore: format with typstyle
1 parent e873028 commit 84d555f

File tree

21 files changed

+992
-398
lines changed

21 files changed

+992
-398
lines changed

doc/manual.typ

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@
2323
columns: (1fr, 1fr),
2424
align: (top + left, left),
2525
gutter: 1em,
26-
label[Typst code:]
27-
+ raw(lang: "typ", block: true, code),
26+
label[Typst code:] + raw(lang: "typ", block: true, code),
2827
label[Rendered result:]
2928
+ block(
3029
stroke: fg,
3130
radius: 0.5em,
3231
inset: 0.5em,
3332
width: 100%,
34-
normal(eval(
35-
mode: "markup",
36-
scope: dictionary(flow),
37-
code,
38-
))
33+
normal(
34+
eval(
35+
mode: "markup",
36+
scope: dictionary(flow),
37+
code,
38+
),
39+
),
3940
),
4041
)
4142
}
@@ -75,7 +76,7 @@ I can guarantee you it is worthy of your time.
7576
not as the ultimate goal to strive for.
7677
Feel free to take what you think is useful.
7778
Ideally, even introspect and improve on it.
78-
79+
7980
Learning is highly individual, and
8081
so are PKMs.
8182
Find a solution that fits *you*. :3
@@ -93,7 +94,7 @@ I can guarantee you it is worthy of your time.
9394
"#show: note.with(\n"
9495
" title: \"Super cool note title!\",\n"
9596
")"
96-
}
97+
},
9798
)
9899

99100
+ Start typing the actual note like any other typst document! uwu
@@ -204,16 +205,16 @@ a few layout hints, but
204205
does notably *not* set the font or font size.
205206

206207
#hint[
207-
Feel free to use this as base for your own templates!
208-
Chances are you want to forward passed arguments
209-
that aren't handled directly by your template to the `generic` driver,
210-
so something to the following show rule:
208+
Feel free to use this as base for your own templates!
209+
Chances are you want to forward passed arguments
210+
that aren't handled directly by your template to the `generic` driver,
211+
so something to the following show rule:
211212

212-
```typc
213-
show: generic.with(..args)
214-
```
213+
```typc
214+
show: generic.with(..args)
215+
```
215216

216-
The same idea works for all other templates listed here, too.
217+
The same idea works for all other templates listed here, too.
217218
]
218219

219220
==== `modern`
@@ -369,23 +370,28 @@ Hence, see these semantics merely as a suggestion.
369370
align: left,
370371
inset: 0.5em,
371372
table.header(
372-
[Name], [Fill], [$p in ...$], [Assigned to?], [Actionable by you?],
373+
[Name],
374+
[Fill],
375+
[$p in ...$],
376+
[Assigned to?],
377+
[Actionable by you?],
373378
),
374379
..(
375-
([Not started], " ", [${ 0 }$], [Nobody yet], [Yes]),
376-
([Urgent], "!", [$[ 0, 1 )$], [You], [Yes]),
377-
([In progress], ">", [$[ 0, 1 )$], [You], [Yes]),
378-
([Paused], ":", [$( 0, 1 )$], [You], [Yes]),
379-
([Completed], "x", [${ 1 }$], [Nobody], [No]),
380-
([Cancelled], "/", [$[ 0, 1 )$], [Nobody], [No]),
381-
([Blocked], "-", [$[ 0, 1 )$], [Not you], [No]),
382-
([Unknown], "?", [$[ 0, 1 ]$], [Maybe you], [Maybe]),
380+
([Not started], " ", [${ 0 }$], [Nobody yet], [Yes]),
381+
([Urgent], "!", [$[ 0, 1 )$], [You], [Yes]),
382+
([In progress], ">", [$[ 0, 1 )$], [You], [Yes]),
383+
([Paused], ":", [$( 0, 1 )$], [You], [Yes]),
384+
([Completed], "x", [${ 1 }$], [Nobody], [No]),
385+
([Cancelled], "/", [$[ 0, 1 )$], [Nobody], [No]),
386+
([Blocked], "-", [$[ 0, 1 )$], [Not you], [No]),
387+
([Unknown], "?", [$[ 0, 1 ]$], [Maybe you], [Maybe]),
383388
)
384-
.map(((name, fill, ..args)) => (
385-
name,
386-
raw("[" + fill + "]"),
387-
..args,
388-
)).join()
389+
.map(((name, fill, ..args)) => (
390+
name,
391+
raw("[" + fill + "]"),
392+
..args,
393+
))
394+
.join()
389395
)
390396

391397
==== Not started <not-started>
@@ -687,7 +693,8 @@ Here's an overview over them all:
687693
columns: 4,
688694
align: (right, left, left, left),
689695
table.header([Icon], [Short], [Long], [Accent]),
690-
..gfx.markers
696+
..gfx
697+
.markers
691698
.pairs()
692699
.map(((short, (accent, icon, long))) => (
693700
icon(invert: false),

doc/workflow.typ

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#import "/src/lib.typ" as flow: *
2-
#let accent = ("root", "vertex", "yield", "edge").zip(
3-
duality.values().slice(2)
4-
)
2+
#let accent = ("root", "vertex", "yield", "edge").zip(duality.values().slice(2))
53
#let steps = gradient-map(
64
("initialize", "gather", "extract", "condense", "refine"),
75
(duality.orange, duality.yellow, duality.green),
86
)
9-
#let bold = ("source", "target", "incoming", "outgoing").map(name => (name, strong))
7+
#let bold = ("source", "target", "incoming", "outgoing").map(name => (
8+
name,
9+
strong,
10+
))
1011
#show: note.with(
1112
title: "Multi's workflow",
1213
author: "MultisampledNight",
@@ -437,11 +438,9 @@ see @maintenance.
437438
#table(
438439
columns: 3,
439440
table.header[Urgency][Necessary today?][Assigned phase],
440-
c(rowspan: 2, $n in U$),
441-
[Yes], $n in P_d$,
442-
[No], $n in P_S$,
443-
$n in.not U$,
444-
[No], $n in P_L$,
441+
c(rowspan: 2, $n in U$), [Yes], $n in P_d$,
442+
[No], $n in P_S$, $n in.not U$,
443+
[No], $n in P_L$,
445444
)
446445

447446
== Maintenance <maintenance>
@@ -459,8 +458,8 @@ see @maintenance.
459458

460459
+ Reach:
461460
Transfer tasks that one
462-
wants to do and
463-
likely can do
461+
wants to do and
462+
likely can do
464463
the next few weeks
465464
from $P_L$ to $P_S$
466465

src/callout.typ

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
columns: (1.5em, 1fr),
1818
gutter: 0.5em,
1919
align: (right + horizon, left),
20-
icon(invert: false),
21-
body,
20+
icon(invert: false), body,
2221
)
2322
}
2423

src/cfg.typ

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@
1111
}
1212

1313
panic(
14-
"input `" + name + "` received invalid value; " +
15-
"expected: " + expected + "; " +
16-
"actual: `" + actual + "`"
14+
"input `"
15+
+ name
16+
+ "` received invalid value; "
17+
+ "expected: "
18+
+ expected
19+
+ "; "
20+
+ "actual: `"
21+
+ actual
22+
+ "`",
1723
)
1824
}
1925

@@ -35,15 +41,12 @@
3541
name,
3642
source,
3743
source in variants,
38-
"one of `" +
39-
variants
40-
.filter(var => var != none)
41-
.intersperse("`, `")
42-
.join()
43-
+ "`"
44-
+ if none in variants {
45-
" or left unspecified"
46-
},
44+
"one of `"
45+
+ variants.filter(var => var != none).intersperse("`, `").join()
46+
+ "`"
47+
+ if none in variants {
48+
" or left unspecified"
49+
},
4750
)
4851

4952
source
@@ -91,7 +94,7 @@
9194
"duality"
9295
} else {
9396
"bow"
94-
}
97+
},
9598
)
9699

97100
/// The name of the file the note is stored in.
@@ -125,8 +128,12 @@
125128
/// could have a lot of performance boost
126129
/// by using "text" instead.
127130
#let render = (_define("render").enum)(
128-
"all", "text", "info",
129-
"false", "true", none,
131+
"all",
132+
"text",
133+
"info",
134+
"false",
135+
"true",
136+
none,
130137
)
131138
#let render = _default(render, "all")
132139
#let render = _alias(render, ("true": "all", "false": "info"))

src/checkbox.typ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// returns `none` otherwise.
99
#let _find-fill(it) = {
1010
let source = hacks.reconstruct-text(it)
11-
11+
1212
let pattern = asset.data.regex.checkbox
1313
let checkbox = source.matches(regex("^" + pattern))
1414

src/gfx/draw.typ

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@
3939
(edge.x,) * 2
4040
}
4141

42-
let point = xs.zip(ys).map(
43-
((x, y)) => object +
44-
"." + to-anchor(y) +
45-
"-" + to-anchor(x)
46-
)
42+
let point = xs
43+
.zip(ys)
44+
.map(((x, y)) => object + "." + to-anchor(y) + "-" + to-anchor(x))
4745
point.insert(1, value)
4846
point
4947
}
@@ -57,15 +55,16 @@
5755
// the `cfg` specifies additional arguments for the `trans` function.
5856
#let _modifier(queue, cfg) = (queue: queue, cfg: cfg)
5957
#let _is-modifier(part) = (
60-
type(part) == dictionary and
61-
"queue" in part and
62-
"cfg" in part
58+
type(part) == dictionary and "queue" in part and "cfg" in part
6359
)
6460

6561
// Create a new branch. After all coordinates in this branch have been processed,
6662
// return to the node before it.
6763
// At the end of a branch, an arrow mark is always drawn.
68-
#let br(arrow: true, ..args) = _modifier(args.pos(), (branch: true, arrow: arrow))
64+
#let br(arrow: true, ..args) = _modifier(
65+
args.pos(),
66+
(branch: true, arrow: arrow),
67+
)
6968

7069
// Branches out to each given argument.
7170
#let all(..args) = {
@@ -127,7 +126,7 @@
127126
coord.insert(key, _make-concrete(last))
128127
}
129128
if "rel" in coord and "to" not in coord {
130-
coord.to = last;
129+
coord.to = last
131130
}
132131
coord
133132
} else {
@@ -219,15 +218,13 @@
219218

220219
let arrow = frame.cfg.at("arrow", default: true)
221220
let maybe-arrowhead = if (
222-
queue.len() == 0
223-
and arrow != false
221+
queue.len() == 0 and arrow != false
224222
) {
225223
// oh that means we want to draw an arrowhead
226224
// though if this is a modifier, that information needs to be propagated instead
227225

228226
if (
229-
_is-modifier(part)
230-
and "arrow" not in part.cfg
227+
_is-modifier(part) and "arrow" not in part.cfg
231228
) {
232229
part.cfg.arrow = arrow
233230
}
@@ -253,8 +250,7 @@
253250
// if this is a style modifier, store the style
254251
if "styles" in part.cfg {
255252
let next-styles = (
256-
styles-depth.at(-1, default: (:))
257-
+ part.cfg.styles
253+
styles-depth.at(-1, default: (:)) + part.cfg.styles
258254
)
259255
styles-depth.push(next-styles)
260256
}

src/gfx/maybe-stub.typ

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@
99

1010
#let cetz = if cfg.render == "all" {
1111
versioned((
12-
"0.12": { import "@preview/cetz:0.3.2"; cetz },
13-
"0.13": { import "@preview/cetz:0.3.3"; cetz },
12+
"0.12": {
13+
import "@preview/cetz:0.3.2"
14+
cetz
15+
},
16+
"0.13": {
17+
import "@preview/cetz:0.3.3"
18+
cetz
19+
},
1420
))
1521
} else {
1622
import "stub.typ"

0 commit comments

Comments
 (0)