2024-05-12 14:53:06 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
|
|
# delete to allow for a full rebuild without any ghost artifacts
|
|
|
|
rm -rf "Minutes_pdf"
|
|
|
|
|
|
|
|
cd Minutes
|
|
|
|
|
|
|
|
for year in */ ; do
|
|
|
|
# skip symlinks
|
|
|
|
[ -L "''${year%/}" ] && continue
|
|
|
|
# exclude teh template fodler
|
|
|
|
if [[ $year == *"_Templates"* ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
# go into the year folder
|
|
|
|
cd $year
|
|
|
|
|
|
|
|
# convert the Committee ones first
|
|
|
|
|
|
|
|
cp ../../_scripts/md_toml/_Minutes-Committee.md.toml ./.md.toml
|
|
|
|
cargo-bfom
|
|
|
|
|
|
|
|
cp ../../_scripts/md_toml/_Minutes-Council.md.toml ./.md.toml
|
|
|
|
cargo-bfom
|
|
|
|
|
|
|
|
mkdir -p "../../Minutes_pdf/$year/Committee"
|
|
|
|
mkdir -p "../../Minutes_pdf/$year/Council"
|
|
|
|
|
|
|
|
# iterate the files
|
|
|
|
for file in {Committee,Council}_html/*.html; do
|
|
|
|
if [ -f "$file" ]; then
|
|
|
|
|
|
|
|
# we need teh filename/path
|
|
|
|
stripped=''${file/.html/""}
|
|
|
|
|
|
|
|
output="../../Minutes_pdf/$year${stripped/_html/""}.pdf"
|
|
|
|
|
|
|
|
echo $output
|
|
|
|
|
2024-05-12 15:03:01 +00:00
|
|
|
wkhtmltopdf -q --enable-local-file-access --no-stop-slow-scripts "$stripped.html" "$output" 2>> ../errors.log
|
2024-05-12 14:53:06 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# cleanup
|
|
|
|
rm -f .md.toml
|
|
|
|
# the temp folders where teh html was created, leaving these could cause ghost artifacts
|
|
|
|
rm -rf ./*_html
|
|
|
|
done
|
|
|
|
|
|
|
|
cd ../
|