set -xeuo pipefail

MYSELF=$(realpath --relative-to=. "$0")
MYDIR=$(dirname "$MYSELF")

INPUT=${1:-"$MYDIR/../guion-arch.md"}
OUTPUT=${2:-"$MYDIR/guion-arch.html"}

HTML_TEMPLATE=${HTML_TEMPLATE:-"$MYDIR/res/template.html"}

"${PANDOC_PATH:-pandoc}" \
  --template="$HTML_TEMPLATE" \
  --metadata title="${HTML_TITLE:-"Arch + i3"}" \
  -f gfm \
  \
  "$INPUT" -o "$OUTPUT"
