X-Git-Url: https://git.sthu.org/?p=vimconf.git;a=blobdiff_plain;f=macros.vim;h=cba6b844c37b1578f3d811bac9626e10b69e0e0a;hp=dd0b28dd605d6cfc81db27bbb59e35b7bc386ed7;hb=1efe691122790ce96466f1a05fc65de61b91c3cf;hpb=80e8ae230847c2d518a6274abdde5ec83117293c diff --git a/macros.vim b/macros.vim index dd0b28d..cba6b84 100644 --- a/macros.vim +++ b/macros.vim @@ -93,7 +93,23 @@ function RunPandoc() let cssopts = "-c pandoc.css" endif - execute ":!pandoc " . cssopts . " --self-contained --toc " . @% . " -o " . @% . ".html" + execute ":!pandoc " . cssopts . " --self-contained --toc '" . @% . "' -o '" . @% . "'.html" +endfunction + +function RunMarkdownpy(prog) + execute ":!" . a:prog . " " . @% . " > " . @% . ".html" +endfunction + +function RunMarkdown() + if executable("pandoc") + call RunPandoc() + elseif executable("markdown2") + call RunMarkdownpy("markdown2") + elseif executable("markdown_py") + call RunMarkdownpy("markdown_py") + else + echo "No markdown implementation found." + endif endfunction