doc update

This commit is contained in:
Igor Shymko 2016-12-12 00:37:22 +02:00
parent 7634460a77
commit 8f4b2966c1
1 changed files with 25 additions and 40 deletions

View File

@ -4,39 +4,40 @@ Markdown preview mode
[![MELPA Stable](http://stable.melpa.org/packages/markdown-preview-mode-badge.svg)](http://stable.melpa.org/#/markdown-preview-mode) [![MELPA Stable](http://stable.melpa.org/packages/markdown-preview-mode-badge.svg)](http://stable.melpa.org/#/markdown-preview-mode)
[![MELPA](http://melpa.org/packages/markdown-preview-mode-badge.svg)](http://melpa.org/#/markdown-preview-mode) [![MELPA](http://melpa.org/packages/markdown-preview-mode-badge.svg)](http://melpa.org/#/markdown-preview-mode)
## Description Markdown preview in emacs features:
Opens a preview in a browser, updated upon buffer save.
Same preview window is valid across multiple markdown buffers. * on save/idle preview update
Scrolls browser window to keep your editing position visible. * scroll sync
* custom/extra css and javascript
* remote preview
* multiple simultaneous previews
## Usage ## Install
`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`. * `package-install markdown-preview-mode`
* `el-get-install markdown-preview-mode`
## Multimarkdown ## Run
In order to enable multimarkdown support, customize * `markdown-preview-mode` - start mode and open preview window.
`M-x customize-option` -> `markdown-command` variable. * `markdown-preview-open-browser` - open priview window for current buffer.
Look for `Markdown Command` which is set to `markdown` by default, * `markdown-preview-cleanup` - cleanup running processes (close websocket and http servers).
set to `multimarkdown` and make sure it's in your PATH.
## Browser ## Customize
In order to select preferred browser, customize * `customize-option markdown-command` - change markdown processor.
`M-x customize-option` -> `browse-url-browser-function` option. * `customize-option` [browse-url-browser-function](http://www.emacswiki.org/emacs/BrowseUrl) - select different browser.
Select your browser from `Value menu`. If it's not there, follow [EmacsWiki: Browse Url](http://www.emacswiki.org/emacs/BrowseUrl). * `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.
## Stylesheets ## Extra css
Default theme for preview is [Solarized-dark](http://thomasf.github.io/solarized-css/)
Extra css are added with:
### Add extra css to default solarized dark theme
```lisp ```lisp
(add-to-list 'markdown-preview-stylesheets "https://raw.githubusercontent.com/richleland/pygments-css/master/emacs.css") (add-to-list 'markdown-preview-stylesheets "https://raw.githubusercontent.com/richleland/pygments-css/master/emacs.css")
``` ```
Override theme completely with: ### Override theme completely with
```lisp ```lisp
(setq markdown-preview-stylesheets (list "http://thomasf.github.io/solarized-css/solarized-light.min.css")) (setq markdown-preview-stylesheets (list "http://thomasf.github.io/solarized-css/solarized-light.min.css"))
@ -44,35 +45,19 @@ Override theme completely with:
## Extra javascript ## Extra javascript
If you'd like to include additional javascript for the preview, add this to your init: ### Add MathJax
```lisp ```lisp
(add-to-list 'markdown-preview-javascript "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML") (add-to-list 'markdown-preview-javascript "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML")
``` ```
or, to make it async: ### async
```lisp ```lisp
(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))
``` ```
## 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 ## Dependencies
* [markdown-mode.el](https://github.com/defunkt/markdown-mode) * [markdown-mode.el](https://github.com/defunkt/markdown-mode)
* [websocket.el](https://github.com/ahyatt/emacs-websocket) * [websocket.el](https://github.com/ahyatt/emacs-websocket)
* [web-server.el](https://github.com/eschulte/emacs-web-server)
Makes use of `markdown-mode`, which already can transform markdown into html
and `websocket.el` to deliver html to browser.