This commit is contained in:
Matthieu Jolimaitre 2024-12-13 17:56:39 +01:00
commit a6929e88cf
12 changed files with 177 additions and 0 deletions

30
generate.sh Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/bash
set -e
cd "$(realpath "$(dirname "$0")")"
rm -fr './out'
mkdir -p './out'
(cd phoques; ls) | while read file
do
infos="$(echo "$file" | cut -d '.' -f 1)"
nam="$(echo "$infos" | cut -d '_' -f 1)"
ori="$(echo "$infos" | cut -d '_' -f 2)"
row="$(echo "$infos" | cut -d '_' -f 3)"
col="$(echo "$infos" | cut -d '_' -f 4)"
msg="$(echo "$infos" | cut -d '_' -f 5)"
echo "nam: '$nam', file: '$file', ori: '$ori', row: '$row', col: '$col', msg: '$msg'"
cat src/index.html \
| sed "s/FILE/$file/g" \
| sed "s/NAM/$nam/g" \
| sed "s/ORI/$ori/g" \
| sed "s/COL/$col/g" \
| sed "s/ROW/$row/g" \
| sed "s/MSG/$msg/g" \
> "out/$nam.html"
chromium --headless --print-to-pdf="out/$nam.pdf" "out/$nam.html"
done