Markdown to .doc or .rtf
I'm interested in using a variation of Markdown for my work, but my target format is Word files (this is what my clients use, it's non-negotiable). Most implementations of Markdown would leave me with a circuitous route at best to get a Word file.
Perhaps more importantly, I'd want to be able to format things like footnotes/endnotes, which don't have any representation in Markdown or Multimarkdown, as far as I know.
Is there anything like this out there? Basically a flavor of Markdown oriented toward print rather than the screen?
Solution 1:
You can also use pandoc:
pandoc -f markdown -t docx file.md -o file.docx
One advantage compared to textutil
is that the output uses paragraph styles. You can also use styles from an existing file with --reference-docx file.docx
.
Solution 2:
John Gruber, one of the two inventors of Markdown, uses footnotes fairly extensively on Daring Fireball; to see his raw (pre-Markdown) formatting, append .text
to one of his urls, like this: http://daringfireball.net/2012/07/this_ipad_mini_thing.text.
As far as converting Markdown to RTF, textutil
is your friend. You can pipe the output of the Markdown.pl
command to textutil
like so:
/usr/local/bin/Markdown.pl | /usr/bin/textutil -stdin -stdout -format html -convert rtf | pbcopy # or whatever else you want to do with it
Instead of piping to pbcopy (which puts the rich text on the clipboard), you could >
it to a .rtf file, or whatever else your workflow dictates.