You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Igor Shymko ce39428d39 favicon.ico 6 years ago
.gitignore Client javascript support: fixes #18 6 years ago
LICENSE Initial commit 8 years ago
README.md Client javascript support: fixes #18 6 years ago
favicon.ico favicon.ico 6 years ago
markdown-preview-mode.el favicon.ico 6 years ago
preview.html Client javascript support: fixes #18 6 years ago

README.md

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.

Theme

Solarized-dark

In order to change preview styling, run M-x customize-option -> markdown-preview-style and specify a URL to your favourite markdown css file.

Client 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.