2024-06-14 09:20:43 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
PDFS=false
|
|
|
|
|
|
|
|
while getopts "p" flag
|
|
|
|
do
|
|
|
|
case "${flag}" in
|
|
|
|
p) PDFS=true;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Generating gallery images"
|
|
|
|
|
|
|
|
set -- ./gallery/example*.typ
|
|
|
|
cnt="$#"
|
|
|
|
i=1
|
|
|
|
for f
|
|
|
|
do
|
2024-10-30 15:19:01 +00:00
|
|
|
f2="${f%.typ}.png"
|
2024-06-14 09:20:43 +00:00
|
|
|
echo "($i/$cnt) $f -> $f2"
|
|
|
|
typst c --root ./ "$f" "$f2"
|
|
|
|
i=$((i+1))
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$PDFS" = true ]
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "Generating gallery PDFs"
|
|
|
|
|
2024-10-30 15:19:01 +00:00
|
|
|
files=$(find ./gallery -type f -name "*.typ")
|
|
|
|
cnt=$(echo "$files" | wc -l)
|
2024-06-14 09:20:43 +00:00
|
|
|
i=1
|
2024-10-30 15:19:01 +00:00
|
|
|
for f in $files
|
2024-06-14 09:20:43 +00:00
|
|
|
do
|
2024-10-30 15:19:01 +00:00
|
|
|
f2="${f%.typ}.pdf"
|
2024-06-14 09:20:43 +00:00
|
|
|
echo "($i/$cnt) $f -> $f2"
|
|
|
|
typst c --root ./ "$f" "$f2"
|
|
|
|
i=$((i+1))
|
|
|
|
done
|
|
|
|
fi
|