Go to file
2016-12-12 00:17:33 +02:00
.gitignore Client javascript support: fixes #18 2016-12-05 15:40:52 +02:00
favicon.ico favicon.ico 2016-12-07 18:41:09 +02:00
LICENSE Initial commit 2014-09-13 15:18:59 +03:00
markdown-preview-mode.el var renamed 2016-12-12 00:17:33 +02:00
preview.html Support multiple preview from same http port 2016-12-11 18:44:45 +02:00
README.md var renamed 2016-12-12 00:17:33 +02:00

Markdown preview mode

MELPA Stable MELPA

Description

Opens a preview in a browser, updated upon buffer save.

Same preview window is valid across multiple markdown buffers. Scrolls browser window to keep your editing position visible.

Usage

M-x markdown-preview-mode will open preview in a browser and will start markdown-mode if it's not yet running for current buffer. If you've closed the preview window, you can start it over with M-x markdown-preview-open-browser. All websockets will be cleaned up on emacs termination. If you'd like to perform cleanup manually run M-x markdown-preview-cleanup.

Multimarkdown

In order to enable multimarkdown support, customize M-x customize-option -> markdown-command variable. Look for Markdown Command which is set to markdown by default, set to multimarkdown and make sure it's in your PATH.

Browser

In order to select preferred browser, customize M-x customize-option -> browse-url-browser-function option. Select your browser from Value menu. If it's not there, follow EmacsWiki: Browse Url.

Stylesheets

Default theme for preview is Solarized-dark

Extra css are added with:

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

Override theme completely with:

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

Extra javascript

If you'd like to include additional javascript for the preview, add this to your init:

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

or, to make it async:

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

Websocket port

Adjustable by M-x customize-option -> markdown-preview-port.

Installation

Melpa

Melpa recipe is available, so markdown-preview-mode is just a package-install away!

el-get

  • M-x el-get-self-update
  • M-x el-get-install -> markdown-preview-mode

Dependencies

Makes use of markdown-mode, which already can transform markdown into html and websocket.el to deliver html to browser.