mirror of https://github.com/mpastell/Weave.jl
Clean build artefacts for pandoc2* closes #69
parent
c0f3bac70a
commit
ff79618182
|
@ -96,11 +96,15 @@ function weave(source ; doctype = :auto, plotlib=:auto,
|
|||
|
||||
#Special for that need external programs
|
||||
if doc.doctype == "pandoc2html"
|
||||
mdname = outname
|
||||
outname = get_outname(out_path, doc, ext = "html")
|
||||
pandoc2html(formatted, doc, outname)
|
||||
rm(mdname)
|
||||
elseif doc.doctype == "pandoc2pdf"
|
||||
mdname = outname
|
||||
outname = get_outname(out_path, doc, ext = "pdf")
|
||||
pandoc2pdf(formatted, doc, outname)
|
||||
rm(mdname)
|
||||
elseif doc.doctype == "md2pdf"
|
||||
success = run_latex(doc, outname, latex_cmd)
|
||||
success || return
|
||||
|
|
|
@ -37,10 +37,10 @@ function pandoc2html(formatted::AbstractString, doc::WeaveDoc, outname::Abstract
|
|||
-V headerscript=$header_script
|
||||
-o $outname`)
|
||||
println(pandoc_in, formatted)
|
||||
|
||||
close(pandoc_in)
|
||||
proc_output = readstring(pandoc_out)
|
||||
cd(old_wd)
|
||||
rm(doc.fig_path, force = true, recursive = true)
|
||||
catch e
|
||||
cd(old_wd)
|
||||
warn("Error converting document to HTML")
|
||||
|
@ -75,8 +75,9 @@ function pandoc2pdf(formatted::AbstractString, doc::WeaveDoc, outname::AbstractS
|
|||
println(pandoc_in, formatted)
|
||||
|
||||
close(pandoc_in)
|
||||
proc_output = readall(pandoc_out)
|
||||
proc_output = readstring(pandoc_out)
|
||||
cd(old_wd)
|
||||
rm(doc.fig_path, force = true, recursive = true)
|
||||
catch e
|
||||
cd(old_wd)
|
||||
warn("Error converting document to pdf")
|
||||
|
|
Loading…
Reference in New Issue