31

I've got hundreds of personal notes stored as files in Markdown format, after several years using the VoodooPad personal wiki software for OS X.

There's plenty of information available for exporting from org mode to Markdown, but is there an easy way to convert Markdown to org mode format?


Update

Thanks to user2619203's answer and this answer to a question on batch processing of files with Pandoc I was able to convert four hundred Markdown files into org mode format in just a few minutes.

The solution was to export the VoodooPad document to a folder as text (File > Export Document > Export as Text...). Then call pandoc via the find command to convert them all in one go:

$ find . -name \*.txt -type f -exec pandoc  -f markdown -t org -o {}.org {} \; 

The converted .org files I've looked at are formatted beautifully -- even the codeblocks and format styling. Thank-you, user2619203.

To simply convert one file from Markdown to Org the following command can be used:

pandoc -f markdown -t org -o newfile.org original-file.markdown

Here is a link to the Pandoc documentation

  • Since you are using pandoc you might be interested in pandoc-mode for emacs, its pretty neat – Iqbal Ansari Sep 10 '15 at 13:55
29

Pandoc can convert from markdown to org-mode.

0

Here is an emacs function that will convert the current buffer's content to orgmode format using pandoc:

  (defun markdown-convert-buffer-to-org ()
    "Convert the current buffer's content from markdown to orgmode format and save it with the current buffer's file name but with .org extension."
    (interactive)
    (shell-command-on-region (point-min) (point-max)
                             (format "pandoc -f markdown -t org -o %s"
                                     (concat (file-name-sans-extension (buffer-file-name)) ".org"))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.