# This script converts a directory full of reStructuredText files into Markdown files.
# It uses pandoc to do the conversion.
#
# 1. Copy this script into the directory containing the .rst files
# 2. Run 'sh rst-to-md.sh'
# 3. Markdown files will be outputted with same filename as the original reStructuredText files
FILES=*.rst
for f in $FILES
do
filename="${f%.*}"
echo "Converting $f to $filename.md"
# Remove -s flag to generate fragment file instead (i.e. no header or footer)
`pandoc -s $f -t md -o $filename.md`
# Uncomment to delete the source .rst files.
# rm $f
done