~dricottone/vim-markdown-preview

2cee512ddca87818f0ec34246c9c794877cd9001 — JamshedVesuna 7 years ago 5563216
Support Markdown.pl
2 files changed, 20 insertions(+), 0 deletions(-)

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



@@ 140,6 141,17 @@ Example: Use GitHub flavoured markdown.
let vim_markdown_preview_github=1
```

<a name='perl'></a>
### The `vim_markdown_preview_perl` option
If you prefer to use John Gruber's [Markdown.pl](https://daringfireball.net/projects/markdown/) to render HTML, set the following flag:

Default: `0`

Example: Use Markdown.pl to render HTML.
```vim
let vim_markdown_preview_perl=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
@@ 21,6 21,10 @@ if !exists("g:vim_markdown_preview_github")
  let g:vim_markdown_preview_github = 0
endif

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

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


@@ 54,6 58,8 @@ function! Vim_Markdown_Preview()

  if g:vim_markdown_preview_github == 1
    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')
  else
    call system('markdown "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
  endif


@@ 101,6 107,8 @@ function! Vim_Markdown_Preview_Local()

  if g:vim_markdown_preview_github == 1
    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')
  else
    call system('markdown "' . b:curr_file . '" > vim-markdown-preview.html')
  endif