A simple ST2 plugin to help you preview your markdown files quickly in you web browser.
Markdown can be converted to Html sing different parsers:
- builtin python-markdown2 parser (default)
- github markdown API
- pandoc, a universal document converter
If you have the ST2 LiveReload plugin, your browser will autorefresh the display when you save your file :)
NOTE: If you choose the GitHub API for conversion (set parser: github in your settings), your code will be sent through https to github for live conversion. You'll have Github flavored markdown, syntax highlighting and EMOJI support for free ❤️ 🎁
- you should use sublime package manager
- use
cmd+shift+P
thenPackage Control: Install Package
- look for
Markdown Preview
and install it. - If you are going to use Pandoc to process markdown, install it before.
pandoc
executable should be on your PATH.
-
use
cmd+shift+P
thenMarkdown Preview
to launch a preview -
or bind some key in your user key binding, using a line like this one:
{ "keys": ["alt+m"], "command": "markdown_preview", "args": {"target": "browser"} },
-
once converted a first time, the output HTML will be updated on each file save (with LiveReload plugin)
-
to use Github API for conversion, set plugin settings.
{ "parser": "github", }
-
to use pandoc for conversion, set plugin settings.
args
are Pandoc-specific parameters. To change default html template, which is used for conversion, refer totemplates/pandoc.html5
file.{ "parser": "pandoc", "pandoc": { "args": ["-t", "html5", "-s", "--highlight-style", "pygments", "--mathml"] } }
- python-markdown2 for markdown parsing OR the GitHub markdown API.
The code is available at github https://github.com/revolunet/sublimetext-markdown-preview under MIT licence : http://revolunet.mit-license.org