feat: got a pipeline to convert the Minutes as well
This commit is contained in:
parent
58451c8350
commit
bd242e59cd
11 changed files with 622 additions and 19 deletions
52
_scripts/format_minutes.sh
Executable file
52
_scripts/format_minutes.sh
Executable file
|
@ -0,0 +1,52 @@
|
|||
#!/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
|
||||
|
||||
wkhtmltopdf -q --enable-local-file-access --no-stop-slow-scripts "$stripped.html" "$output" 2> ../errors.log
|
||||
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 ../
|
Loading…
Add table
Add a link
Reference in a new issue