mirror of https://github.com/mpastell/Weave.jl
Fix world-age for display
parent
b4f5221e3a
commit
9d4817007e
|
@ -116,13 +116,11 @@ function weave(source ; doctype = :auto, plotlib=:auto,
|
|||
outname = get_outname(out_path, doc, ext = "pdf")
|
||||
end
|
||||
|
||||
|
||||
doc.cwd == pwd() && (outname = basename(outname))
|
||||
info("Report weaved to $outname")
|
||||
catch e
|
||||
rethrow(e)
|
||||
warn("Something went wrong during weaving")
|
||||
print(e)
|
||||
println(e)
|
||||
finally
|
||||
doctype == :auto && (doctype = detect_doctype(doc.source))
|
||||
if contains(doctype, "2pdf") && cache == :off
|
||||
|
|
|
@ -31,14 +31,20 @@ function Base.display(report::Report, data)
|
|||
for m in report.mimetypes
|
||||
if mimewritable(m, data)
|
||||
try
|
||||
display(report, m, data)
|
||||
catch
|
||||
warn("Failed to save image in \"$m\" format")
|
||||
continue
|
||||
if VERSION >= v"0.6-alpha"
|
||||
new_dp(x, y, z) = eval(
|
||||
Expr(:call, (x, y, z) -> display(x, y, z), x, y, z))
|
||||
new_dp(report, m, data)
|
||||
else
|
||||
display(report, m, data)
|
||||
end
|
||||
catch e
|
||||
warn("Failed to display data in \"$m\" format")
|
||||
continue
|
||||
end
|
||||
#Always show plain text as well for term mode
|
||||
if m ≠ "text/plain" && report.cur_chunk.options[:term]
|
||||
display(report, "text/plain", data)
|
||||
display(report, "text/plain", data)
|
||||
end
|
||||
break
|
||||
end
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
"""
|
||||
`run(doc::WeaveDoc; doctype = :auto, plotlib="Gadfly",
|
||||
out_path=:doc, fig_path = "figures", fig_ext = nothing,
|
||||
|
@ -212,7 +213,7 @@ function run_code(chunk::CodeChunk, report::Report, SandBox::Module)
|
|||
#Save figures only in the end of chunk for PyPlot
|
||||
if rcParams[:plotlib] == "PyPlot"
|
||||
#Fix "world-age" issue
|
||||
if VERSION >= v"0.5.0"
|
||||
if VERSION >= v"0.6-alpha"
|
||||
savep(x) = eval(Expr(:call, x-> savefigs_pyplot(x), x))
|
||||
savep(report)
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue