Created
June 2, 2011 00:29
-
-
Save wilmoore/1003675 to your computer and use it in GitHub Desktop.
convert markdown to reStructured Text (Thanks Doctrine2) - https://github.com/doctrine/dbal-documentation/blob/master/convert.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILES=`find -iname *.txt -print` | |
for FILE in $FILES | |
do | |
# replace the + to # chars | |
sed -i -r 's/^([+]{4})\s/#### /' $FILE | |
sed -i -r 's/^([+]{3})\s/### /' $FILE | |
sed -i -r 's/^([+]{2})\s/## /' $FILE | |
sed -i -r 's/^([+]{1})\s/# /' $FILE | |
sed -i -r 's/(\[php\])/<?php/' $FILE | |
# convert markdown to reStructured Text | |
pandoc -f markdown -t rst $FILE > ${FILE%.txt}.rst | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment