Exception handling for missing pandoc

pull/35/head
Matti Pastell 2016-04-20 17:04:38 +03:00
parent 34ea7f495e
commit 9a7aebc98d
1 changed files with 6 additions and 1 deletions

View File

@ -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