-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
66 lines (51 loc) · 1.46 KB
/
Justfile
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
root := justfile_directory()
# install/uninstall specific variables
data := data_directory() / 'typst' / 'packages'
namespace := 'preview'
version := '0.1.0'
name := 'mantodea'
spec := '@' + namespace + '/' + name + ':' + version
export TYPST_ROOT := root
# export TYPST_FONT_PATHS := root / 'assets' / 'fonts'
alias tt := typst-test
alias d := doc
alias t := test
alias u := update
# list recipes
[private]
@default:
just --list --unsorted --no-aliases
# run typst with the correct environment variables
typst *args:
typst {{ args }}
# run typst-test with the correct environment variables
typst-test *args:
typst-test {{ args }}
# generate the manual
doc cmd='compile':
typst {{ cmd }} docs/manual.typ docs/manual.pdf
# generate the examples
assets:
typst compile assets/examples/thumbnail.typ assets/thumbnail.png
oxipng --opt max assets/thumbnail.png
# run the test suite
test filter='':
typst-test run {{ filter }}
# update the tests
update filter='':
typst-test update {{ filter }}
# install the package locally
install: uninstall
mkdir -p {{ data / namespace / name }}
ln -s {{ root }} {{ data / namespace / name / version }}
# uninstall the package locally
uninstall:
rm -rf {{ data / namespace / name / version }}
# uninstall all versions of the package locally
purge:
rm -rf {{ data / namespace / name }}
# run the ci test suite
ci: assets install
typst-test run
typst compile --root template template/main.typ template/main.pdf
rm template/main.pdf