-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathjustfile
More file actions
72 lines (55 loc) · 1.88 KB
/
justfile
File metadata and controls
72 lines (55 loc) · 1.88 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
71
72
typst_flags := "--font-path fonts"
out_dir := "out"
build: build-pdf build-epub build-kindle
format:
typstfmt *.typ
clean:
rm -rf {{ out_dir }} _site
open-pdf:
mkdir -p {{ out_dir }}
typst compile {{ typst_flags }} --open HypermediaSystems.typ {{ out_dir }}/HypermediaSystems.pdf
build-pdf:
mkdir -p {{ out_dir }}
typst compile {{ typst_flags }} HypermediaSystems.typ {{ out_dir }}/HypermediaSystems.pdf
watch-pdf:
mkdir -p {{ out_dir }}
typst watch {{ typst_flags }} HypermediaSystems.typ {{ out_dir }}/HypermediaSystems.pdf
build-epub:
mkdir -p {{ out_dir }}
pandoc HypermediaSystems-ebook.typ -o {{ out_dir }}/HypermediaSystems.epub -M title="Hypermedia Systems" --css lib/epub.css --metadata-file lib/epub.yaml --epub-cover-image=images/cover.png
build-kindle: build-epub
ebook-convert {{ out_dir }}/HypermediaSystems.epub {{ out_dir }}/HypermediaSystems.azw3
typst-fonts:
typst fonts {{ typst_flags }}
build-html:
rm -rf _site
www/build_web.ts
cp www/{style.css,cover.css,color-customizer.js} _site
cp -r images _site/images
cp -r fonts _site/fonts
test -z ${DEV+x} && npx subfont -ir _site --no-fallbacks || true
serve:
#!/bin/sh
trap 'kill $py; kill $just' SIGINT
python3 -m http.server --directory _site & py=$!
watchexec -w . -i '_site/**/*' -r DEV=1 just build-html & just=$!
wait
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
# Run the Web 1.0 contact app (chapters 1-3)
run-web10:
cd code/ch03-web10 && uv run --with flask flask run
# Run the full htmx contact app (chapters 7-11)
run-full:
cd code/ch10-full && uv run --with flask flask run