mirror of https://github.com/mpastell/Weave.jl
Added shortcut method for weave, cleaned obsolete code
parent
00660a6332
commit
c2f76c7190
|
@ -130,7 +130,9 @@ function Base.display(report::Report, m::MIME"text/plain", data)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
function weave(doc::String, doctype::String)
|
||||
weave(doc, doctype=doctype)
|
||||
end
|
||||
|
||||
export weave, list_out_formats, tangle
|
||||
|
||||
|
|
12
src/run.jl
12
src/run.jl
|
@ -71,19 +71,9 @@ function Base.run(doc::WeaveDoc; doctype = "pandoc", plotlib="Gadfly", informat=
|
|||
end
|
||||
|
||||
function run_chunk(chunk::CodeChunk, report::Report, SandBox::Module, cached, cache, idx)
|
||||
defaults = copy(rcParams[:chunk_defaults])
|
||||
options = copy(chunk.options)
|
||||
try
|
||||
options = merge(rcParams[:chunk_defaults], options)
|
||||
catch
|
||||
options = rcParams[:chunk_defaults]
|
||||
warn("Invalid format for chunk options line: $(chunk.start_line)")
|
||||
end
|
||||
|
||||
options = merge(rcParams[:chunk_defaults], chunk.options)
|
||||
merge!(chunk.options, options)
|
||||
|
||||
delete!(chunk.options, :options)
|
||||
|
||||
if cached != nothing && (cache == :all || (cache ==:user && chunk.options[:cache]))
|
||||
result_chunk = restore_chunk(chunk, cached, idx)
|
||||
else
|
||||
|
|
|
@ -3,7 +3,7 @@ using Weave
|
|||
using Base.Test
|
||||
|
||||
|
||||
weave("documents/gadfly_formats_test.txt", doctype="tex", plotlib="gadfly")
|
||||
weave("documents/gadfly_formats_test.txt", "tex")
|
||||
result = readall(open("documents/gadfly_formats_test.tex"))
|
||||
ref = readall(open("documents/gadfly_formats_test_ref.tex"))
|
||||
@test result == ref
|
||||
|
|
Loading…
Reference in New Issue