Emacs and markdown preview
Contents
App used: Marked 2
Reference: superuse.com
Code to include in .emacs
file:
;; Getting emacs to use the 'Marked' app
(defun markdown-preview-file ()
"run Marked on the current file and revert the buffer"
(interactive)
(shell-command
(format "open -a /Applications/Marked\\ 2.app %s"
(shell-quote-argument (buffer-file-name))))
)
Create a key-binding to open emacs markdown file in Marked:
(eval-after-load 'markdown-mode
'(define-key markdown-mode-map (kbd "C-x p") 'markdown-preview-file))
What’s cool is that as you write and save changes, they’re immediately updated in the Marked preview, with a dash at the most recent change
If you want to use different templates, you can get them at Marked 2 templates by Brett Terpstra