Converts GitHub-flavored Markdown to a Word document
While Markdown is the lingua franca of the development world, the rest of the world still sees Word documents as the de facto way to share text. Rather than try to convert the rest of the world, just work in Markdown, and convert things to Word before sending to others.
You can see it in action with this demo
Add the following to your project's Gemfile:
gem 'markdown_to_word'
MarkdownToWord.convert("# Some Markdown").path
=> "/path/to/the/file.docx"
m2w "# Some Markdown" > foo.docx
(Returns the contents of the docx to STDOUT)
- We use HTML Pipeline to convert the Markdown to HTML
- We use HTML to Word to convert the HTML to a Word doc
While Pandoc is great on the desktop, it's hard to install on servers or use on Heroku.
See Word to Markdown.