Quickly Convert (.rtf|.doc) Files to Markdown Syntax with PHP

后端 未结 7 1748
轮回少年
轮回少年 2021-01-29 18:50

I\'ve been manually converting articles into Markdown syntax for a few days now, and it\'s getting rather tedious. Some of these are 3 or 4 pages, italics and other emphasized t

7条回答
  •  抹茶落季
    2021-01-29 19:20

    If you happen to be on a mac, textutil does a good job of converting doc, docx, and rtf to html, and pandoc does a good job of converting the resulting html to markdown:

    $ textutil -convert html file.doc -stdout | pandoc -f html -t markdown -o file.md
    

    I have a script that I threw together a while back that tries to use textutil, pdf2html, and pandoc to convert whatever I throw at it to markdown.

提交回复
热议问题