Last active
July 5, 2021 15:06
-
-
Save loochao/78366deac66000784b0be807c5a06b4f to your computer and use it in GitHub Desktop.
Convert dired marked files to md or pdf
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
| ;; https://stackoverflow.com/questions/22072773/batch-export-of-org-mode-files-from-the-command-line | |
| (defun dired-org-to-pdf () | |
| (interactive) | |
| (let ((files | |
| (if (eq major-mode 'dired-mode) | |
| (dired-get-marked-files) | |
| (let ((default-directory (read-directory-name "dir: "))) | |
| (mapcar #'expand-file-name | |
| (file-expand-wildcards "*.org")))))) | |
| (mapc | |
| (lambda (f) | |
| (with-current-buffer | |
| (find-file-noselect f) | |
| (org-latex-export-to-pdf))) | |
| files))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment