-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathjustfile
More file actions
35 lines (27 loc) · 1.13 KB
/
justfile
File metadata and controls
35 lines (27 loc) · 1.13 KB
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
version := "0.5.10"
commit_hash := `git rev-parse --short HEAD`
benchmark_file := "tests/benchmark-" + commit_hash + ".md"
benchmark_commands := `find examples/**/*.typ -type f | xargs -I {} printf "'typst compile --root . {}' "`
typst := "typst"
# copy typst package to local registry
local:
mkdir -p ~/.local/share/typst/packages/local/glossarium/{{version}}
cp -r * ~/.local/share/typst/packages/local/glossarium/{{version}}
build-examples:
find examples/**/*.typ -type f | xargs -I {} sh -c "echo ------ Compiling {} && time {{typst}} compile --root . {}"
test:
find tests/**/*.typ -type f | xargs -I {} sh -c "echo ------ Compiling {} && {{typst}} compile --root . {}"
write-test name:
mkdir -p tests/{{name}}
echo '#import "../../themes/default.typ": *' > tests/{{name}}/{{name}}.typ
# format typst code
fmt:
typstyle format-all
# benchmark using hyperfine
benchmark:
hyperfine --warmup 10 --prepare 'find examples/**/*.pdf -delete' --export-markdown {{benchmark_file}} {{benchmark_commands}}
# build advanced docs
docs:
{{typst}} compile advanced-docs/main.typ --root .
version:
{{typst}} --version