Markdown How To
How to convert all rtf to markdown
you will need unrtf
the +RTS .. -RTS is to increase haskell stack size
find folder/ -iname "*.RTF" -exec bash -c 'unrtf "$1" | pandoc +RTS -k128m -RTS -f html -t markdown --columns=200 -o "md/${1%.*}.md"; if [[ $? -ne 0 ]]; then echo $1; else touch -r "$1" "md/${1%.*}.md"; fi ' _ {} \;
How to convert all html to md
first create the same folder structure in "md"
find -type d -exec mkdir "md/{}" \;
Then
find folder/ -name "*.htm" -exec bash -c 'pandoc -f html "$1" -t markdown --columns=200 -o "md/${1%.htm}.md"; if [[ $? -ne 0 ]]; then echo $1; else touch -r "$1" "md/${1%.htm}.md"; fi ' _ {} \;
prints file name if an error and copies the original timestamp