feat: can now create the pdf's directly using `nix run .#handovers
`
This commit is contained in:
parent
527465ab07
commit
e42a2b221a
5 changed files with 55 additions and 13 deletions
37
_scripts/format_handovers.sh
Normal file
37
_scripts/format_handovers.sh
Normal file
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cd Committee
|
||||
cargo-bfom
|
||||
|
||||
# recursively parse _Handovers_html use wkhtmltopdf to convert to pdf
|
||||
cd _Handovers_html
|
||||
|
||||
out_folder="../_Handovers_pdf"
|
||||
rm -rf "$out_folder"
|
||||
for d in */ ; do
|
||||
# skip symlinks
|
||||
[ -L "''${d%/}" ] && continue
|
||||
# exclude teh template fodler
|
||||
if [[ $d == *"_Templates"* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# create output folder
|
||||
mkdir -p "$out_folder/$d"
|
||||
|
||||
# iterate the files
|
||||
for file in $d*.html; do
|
||||
if [ -f "$file" ]; then
|
||||
|
||||
# we need teh filename/path
|
||||
stripped=''${file/.html/""}
|
||||
|
||||
echo "$out_folder/$stripped.pdf"
|
||||
|
||||
# convert teh html to pdf
|
||||
wkhtmltopdf -q --enable-local-file-access --no-stop-slow-scripts "$stripped.html" "$out_folder/$stripped.pdf" 2> ./tmp.txt
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
cd ../
|
Loading…
Add table
Add a link
Reference in a new issue