Need help with markdown-preview-mode?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

ancane
138 Stars 20 Forks GNU General Public License v3.0 101 Commits 10 Opened issues

Description

Minor mode to preview markdown output as you save

Services available

!
?

Need anything else?

Contributors list

# 356,006
Scala
interpo...
scalaz
Emacs
45 commits
# 43,014
Emacs
markdow...
Markdow...
materia...
6 commits
# 27,959
emacs-l...
Emacs
elisp
zsh-com...
3 commits
# 374,878
HTML
play-fr...
Twitter
SQL
2 commits
# 16,625
Emacs
elisp
python3
melpa
2 commits
# 251,472
HTML
Python
1 commit
# 52,208
Emacs
emacs-l...
zettelk...
file-en...
1 commit
# 412,653
Python
Shell
D
Package...
1 commit
# 73,945
XML
Haskell
multi-f...
Visual ...
1 commit
# 393,059
Shell
unit-te...
mockito
Android
1 commit
# 274,087
circlec...
ruby-ge...
Racket
Common ...
1 commit

Markdown preview mode

MELPA Stable MELPA

Markdown preview in emacs features:

  • on save/idle preview update
  • scroll sync
  • custom/extra css and javascript
  • remote preview
  • multiple simultaneous previews

Install

  • package-install markdown-preview-mode
  • el-get-install markdown-preview-mode

Markdown processor

markdown-preview-mode
depends on
markdown-mode
for markdown processor, defined by
markdown-command
and it is markdown by default. Please, make sure it is in your
$PATH
.

Run

  • markdown-preview-mode
    - start mode and open preview window.
  • markdown-preview-open-browser
    - open preview window for current buffer.
  • markdown-preview-cleanup
    - cleanup running processes (close websocket and http servers).

Customize

  • customize-option markdown-command
    - change markdown processor; take a look at multimarkdown
  • customize-option
    browse-url-browser-function - change the browser.
  • customize-option markdown-preview-host
    - change http/websocket server address.
  • customize-option markdown-preview-ws-port
    - change websocket server port.
  • customize-option markdown-preview-http-port
    - change http server port.
  • customize-option markdown-preview-auto-open
    - change the way preview window is open.

Remote access

  • Customize
    markdown-preview-host
    to
    0.0.0.0
    .
  • Customize
    markdown-preview-http-host
    to
    0.0.0.0
    .
  • Set
    markdown-preview-auto-open
    to
    nil
    to disable window opening at remote emacs server.
  • Start
    markdown-preview-mode
    . Http link for preview will be printed to
    *Messages*
    buffer. If not - run
    markdown-preview-open-browser
    to get the link printed.
  • Setup 2 tunnels for
    0.0.0.0:7379
    and
    0.0.0.0:9000
    and then open preview link in local browser. Adjust tunnels according to your custom
    ws-port
    and
    http-port
    settings.

Extra css

Add extra css to default solarized dark theme

(add-to-list 'markdown-preview-stylesheets "https://raw.githubusercontent.com/richleland/pygments-css/master/emacs.css")

Override theme completely

(setq markdown-preview-stylesheets (list "http://thomasf.github.io/solarized-css/solarized-light.min.css"))

Extra javascript

Add MathJax

(add-to-list 'markdown-preview-javascript "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML")

async

(add-to-list 'markdown-preview-javascript '("http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML" . async))

Dependencies

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.