Add hold option for chunks

pull/35/head
Matti Pastell 2016-04-19 16:38:03 +03:00
parent f50c94d0ed
commit 526646bb79
5 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,12 @@
# Release notes for Weave.jl
### In master
* Use Documenter.jl for documentation
* Add chunk option `hold`, replaces results = "hold". This way you can use e.g. `hold = true, results=raw`.
### v0.1.0
19th April 2016
@ -9,7 +15,7 @@
* Each document is executed in separate sandbox module instead of redefining the same one. Fixes warnings and occasional segfaults.
* Change the output of chunks:
- Output will be added to the output directly where they are created (default).
- Use "results = :hold" to push all output after the chunk.
- Use results = "hold" to push all output after the chunk.
* New chunk option: `line_width`.
* Winston support is not implemented yet for this version.
* Bug fix in wrapping output lines.

View File

@ -66,6 +66,7 @@ Weave currently supports the following chunk options with the following defaults
* `wrap = true`. Wrap long lines from output.
* `line_width = 75`. Line width for wrapped lines.
* `cache = false`. Cache results, depends on `cache` parameter on `weave` function.
* `hold = false`. Hold all results until the end of the chunk.
**Options for figures**

View File

@ -79,7 +79,7 @@ weave(source ; doctype = "pandoc", plotlib="Gadfly",
Weave an input document to output file.
* `doctype`: see `list_out_formats()`
* `plotlib`: `"PyPlot"`, `"Gadfly"`, or `"Winston"`
* `plotlib`: `"PyPlot"`, `"Gadfly"` or `nothing`
* `informat`: `"noweb"` of `"markdown"`
* `out_path`: Path where the output is generated. Can be: `:doc`: Path of the source document, `:pwd`: Julia working directory,
`"somepath"`: Path as a AbstractString e.g `"/home/mpastell/weaveout"`

View File

@ -7,6 +7,7 @@ const rcParams =
Dict{Symbol,Any}(
:echo=> true,
:results=> "markup",
:hold => false,
:fig=> true,
:include=> true,
:eval => true,

View File

@ -264,7 +264,7 @@ function eval_chunk(chunk::CodeChunk, report::Report, SandBox::Module)
chunk.result = run_code(chunk, report, SandBox)
if chunk.options[:term]
chunks = collect_results(chunk, TermResult())
elseif chunk.options[:results] == "hold"
elseif chunk.options[:hold]
chunks = collect_results(chunk, CollectResult())
else
chunks = collect_results(chunk, ScriptResult())