-
-
Save ejonasson/27c134e7239f5d37e8ec to your computer and use it in GitHub Desktop.
Turns all HTML docs in a directory into Markdown Files
This file contains hidden or 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
# Based of md_to_rst.sh script written by https://gist.github.com/hugorodgerbrown | |
# This script was created to convert a directory full | |
# of html files into md equivalents. It uses | |
# pandoc to do the conversion. | |
# | |
# 1. Install pandoc from http://johnmacfarlane.net/pandoc/ | |
# 2. Copy this script into the directory containing the .html files | |
# 3. Ensure that the script has execute permissions | |
# 4. Run the script | |
# | |
# By default this will keep the original .html file | |
FILES=*.html | |
for f in $FILES | |
do | |
# extension="${f##*.}" | |
filename="${f%.*}" | |
echo "Converting $f to $filename.md" | |
`pandoc $f -t markdown -o ../mds/$filename.md` | |
# uncomment this line to delete the source file. | |
# rm $f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment