Added shortcut method for weave, cleaned obsolete code

pull/29/head
Matti Pastell 2015-01-09 00:05:46 +02:00
parent 00660a6332
commit c2f76c7190
3 changed files with 5 additions and 13 deletions

View File

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

View File

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

View File

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