gvim: Increase to 53 lines
[vimconf.git] / macros.vim
index 1397f0f3f580b08d579c5c564cb5cebada048d98..73ce12864cca1fefa1aaf7c031349ed54bca252c 100644 (file)
@@ -90,10 +90,26 @@ function RunPandoc()
   " If pandoc.css exists, use it
   let cssopts = ""
   if findfile("pandoc.css", ".") == "pandoc.css"
-    let cssopts = "-c pandoc.css --self-contained"
+    let cssopts = "-c pandoc.css"
   endif
 
-  execute ":!pandoc " . cssopts . " --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