Skip to content

Instantly share code, notes, and snippets.

@imarko
Created October 25, 2020 01:25
Show Gist options
  • Save imarko/ec8f39550662fcd16908b7ec9d100e7e to your computer and use it in GitHub Desktop.
Save imarko/ec8f39550662fcd16908b7ec9d100e7e to your computer and use it in GitHub Desktop.
pandoc view mode
(define-derived-mode
pandoc-view-mode
org-mode
"pandoc-view-mode"
"View pandoc converted files in org-mode."
(erase-buffer)
(save-excursion
(call-process "pandoc" nil t nil "-torg" (buffer-file-name)))
(not-modified)
(read-only-mode t)
(view-mode t))
(add-to-list 'auto-mode-alist '("\\.docx\\'" . pandoc-view-mode))
(add-to-list 'auto-mode-alist '("\\.epub\\'" . pandoc-view-mode))
@imarko
Copy link
Author

imarko commented Oct 25, 2020

For more comprehensive epub support check out nov-mode or ereader mode. Both support images if I remember right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment