From 9a7aebc98d05843092d54ef4219150edf80d2868 Mon Sep 17 00:00:00 2001 From: Matti Pastell Date: Wed, 20 Apr 2016 17:04:38 +0300 Subject: [PATCH] Exception handling for missing pandoc --- src/pandoc.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pandoc.jl b/src/pandoc.jl index df833ff..799fae5 100644 --- a/src/pandoc.jl +++ b/src/pandoc.jl @@ -16,12 +16,17 @@ function pandoc2html(formatted::AbstractString, doc::WeaveDoc) #Change path for pandoc old_wd = pwd() cd(doc.cwd) + html ="" + try html = readall(pipeline(`echo $formatted` , `pandoc -R -s --mathjax --self-contained --template $html_template --include-in-header=$css_template -V wversion=$wversion -V wtime=$wtime -V wsource=$wsource`) ) + catch + cd(old_wd) + error("Unable to convert to html, check that you have pandoc installed and in your path") + end - cd(old_wd) return(html) end