mirror of https://github.com/mpastell/Weave.jl
Merge branch 'master' into script_reader
commit
aa66a8d1d0
15
src/Weave.jl
15
src/Weave.jl
|
@ -60,13 +60,16 @@ function tangle(source ; out_path=:doc, informat="noweb")
|
|||
cwd = get_cwd(doc, out_path)
|
||||
|
||||
outname = "$(cwd)/$(doc.basename).jl"
|
||||
open(outname, "w") do io
|
||||
for chunk in doc.chunks
|
||||
if typeof(chunk) == CodeChunk
|
||||
write(io, chunk.content*"\n")
|
||||
end
|
||||
end
|
||||
open(outname, "w") do io
|
||||
for chunk in doc.chunks
|
||||
if typeof(chunk) == CodeChunk
|
||||
options = merge(rcParams[:chunk_defaults], chunk.options)
|
||||
if options[:tangle]
|
||||
write(io, chunk.content*"\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
info("Writing to file $(doc.basename).jl")
|
||||
end
|
||||
|
|
|
@ -13,6 +13,7 @@ const defaultParams =
|
|||
:fig=> true,
|
||||
:include=> true,
|
||||
:eval => true,
|
||||
:tangle => true,
|
||||
:cache => false,
|
||||
:fig_cap=> nothing,
|
||||
#Size in inches
|
||||
|
|
|
@ -16,7 +16,7 @@ println(x)
|
|||
@
|
||||
|
||||
|
||||
<<eval=false>>=
|
||||
<<eval=false; tangle=false>>=
|
||||
y = randn(5)
|
||||
println("Don't eval, but show code")
|
||||
@
|
||||
|
|
|
@ -8,9 +8,6 @@ println(x)
|
|||
println("Results without code")
|
||||
println(x)
|
||||
|
||||
y = randn(5)
|
||||
println("Don't eval, but show code")
|
||||
|
||||
y = 1:5
|
||||
println(y)
|
||||
|
||||
|
|
Loading…
Reference in New Issue