Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In vim, there is a plugin called vim-instant-markdown that displays markdown output; and it supports GFM!
In emacs, I know there is a markdown-mode that can be used when we write markdown, and we can preview the content use w3m. However I am wondering how to make it support GFM.

The author's tutorial seems to have mentioned that it has this function, but I didn't figure out how.

Since I still would like need w3m(not like vim-instant-markdown, which has no matured w3m-mode), I hope \C-c \C-c p to show the markdown output in a split window, is there any nice configuration?

share|improve this question
up vote 2 down vote accepted

Here is some plugins support realtime preview. I am using the first one.

share|improve this answer
    
Well, I like emacs-moz-markdown-viewer better since it seems easier to use. But it renders slowly(due to network issues?) and cannot be refreshed in firefox. Also it has problems when I use emacsclient, multiple markdown articles cannot be rendered well. And I failed to configure Warp:-( – Hongxu Chen Mar 22 '13 at 10:42
    
Now I realized that Warp conflicts with my personal w3m settings. I installed github-markup, but it still has no support for GFM, especially syntax highlight ;-( – Hongxu Chen Mar 22 '13 at 12:58
    
Seems that this question is silly since only with plugins can redcarpet parse GFM right. – Hongxu Chen Mar 23 '13 at 18:34

If you are on OSX Marked is fantastic and worth the cost. It supports a variety of preview formats and can perform syntax highlighting on the fly

I work in emacs and I have tried various markdown preview modes that work within emacs. None of them worked that well so I switched to Marked instead. I have Marked running next to emacs and every time I save in emacs, Marked updates automatically

Open buffer in Marked

Adding the function below to your .emacs is also useful to open the current markdown buffer in Marked

(defun markdown-preview-file ()
  "run Marked on the current file and revert the buffer"
  (interactive)
  (shell-command
   (format "open -a /Applications/Marked.app %s"
       (shell-quote-argument (buffer-file-name))))
)

Keybinding

(eval-after-load 'markdown-mode
  '(define-key markdown-mode-map (kbd "C-c r") 'markdown-preview-file))

Split Screen

I generally run emacs maximized with vertically split buffers. However when I want a Marked preview I need emacs to take up half the screen and Marked take up the other half. Divvy makes this process quick and easy. I have a binding for the left half of the screen, the right half, and maximized. Thus to go from maximized emacs to emacs and marked. Divvy is triggered with command-shift-space

Say I am working in emacs maximized and I want to preview a markdown buffer

cmd-shift-space l // shrink emacs to the left half of the screen using Divvy
C-c r             // launch Marked with the current buffer
cmd-shift-space r // shrink marked to the right half of the screen using Divvy

Note this Divvy shortcuts are ones that you need to setup yourself

share|improve this answer
1  
Hi and welcome to SU! This does not answer the question which was about an emacs mode. It would be better suited as a comment. – terdon Mar 21 '13 at 17:44
    
Fair enough. I use emacs and tried to set up a variety of different markdown previews inside emacs. None of them worked very well so now I just have Marked running next to emacs. It automatically updates when I save in emacs so that is good enough – Noah Mar 21 '13 at 17:47
    
Ah, now that is closer to an answer :). Why don't you edit the way you use it into your answer to make it clear that it can be used "with" emacs? – terdon Mar 21 '13 at 17:59
    
done, also added some useful .emacs configuration for emacs-Marked integration – Noah Mar 21 '13 at 18:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .