#!/bin/bash

# Creates html of the ipython notebooks automatically
# the .ipynb files you want to convert to html and run it.
OIFS="$IFS"
IFS=$'\n'

DIR=jupyter_notebooks/Tutorials/
mkdir temp_html
for nbname in `ls $DIR*.ipynb`; do
  jupyter nbconvert --to html --template full "$nbname"
  basenm=`basename "$nbname" .ipynb`
  newname=`echo $basenm | sed -e 's/ /_/g' | tr -d \(\),\-`
  mv "$DIR$basenm.html" "$DIR$newname.html"
  mv "$DIR$newname.html" temp_html
  echo "Created $basenm.html"
done

IFS="$OIFS"
