~gpanders/dotfiles

ref: c8e63bac959db19c138dcc3198a56514f0b444ff dotfiles/.vim/compiler/pandoc.vim -rw-r--r-- 884 bytes
c8e63bacGreg Anders Manage dotfiles directly in home directory 1 year, 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
" pandoc compiler file
" Compiler:         Pandoc
" Maintainer:       Greg Anders <greg@gpanders.com>
" Latest Revision:  2019-11-15

if exists('current_compiler')
  finish
endif
let current_compiler = 'pandoc'

let s:pandoc_data_dir = $HOME . '/.local/share/pandoc'

CompilerSet makeprg=pandoc\ -s\ --katex\ --metadata\ pagetitle='%:t:r'

if &filetype ==# 'markdown' && expand('%:t:r') ==? 'README' && filereadable(s:pandoc_data_dir . '/templates/github.html')
  " Use GFM for README files
  exe 'CompilerSet makeprg+=\ --from\ gfm\ --template=\"' . s:pandoc_data_dir . '/templates/github.html\"'
elseif filereadable(s:pandoc_data_dir . '/templates/default.html')
  " Use custom pandoc template for everything else
  exe 'CompilerSet makeprg+=\ --template=\"' . s:pandoc_data_dir . '/templates/default.html\"'
endif

CompilerSet makeprg+=\ -o\ %:r.html\ %:S
CompilerSet errorformat=