Skip to content

Instantly share code, notes, and snippets.

@jacobdanovitch
Created December 3, 2018 03:31
Show Gist options
  • Save jacobdanovitch/595c3b87a7a1714c1c1d2a9d23a45ace to your computer and use it in GitHub Desktop.
Save jacobdanovitch/595c3b87a7a1714c1c1d2a9d23a45ace to your computer and use it in GitHub Desktop.
Brief script that merges all Md and IPynb files into one HTML file with a ToC. Assumes alphabetical sorting. Made for organizing school notes.
NAME="$1"
echo "Creating file $NAME.html"
FILES=*.md
for f in $FILES
do
filename="${f%.*}"
outfile="${filename}.ipynb"
echo "Converting $f to $outfile"
`notedown $f > $outfile` # https://github.com/aaren/notedown
done
nbmerge *.ipynb > "$NAME.ipynb" # https://github.com/jbn/nbmerge
jupyter nbconvert "$NAME.ipynb" --to html_toc
rm "$NAME.ipynb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment