-
Notifications
You must be signed in to change notification settings - Fork 16
/
justfile
54 lines (40 loc) · 1.17 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
typst_flags := "--font-path fonts"
build: build-pdf build-html
format:
typstfmt *.typ
clean:
find . -name '*.pdf' | xargs rm -rf
rm -rf _site
open-pdf:
typst compile {{ typst_flags }} --open HypermediaSystems.typ
build-pdf:
typst compile {{ typst_flags }} HypermediaSystems.typ
watch-pdf:
typst watch {{ typst_flags }} HypermediaSystems.typ
build-epub:
pandoc HypermediaSystems-ebook.typ -o HypermediaSystems.epub -M title="Hypermedia Systems" --css lib/epub.css --metadata-file lib/epub.yaml --epub-cover-image=images/cover.png
typst-fonts:
typst fonts {{ typst_flags }}
build-html:
rm -rf _site
www/build_web.ts
cp -r images _site/images
cp -r fonts _site/fonts
serve:
(trap 'kill 0' SIGINT; \
python3 -m http.server --directory _site & \
watchexec -w . -i '_site/**/*' -r just build-html & \
wait 0)
deploy:
netlify deploy -d _site --prod
diff-with-old:
#!/usr/bin/env bash
for f in $(find asciidoc/ -type f)
do
diff -u $f ../hypermedia-systems/book/$(basename $f)
done
find-overlong-code-lines:
find . -name "ch*" | xargs -I% awk ' \
/```/ { code = !code } \
/.{74}/ { if (code) print FILENAME ":" NR " " $0 } \
' % | less