diff --git a/README.md b/README.md index e48aac4..247c409 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,10 @@ weave(Pkg.dir("Weave","examples","gadfly_sample.mdw")) ## Documentation -Documenter.jl with MKdDocs generated documentation: +Documenter.jl with MKDocs generated documentation: [![](https://img.shields.io/badge/docs-stable-blue.svg)](https://mpastell.github.io/Weave.jl/stable) +[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://mpastell.github.io/Weave.jl/latest) ## Contributing diff --git a/src/run.jl b/src/run.jl index 28daba1..fd5de01 100644 --- a/src/run.jl +++ b/src/run.jl @@ -405,7 +405,7 @@ function collect_results(chunk::CodeChunk, fmt::CollectResult) result_no = 1 for r =chunk.result chunk.output *= r.stdout - chunk.figures = [chunk.figures, r.figures] + chunk.figures = [chunk.figures; r.figures] end return [chunk] diff --git a/test/chunk_options.jl b/test/chunk_options.jl index 0644b0b..c6bd102 100644 --- a/test/chunk_options.jl +++ b/test/chunk_options.jl @@ -34,7 +34,7 @@ ref = readall(open("documents/chunk_options_ref.jl")) @test result == ref cleanup && rm("documents/chunk_options.jl") -#Test chunk options and output formats +#Test functions and sandbox clearing weave("documents/chunk_func.noweb", plotlib=nothing) result = readall(open("documents/chunk_func.md")) ref = readall(open("documents/chunk_func_ref.md")) diff --git a/test/documents/test_hold.mdw b/test/documents/test_hold.mdw new file mode 100644 index 0000000..8323c20 --- /dev/null +++ b/test/documents/test_hold.mdw @@ -0,0 +1,33 @@ + +# Default + +<<>>= +using Gadfly +x = 1:10 +plot(x = x, y = x) +print(x) +plot(x = x, y = x) +display(x) +@ + +# Terminal + +<>= +using Gadfly +x = 1:10 +plot(x = x, y = x) +print(x) +plot(x = x, y = x) +display(x) +@ + +# Hold results + +<>= +using Gadfly +x = 1:10 +plot(x = x, y = x) +print(x) +plot(x = x, y = x) +display(x) +@ diff --git a/test/documents/test_hold_ref.md b/test/documents/test_hold_ref.md new file mode 100644 index 0000000..de8c325 --- /dev/null +++ b/test/documents/test_hold_ref.md @@ -0,0 +1,107 @@ + + +# Default + +~~~~{.julia} +using Gadfly +x = 1:10 +plot(x = x, y = x) + +~~~~~~~~~~~~~ + + +![](figures/test_hold_1_1.png)\ + + +~~~~{.julia} +print(x) + +~~~~~~~~~~~~~ + + +~~~~{.julia} +1:10 +~~~~~~~~~~~~~ + + + +~~~~{.julia} +plot(x = x, y = x) + +~~~~~~~~~~~~~ + + +![](figures/test_hold_1_2.png)\ + + +~~~~{.julia} +display(x) +~~~~~~~~~~~~~ + + +~~~~{.julia} +1:10 +~~~~~~~~~~~~~ + + + + + +# Terminal + +~~~~{.julia} +julia> using Gadfly + +julia> x = 1:10 + +1:10 +julia> plot(x = x, y = x) + +~~~~~~~~~~~~~ + + +![](figures/test_hold_2_1.png)\ + + +~~~~{.julia} +julia> print(x) +1:10 +julia> plot(x = x, y = x) + +~~~~~~~~~~~~~ + + +![](figures/test_hold_2_2.png)\ + + +~~~~{.julia} +julia> display(x) +1:10 +~~~~~~~~~~~~~ + + + + + +# Hold results + +~~~~{.julia} +using Gadfly +x = 1:10 +plot(x = x, y = x) +print(x) +plot(x = x, y = x) +display(x) +~~~~~~~~~~~~~ + + +~~~~{.julia} +1:10 +1:10 +~~~~~~~~~~~~~ + + +![](figures/test_hold_3_1.png)\ + +![](figures/test_hold_3_2.png)\ + diff --git a/test/runtests.jl b/test/runtests.jl index 0aed431..c85f17f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -9,6 +9,9 @@ using Base.Test info("Test: Chunk options") include("chunk_options.jl") +info("Test: hold and term options with plots") +include("test_hold.jl") + # Cache is currently not implemented for new output format #info("Test: Caching") #include("cache_test.jl") diff --git a/test/test_hold.jl b/test/test_hold.jl new file mode 100644 index 0000000..c565092 --- /dev/null +++ b/test/test_hold.jl @@ -0,0 +1,11 @@ +using Weave +using Base.Test + +cleanup = true + +#Test hold and term options +weave("documents/test_hold.mdw", doctype="pandoc", plotlib="Gadfly") +result = readall(open("documents/test_hold.md")) +ref = readall(open("documents/test_hold_ref.md")) +@test result == ref +cleanup && rm("documents/test_hold.md")