Charles Choi has a handy tip on converting from Mardown to Org. My first thought was that I don’t care about this because I write everything in Org Mode and never use Markdown. But then it occurred to me that the same is doubtless true of Choi as well and that someday I’m going to want to import a Markdown document into Org.
Choi’s basic process is to cut and paste the Markdown document into Emacs and then use Pandoc to convert from Markdown to Org. But there’s a problem. Pandoc will wrap lines while Choi likes to keep paragraphs as a single line. I do that too because it’s how visual line mode works. The excellent Pandoc has us covered, of course. You need only specify --wrap=preserve
to get the desired behavior.
With that bit of wisdom, Choi gives us a handy function that will convert the Markdown in the current region to Org. It’s probably worthwhile adding his short function to your init.el
just so you’ll have it when the need arrives. If you don’t like cluttering up your init.el
with things you’re not actively using, at least bookmark his post so you’ll know what to do when the need arises.