feat: got a pipeline to convert the Minutes as well

This commit is contained in:
silver 2024-05-12 15:53:06 +01:00
parent 58451c8350
commit bd242e59cd
Signed by: silver
GPG key ID: 54E2C71918E93B74
11 changed files with 622 additions and 19 deletions

52
_scripts/format_minutes.sh Executable file
View 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 ../

View file

@ -0,0 +1,46 @@
# How many spaces of indentation do you want?
# Defaults to 2
# Optional
indentation = 2
# Optional
src = "./Committee"
# Optional
dest= "./Committee_html"
# html blocks you dont want to include in teh finished page
# Optional
html_void = []
[template]
# Templates are hjtml files that teh generated markdown is insereted into.
# There are several options on how this is carried out.
# enable templating
# Optional
enable = true
# Set a base template
# Optional
general = "../_Templates/committee.html"
# Priority of the _templates to use, first one to match a markdown file is used.
# An Empty array below is also valid
# general: use the general file specified above, if it exists.
# ajacent: check if there is a template file with the same name as the markdown file ajacent to the markdown file.
# ./src/exasmple.md
# ./src/example.html
# folder: a html file with the same name of the folder that the md resides in.
# ./src/blog/blog.html
# ./src/blog/post1.md
# default: use an inbuilt html5 template
# Optional
order = ["ajacent", "general", "folder", "default"]

View file

@ -0,0 +1,46 @@
# How many spaces of indentation do you want?
# Defaults to 2
# Optional
indentation = 2
# Optional
src = "./Council"
# Optional
dest= "./Council_html"
# html blocks you dont want to include in teh finished page
# Optional
html_void = []
[template]
# Templates are hjtml files that teh generated markdown is insereted into.
# There are several options on how this is carried out.
# enable templating
# Optional
enable = true
# Set a base template
# Optional
general = "../_Templates/committee.html"
# Priority of the _templates to use, first one to match a markdown file is used.
# An Empty array below is also valid
# general: use the general file specified above, if it exists.
# ajacent: check if there is a template file with the same name as the markdown file ajacent to the markdown file.
# ./src/exasmple.md
# ./src/example.html
# folder: a html file with the same name of the folder that the md resides in.
# ./src/blog/blog.html
# ./src/blog/post1.md
# default: use an inbuilt html5 template
# Optional
order = ["ajacent", "general", "folder", "default"]