Add a function to convert markdown files to org

This commit is contained in:
Andreas Zweili 2024-04-03 13:37:06 +02:00
parent cf7aaaa7f9
commit 7cc53c6f4d
1 changed files with 9 additions and 0 deletions

View File

@ -183,3 +183,12 @@
(turn-off-auto-fill)
(flyspell-mode)))
(add-hook 'org-after-todo-statistics-hook 'org-summary-todo)))
;; https://emacs.stackexchange.com/a/41619
(defun az-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"))))