#!/bin/bash for dir in $(ls .md) do for file in $(find .md/$dir) do if [[ "$file" == *.md ]] then newfile=$(sed "s/\.md\///; s/md/html/" <<< $file) echo "Saved "$file" to "$newfile pandoc -s --toc --toc-depth=6 \ --ascii -V toc-title:"Contents" \ -f markdown-smart $file -t html -o $newfile python update_targets.py $newfile fi if [[ "$file" == *.description ]] then newfile=$(sed "s/\.md\///" <<< $file) cp -vf $file $newfile fi done done