Skip to content

Instantly share code, notes, and snippets.

@jamescherti
Created March 3, 2025 17:15
Show Gist options
  • Save jamescherti/ab2a1c774af968656fffb27f2879c161 to your computer and use it in GitHub Desktop.
Save jamescherti/ab2a1c774af968656fffb27f2879c161 to your computer and use it in GitHub Desktop.
Emacs: Convert selected Markdown text to Org format using Pandoc
;;; region-markdown-to-org.el --- Emacs: Convert selected Markdown text to Org format using Pandoc -*- lexical-binding: t; -*-
;; Gits URL:
;; License: MIT
;; Author: James Cherti
(defun my-markdown-to-org (beg end)
"Convert selected Markdown text to Org format using Pandoc
BEG and END are the beginning and end of the selection."
(interactive "r")
(if (use-region-p)
(shell-command-on-region beg end "pandoc -f markdown -t org" t t)
(user-error "This command requires an active region")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment