her.esy.fun/engine/mk-html.sh

24 lines
430 B
Bash
Raw Normal View History

2021-05-09 10:11:33 +00:00
#!/usr/bin/env bash
set -eu
cd "$(git rev-parse --show-toplevel)" || exit 1
css="$1"
template="$2"
orgfile="$3"
htmlfile="$4"
tocoption=""
if grep -ie '^#+options:' "$orgfile" | grep 'toc:t'>/dev/null; then
tocoption="--toc"
fi
set -x
pandoc -c "$css" $tocoption \
--template="$template" \
--mathml \
--from org \
--to html5 \
--standalone \
$orgfile \
--output "$htmlfile"