#!/bin/bash
#
# Usage:
#   ./run.sh <function name>

set -o nounset
set -o pipefail
set -o errexit

build() {
  local out_dir=_tmp
  mkdir -p $out_dir

  # NOTE: These .md files have tables, which are only supported by
  # Github-flavored markdown!  So you have to view them on Github, or we
  # should download a GFM tool.

  for src in *.md; do
    local dest=$out_dir/$(basename $src .md).html
    echo "$src -> $dest"
    markdown <$src >$dest
  done
}

"$@"