Markdown preview on OS X. Uses AppleScript to resize the windows.
Vim 8 is required for asynchronous rendering.
Xmark requires Homebrew and Google Chrome.
Using vim-plug:
Plug 'junegunn/vim-xmark', { 'do': 'make' }
:Xmark
command is added for Markdown files. After running the command, the
rendered content will be reloaded on the browser every time you save the file.
" Does not resize nor move the windows
:Xmark
" Vim on the left, browser on the right
:Xmark>
" On the left
:Xmark<
" On the top
:Xmark+
" On the bottom
:Xmark-
" Reload the page and resize the windows by saving it
:w
" Turn off Xmark
:Xmark!
If you see an error (e.g. osascript is not allowed assistive access
), make
sure that your terminal emulator (or MacVim) is in the list in System Preferences
-> Security & Privacy
-> Privacy
-> Accessibility
. (You can
drag and drop the application icon to the list.)
To activate MatjJax uncomment script tag at '.vim/bundle/vim-xmark/header.html'.
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML' async></script>
Adding mathematical formulae to a markdown document simply requires you to use the MathJax delimiters to start and end each formula as follows:
- For centered formulae, use \\[ and \\].
- For inline formulae, use \\( and \\).
Example
When \\(a \ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they are
\\[x = {-b m \sqrt{b^2-4ac} \over 2a}.\\]
- Resizing does not work if the terminal emulator is in fullscreen mode
- GitHub style CSS is based on github-markdown-css by Sindre Sorhus licensed under MIT
- Previous version of CSS was based on: https://gist.github.com/killercup/5917178
MIT