2023-11-20 18:00:13 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
2023-11-21 11:53:00 -06:00
|
|
|
dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
2023-11-20 18:00:13 -06:00
|
|
|
while true; do
|
2023-11-21 11:53:00 -06:00
|
|
|
#pandoc -f markdown-smart --data-dir . --template ${dir}/template.html -t html -o $dir/tmp.html $dir/index.md --metadata title="$(grep -m 1 -oP '(?<=^# ).*' $dir/index.md | cat)"
|
|
|
|
#chmod 777 $dir/../output
|
|
|
|
#sed -i "s/output here/$(sed 's/\//\\\//g' $dir/../output)/g" $dir/tmp.html
|
|
|
|
#sed "s/sourceCode /language-/g" $dir/tmp.html > $dir/index.html
|
|
|
|
#rm -f $dir/tmp.html
|
|
|
|
#sleep 1
|
|
|
|
# Can just run these 3 lines if index.html already exists
|
|
|
|
chmod 777 $dir/../output
|
|
|
|
sed -i "s/output here/$(sed 's/\//\\\//g' $dir/../output)/g" $dir/index.html
|
2023-11-20 18:00:13 -06:00
|
|
|
sleep 1
|
2023-11-21 11:53:00 -06:00
|
|
|
done
|