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

23 lines
411 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
2021-05-09 15:32:15 +00:00
template="$1"
orgfile="$2"
htmlfile="$3"
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" \
--mathml \
--from org \
--to html5 \
--standalone \
$orgfile \
--output "$htmlfile"