-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
70 lines (55 loc) · 1.8 KB
/
justfile
File metadata and controls
70 lines (55 loc) · 1.8 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
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
67
68
69
70
_default:
@just --list --justfile {{ justfile() }}
fonts_path := source_directory() / "fonts"
# install necessary fonts into 'fonts/' directory
[no-cd]
install-font zip_path:
#!/bin/sh
set -o errexit
set -o nounset
mkdir -p {{ fonts_path }}
cd {{ fonts_path }}
unzip ${OLDPWD}/{{ zip_path }}
typst_args := "--font-path " + fonts_path + " --root " + source_directory()
# generic typst command with additional font path
typst CMD *ARGS:
typst {{ CMD }} {{ typst_args }} {{ ARGS }}
# watch the testing file while developing
watch *ARGS: (typst "watch" "test.typ" ARGS)
# private print to avoid repeating myself
_print variation ext *ARGS: && (typst "compile" "tests/"+variation+"/test.typ" "variations/"+variation+ext ARGS)
@mkdir -p variations
# print a PDF logo
print-pdf variation="bw": (_print variation ".pdf")
# print a PNG logo
print-png variation="bw": (_print variation ".png" "--ppi 300")
# print a SVG logo
print-svg variation="bw": (_print variation ".svg")
# start a new variation
new-variation name: (tt "new" name)
cp tests/bw/test.typ tests/{{name}}/test.typ
# print all types of all variations
_print-all:
#!/bin/bash
set -o nounset
set -o errexit
for type in pdf png svg; do
for varfile in tests/*/; do
varname="$(basename "${varfile}")"
just print-${type} ${varname}
done
done
# make a draft release with all the current variations built and attached
release: _print-all
gh release create \
--draft \
--generate-notes \
"$(date +"%Y.%m.%d")" \
variations/*.png \
variations/*.pdf \
variations/*.svg
# generic tytanic command with our custom font-path and root
tt *args:
tt {{ typst_args }} {{ args }}
# run the tytanic tests to ensure no inadvertent logo changes
test: (tt "run")