2023-10-09 15:31:24 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-09-12 01:10:21 +00:00
|
|
|
set -e
|
|
|
|
|
2023-10-10 15:13:11 +00:00
|
|
|
dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
|
|
|
find . -name "*.md" | while read -r item; do
|
|
|
|
item="${item%.*}"
|
|
|
|
echo "Currently processing ${item}"
|
|
|
|
pandoc -f markdown-smart --data-dir . --template ${dir}/template.html -t html -o ${item}.html ${item}.md --metadata title="$(grep -m 1 -oP '(?<=^# ).*' ${item}.md | cat)"
|
2023-11-20 17:08:03 +00:00
|
|
|
sed -i s/sourceCode\ /language-/g ${item}.html
|
2024-03-13 01:45:03 +00:00
|
|
|
python3 $dir/regex-chicanery.py ${item}.html
|
2023-09-12 01:10:21 +00:00
|
|
|
done
|