~dricottone/vim-markdown-preview

bdb4454ab0dfb29d8b84b2515d77d013bed564d8 — Jamshed Vesuna 7 years ago 74a43a8 + 56877f5
Merge pull request #62 from twsh/master

Adds support for Pandoc
2 files changed, 20 insertions(+), 0 deletions(-)

M README.md
M plugin/vim-markdown-preview.vim
M README.md => README.md +12 -0
@@ 14,6 14,7 @@ Vim Markdown Preview
    - [Temp File](#temp)
    - [Github Flavoured Markdown](#github)
    - [Markdown.pl](#perl)
    - [Pandoc](#pandoc)
    - [Use xdg-open](#xdg)
- [Behind the Scenes](#behind-the-scenes)



@@ 152,6 153,17 @@ Example: Use Markdown.pl to render HTML.
let vim_markdown_preview_perl=1
```

<a name='pandoc'></a>
### The `vim_markdown_preview_pandoc` option
If you prefer to use John MacFarlane's [Pandoc](http://pandoc.org/) to render HTML, set the following flag:

Default: `0`

Example: Use Pandoc to render HTML.
```vim
let vim_markdown_preview_pandoc=1
```

<a name='xdg'></a>
### The `vim_markdown_preview_use_xdg_open` option


M plugin/vim-markdown-preview.vim => plugin/vim-markdown-preview.vim +8 -0
@@ 46,6 46,10 @@ if !exists("g:vim_markdown_preview_perl")
  let g:vim_markdown_preview_perl = 0
endif

if !exists("g:vim_markdown_preview_pandoc")
  let g:vim_markdown_preview_pandoc = 0
endif

if !exists("g:vim_markdown_preview_use_xdg_open")
    let g:vim_markdown_preview_use_xdg_open = 0
endif


@@ 61,6 65,8 @@ function! Vim_Markdown_Preview()
    call system('grip "' . b:curr_file . '" --export /tmp/vim-markdown-preview.html --title vim-markdown-preview.html')
  elseif g:vim_markdown_preview_perl == 1
    call system('Markdown.pl "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
  elseif g:vim_markdown_preview_pandoc == 1
    call system('pandoc --smart --standalone "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
  else
    call system('markdown "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
  endif


@@ 113,6 119,8 @@ function! Vim_Markdown_Preview_Local()
    call system('grip "' . b:curr_file . '" --export vim-markdown-preview.html --title vim-markdown-preview.html')
  elseif g:vim_markdown_preview_perl == 1
    call system('Markdown.pl "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
  elseif g:vim_markdown_preview_pandoc == 1
    call system('pandoc --smart --standalone "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
  else
    call system('markdown "' . b:curr_file . '" > vim-markdown-preview.html')
  endif