Recursive directory parsing with Pandoc on Mac

前端 未结 2 2078
失恋的感觉
失恋的感觉 2020-12-30 15:41

I found this question which had an answer to the question of performing batch conversions with Pandoc, but it doesn\'t answer the question of how to make it recursive. I sti

2条回答
  •  感动是毒
    2020-12-30 16:33

    Just for the record: here is how I achieved the conversion of a bunch of HTML files to their Markdown equivalents:

    for file in $(ls *.html); do pandoc -f html -t markdown "${file}" -o "${file%html}md"; done
    

    When you have a look at the script code from the -o argument, you'll see it uses string manipulation to remove the existing html with the md file ending.

提交回复
热议问题