2021-05-09 10:11:33 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
cd "$(git rev-parse --show-toplevel)" || exit 1
|
2021-05-09 15:32:15 +00:00
|
|
|
template="$1"
|
2021-09-20 12:09:52 +00:00
|
|
|
luafilter="$2"
|
2021-09-29 22:43:40 +00:00
|
|
|
luafilterimg="$3"
|
2021-10-03 20:20:41 +00:00
|
|
|
luametas="$4"
|
|
|
|
orgfile="$5"
|
|
|
|
htmlfile="$6"
|
2021-05-09 10:11:33 +00:00
|
|
|
|
|
|
|
tocoption=""
|
|
|
|
if grep -ie '^#+options:' "$orgfile" | grep 'toc:t'>/dev/null; then
|
|
|
|
tocoption="--toc"
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -x
|
2021-05-09 15:32:15 +00:00
|
|
|
pandoc $tocoption \
|
2021-05-09 10:11:33 +00:00
|
|
|
--template="$template" \
|
2021-09-20 12:09:52 +00:00
|
|
|
--lua-filter="$luafilter" \
|
2021-09-29 22:43:40 +00:00
|
|
|
--lua-filter="$luafilterimg" \
|
2021-10-03 20:20:41 +00:00
|
|
|
--lua-filter="$luametas" \
|
2021-05-09 10:11:33 +00:00
|
|
|
--mathml \
|
|
|
|
--from org \
|
|
|
|
--to html5 \
|
|
|
|
--standalone \
|
|
|
|
$orgfile \
|
|
|
|
--output "$htmlfile"
|