Created
November 12, 2016 19:19
-
-
Save tigerhawkvok/f91b5ae61ab8b9ccac6f3ca6e13473f4 to your computer and use it in GitHub Desktop.
Convert all HTML files into Markdown files in a given directory
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
#!/bin/bash | |
find . -type f -iregex .*\.html$ | while read line | |
do | |
printf 'Converting >>>%s<<<\n' "$line" | |
P_MD=${line%".html"}.markdown | |
pandoc --ignore-args -r html -w markdown < "${line}" | awk 'NR > 130' | sed '/<div class="site-info">/,$d' > "${P_MD}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment