Created
March 3, 2025 17:15
-
-
Save jamescherti/ab2a1c774af968656fffb27f2879c161 to your computer and use it in GitHub Desktop.
Emacs: Convert selected Markdown text to Org format using Pandoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; 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