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: ```....```
.
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: ```....```
.
Here's an open-source web application built in Ruby to do this exact thing: https://word2md.com
Given that you asked this question on stackoverflow you're probably wanting a programmatic or command line solution for which I've included another answer.
However, an alternative solution might be to use the Writage Markdown plugin for Microsoft Word.
Writage turns Word into your Markdown WYSIWYG editor, so you will be able to open a Markdown file and edit it like you normally edit any document in Microsoft Word. Also it will be possible to save your Word document as a Markdown file without any other converters.
Under the covers, Writage uses Pandoc that you'll also need to install for this plugin to work.
It currently supports the following Markdown elements:
This might be the ideal solution for many end users as they won't need to install or run any command line tools - but rather just stick with what they are most familiar.
You can use Word to Markdown (Ruby Gem) to convert it in one step. Conversion can be as simple as:
It routes the document through LibreOffice, but also does it best to semantice headings based on their relative font size.
There's also a hosted version which would be as simple as drag-and-drop to convert.
If you're using Linux, try Pandoc (first convert .doc/.docx into html with LibreOffice or something and then run it).
On Windows (or if Pandoc doesn't work), you can try this website (online demo, you can download it): Markdownify
From here: