How can doc/docx files be converted to markdown or structured text?

Lorenz Lo Sauer picture Lorenz Lo Sauer · May 5, 2013 · Viewed 52k times · Source

Is there a program or workflow to convert .doc or .docx files to Markdown or similar text?

PS: Ideally, I would welcome the option that a specific font (e.g. consolas) in the MS Word document will be rendered to text-code: ```....```.

Answer

massives picture massives · Oct 15, 2015

Pandoc supports conversion from docx to markdown directly:

pandoc -f docx -t markdown foo.docx -o foo.markdown

Several markdown formats are supported:

-t gfm (GitHub-Flavored Markdown)  
-t markdown_mmd (MultiMarkdown)  
-t markdown (pandoc’s extended Markdown)  
-t markdown_strict (original unextended Markdown)  
-t markdown_phpextra (PHP Markdown Extra)  
-t commonmark (CommonMark Markdown)