#!/bin/bash
#
# Insert a couple extra entries into the header for the documentation page that
# is generated by the Markdown bindings for mlpack.
#
# $1: input
# $2: output

cat $1 | \
awk '

/^## mlpack overview$/,/<div id=".*" class="language-types" markdown="1">/ {
  if ($1 == "<div")
  {
    print $0;
  }
  next;
}

// {
  print $0;
}
' | sed 's|res/change_language.js|../../js/change_language.js|' |\
    sed 's/| `\*\*--\*\*` |$/| ***required*** |/' > $2;
