2014-09-14 12:18:24 +03:00
Markdown preview mode
2014-09-13 15:19:34 +03:00
===========================
2016-01-10 15:01:10 +01:00
> **Markdown realtime preview minor mode**
2014-09-14 17:41:52 +03:00
## Description
Opens a preview in a browser, updated upon buffer save.
2016-01-10 15:01:10 +01:00
2014-10-23 22:59:45 +03:00
Same preview window is valid across multiple markdown buffers.
2014-10-24 18:12:04 +03:00
Scrolls browser window to keep your editing position visible.
2014-09-14 12:18:24 +03:00
2014-09-14 17:41:52 +03:00
## Dependencies
2014-09-14 12:18:24 +03:00
2016-01-10 15:01:10 +01:00
* [markdown-mode.el ](https://github.com/defunkt/markdown-mode )
* [websocket.el ](https://github.com/ahyatt/emacs-websocket )
2014-09-14 15:39:16 +03:00
2014-09-14 17:41:52 +03:00
Makes use of `markdown-mode` , which already can transform markdown into html
and `websocket.el` to deliver html to browser.
2014-09-15 08:30:13 +03:00
## Usage
2016-01-11 10:18:32 +02:00
*
2016-01-11 07:57:55 +09:00
`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` .
2014-09-14 17:41:52 +03:00
## 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
2016-01-11 07:57:55 +09:00
In order to select preferred browser, customize
2014-09-14 17:41:52 +03:00
`M-x customize-option` -> `browse-url-browser-function` option.
Select your browser from `Value menu` . If it's not there, follow [EmacsWiki: Browse Url ](http://www.emacswiki.org/emacs/BrowseUrl ).
## Theme
2014-09-15 08:30:13 +03:00
[Solarized-dark ](http://thomasf.github.io/solarized-css/ )
2014-09-14 18:06:33 +03:00
2014-09-15 22:39:14 +03:00
In order to change preview styling, run `M-x customize-option` -> `markdown-preview-style`
2014-10-03 22:40:26 +03:00
and specify a URL to your favourite markdown css file.
2014-09-15 22:39:14 +03:00
## Websocket port
Adjustable by `M-x customize-option` -> `markdown-preview-port` .
2014-10-27 11:35:20 +02:00
## el-get
* `M-x el-get-self-update`
* `M-x el-get-install` -> `markdown-preview-mode`