diff --git a/test/documents/FIR_design_ref.md b/test/documents/FIR_design_ref.md index 59fe8f3..14e0eaa 100644 --- a/test/documents/FIR_design_ref.md +++ b/test/documents/FIR_design_ref.md @@ -89,6 +89,7 @@ The next code chunk is executed in term mode, see the [script](FIR_design.jl) fo ~~~~{.julia} julia> plot(y = h_db, x = ws, Geom.line, Guide.xlabel("Frequency (Hz)"), Guide.ylabel("Magnitude (db)")) + ~~~~~~~~~~~~~ diff --git a/test/documents/gadfly_formats_test_jssvg_ref.md b/test/documents/gadfly_formats_test_jssvg_ref.md index 9419b90..5cf3114 100644 --- a/test/documents/gadfly_formats_test_jssvg_ref.md +++ b/test/documents/gadfly_formats_test_jssvg_ref.md @@ -13,9 +13,9 @@ plot(x=x, y = sin(x), Geom.line) ````julia julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x=x, y = sin(x), Geom.line) ```` @@ -25,9 +25,10 @@ julia> plot(x=x, y = sin(x), Geom.line) ````julia julia> y = 20 - 20 + julia> plot(x=x, y = cos(x), Geom.line) + ```` diff --git a/test/documents/gadfly_formats_test_mmd_ref.md b/test/documents/gadfly_formats_test_mmd_ref.md index 6a32385..756ad64 100644 --- a/test/documents/gadfly_formats_test_mmd_ref.md +++ b/test/documents/gadfly_formats_test_mmd_ref.md @@ -19,9 +19,9 @@ plot(x=x, y = sin(x), Geom.line) ````julia julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x=x, y = sin(x), Geom.line) ```` @@ -33,9 +33,10 @@ julia> plot(x=x, y = sin(x), Geom.line) ````julia julia> y = 20 - 20 + julia> plot(x=x, y = cos(x), Geom.line) + ```` diff --git a/test/documents/gadfly_formats_test_pandoc_ref.md b/test/documents/gadfly_formats_test_pandoc_ref.md index 1e60935..ecfa88b 100644 --- a/test/documents/gadfly_formats_test_pandoc_ref.md +++ b/test/documents/gadfly_formats_test_pandoc_ref.md @@ -14,9 +14,9 @@ plot(x=x, y = sin(x), Geom.line) ~~~~{.julia} julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x=x, y = sin(x), Geom.line) ~~~~~~~~~~~~~ @@ -27,9 +27,10 @@ julia> plot(x=x, y = sin(x), Geom.line) ~~~~{.julia} julia> y = 20 - 20 + julia> plot(x=x, y = cos(x), Geom.line) + ~~~~~~~~~~~~~ diff --git a/test/documents/gadfly_formats_test_ps_ref.tex b/test/documents/gadfly_formats_test_ps_ref.tex index fb58b60..46c2a8e 100644 --- a/test/documents/gadfly_formats_test_ps_ref.tex +++ b/test/documents/gadfly_formats_test_ps_ref.tex @@ -20,9 +20,9 @@ plot(x=x, y = sin(x), Geom.line) \begin{juliaterm} julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x=x, y = sin(x), Geom.line) \end{juliaterm} @@ -30,9 +30,10 @@ julia> plot(x=x, y = sin(x), Geom.line) \begin{juliaterm} julia> y = 20 - 20 + julia> plot(x=x, y = cos(x), Geom.line) + \end{juliaterm} \includegraphics[width=\linewidth]{figures/gadfly_formats_test_4_2.ps} diff --git a/test/documents/gadfly_formats_test_ref.rst b/test/documents/gadfly_formats_test_ref.rst index b06f990..4fb95f3 100644 --- a/test/documents/gadfly_formats_test_ref.rst +++ b/test/documents/gadfly_formats_test_ref.rst @@ -3,7 +3,7 @@ using Gadfly x = linspace(0, 2π, 200) plot(x=x, y = sin(x), Geom.line) - + .. figure:: figures/gadfly_formats_test_sin_fun_1.png @@ -25,9 +25,9 @@ .. code-block:: julia julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x=x, y = sin(x), Geom.line) @@ -40,12 +40,13 @@ julia> plot(x=x, y = sin(x), Geom.line) .. code-block:: julia julia> y = 20 - 20 + julia> plot(x=x, y = cos(x), Geom.line) + .. image:: figures/gadfly_formats_test_4_2.png :width: 15 cm @@ -54,7 +55,7 @@ julia> plot(x=x, y = cos(x), Geom.line) x = linspace(0, 2π, 200) plot(x=x, y = sin(x), Geom.line) - + .. image:: figures/gadfly_formats_test_5_1.png @@ -65,7 +66,7 @@ julia> plot(x=x, y = cos(x), Geom.line) y = 20 plot(x=x, y = cos(x), Geom.line) - + .. image:: figures/gadfly_formats_test_5_2.png diff --git a/test/documents/gadfly_formats_test_ref.tex b/test/documents/gadfly_formats_test_ref.tex index eb2a38e..adc56c8 100644 --- a/test/documents/gadfly_formats_test_ref.tex +++ b/test/documents/gadfly_formats_test_ref.tex @@ -20,9 +20,9 @@ plot(x=x, y = sin(x), Geom.line) \begin{juliaterm} julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x=x, y = sin(x), Geom.line) \end{juliaterm} @@ -30,9 +30,10 @@ julia> plot(x=x, y = sin(x), Geom.line) \begin{juliaterm} julia> y = 20 - 20 + julia> plot(x=x, y = cos(x), Geom.line) + \end{juliaterm} \includegraphics[width=\linewidth]{figures/gadfly_formats_test_4_2.pdf} diff --git a/test/documents/gadfly_formats_test_svg_ref.md b/test/documents/gadfly_formats_test_svg_ref.md index bce960a..43a98a8 100644 --- a/test/documents/gadfly_formats_test_svg_ref.md +++ b/test/documents/gadfly_formats_test_svg_ref.md @@ -14,9 +14,9 @@ plot(x=x, y = sin(x), Geom.line) ~~~~{.julia} julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x=x, y = sin(x), Geom.line) ~~~~~~~~~~~~~ @@ -27,9 +27,10 @@ julia> plot(x=x, y = sin(x), Geom.line) ~~~~{.julia} julia> y = 20 - 20 + julia> plot(x=x, y = cos(x), Geom.line) + ~~~~~~~~~~~~~ diff --git a/test/documents/gadfly_formats_test_tikz_ref.tex b/test/documents/gadfly_formats_test_tikz_ref.tex index 902a6a0..62746cb 100644 --- a/test/documents/gadfly_formats_test_tikz_ref.tex +++ b/test/documents/gadfly_formats_test_tikz_ref.tex @@ -20,9 +20,9 @@ plot(x=x, y = sin(x), Geom.line) \begin{juliaterm} julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x=x, y = sin(x), Geom.line) \end{juliaterm} @@ -30,9 +30,10 @@ julia> plot(x=x, y = sin(x), Geom.line) \begin{juliaterm} julia> y = 20 - 20 + julia> plot(x=x, y = cos(x), Geom.line) + \end{juliaterm} \resizebox{\linewidth}{!}{\input{figures/gadfly_formats_test_4_2.tex}} diff --git a/test/documents/gadfly_markdown_test_ref.md b/test/documents/gadfly_markdown_test_ref.md index 8735360..9743178 100644 --- a/test/documents/gadfly_markdown_test_ref.md +++ b/test/documents/gadfly_markdown_test_ref.md @@ -5,9 +5,9 @@ julia> using Gadfly julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x=x, y = sin(x), Geom.line) ```` @@ -17,9 +17,10 @@ julia> plot(x=x, y = sin(x), Geom.line) ````julia julia> y = 20 - 20 + julia> plot(x=x, y = cos(x), Geom.line) + ```` @@ -41,9 +42,9 @@ linspace(0.0,200.0,50) julia> using Gadfly julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x=x, y = sin(x), Geom.line) ```` @@ -53,9 +54,10 @@ julia> plot(x=x, y = sin(x), Geom.line) ````julia julia> y = 20 - 20 + julia> plot(x=x, y = cos(x), Geom.line) + ```` diff --git a/test/documents/multimedia/rich_output.md.ref b/test/documents/multimedia/rich_output.md.ref index 40bc37f..39c58e5 100644 --- a/test/documents/multimedia/rich_output.md.ref +++ b/test/documents/multimedia/rich_output.md.ref @@ -106,6 +106,7 @@ julia> df │ 24 │ 'x' │ 24 │ │ 25 │ 'y' │ 25 │ │ 26 │ 'z' │ 26 │ + ~~~~~~~~~~~~~ diff --git a/test/documents/multimedia/rich_output.tex.ref b/test/documents/multimedia/rich_output.tex.ref index f1e25b8..bf52487 100644 --- a/test/documents/multimedia/rich_output.tex.ref +++ b/test/documents/multimedia/rich_output.tex.ref @@ -94,6 +94,7 @@ julia> df │ 24 │ 'x' │ 24 │ │ 25 │ 'y' │ 25 │ │ 26 │ 'z' │ 26 │ + \end{juliaterm} \begin{juliacode} diff --git a/test/documents/output/gadfly_formats_test_ref.txt b/test/documents/output/gadfly_formats_test_ref.txt index 9774cfb..e358c52 100644 --- a/test/documents/output/gadfly_formats_test_ref.txt +++ b/test/documents/output/gadfly_formats_test_ref.txt @@ -13,9 +13,9 @@ image::figures/gadfly_formats_test_cos2_fun_1.png[width=600] [source,julia] -------------------------------------- julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x=x, y = sin(x), Geom.line) -------------------------------------- @@ -26,9 +26,10 @@ image::figures/gadfly_formats_test_4_1.png[width=600] [source,julia] -------------------------------------- julia> y = 20 - 20 + julia> plot(x=x, y = cos(x), Geom.line) + -------------------------------------- diff --git a/test/documents/plotsjl/plotsjl_test.md.ref b/test/documents/plotsjl/plotsjl_test.md.ref index 7cf6220..d9a16a5 100644 --- a/test/documents/plotsjl/plotsjl_test.md.ref +++ b/test/documents/plotsjl/plotsjl_test.md.ref @@ -17,17 +17,14 @@ p = plot(x, sin(x), size =(900,300)) ~~~~~~~~~~~~~ -![](figures/plotsjl_test_1_1.png)\ - ~~~~{.julia} julia> plot(x, sin(x)) + ~~~~~~~~~~~~~ -![](figures/plotsjl_test_2_1.png)\ - ![](figures/plotsjl_test_2_1.png)\ @@ -37,8 +34,6 @@ scatter!(rand(100),markersize=6,c=:orange) ~~~~~~~~~~~~~ -![](figures/plotsjl_test_3_1.png)\ - ![](figures/plotsjl_test_3_1.png)\ @@ -55,13 +50,11 @@ julia> plot(rand(100) / 3,reg=true,fill=(0,:green)) ~~~~{.julia} julia> scatter!(rand(100),markersize=6,c=:orange) + ~~~~~~~~~~~~~ ![](figures/plotsjl_test_4_2.png)\ -![](figures/plotsjl_test_4_1.png)\ - ![A random walk.](figures/plotsjl_test_random_1.png) -![](figures/plotsjl_test_random_1.png) diff --git a/test/documents/plotsjl/plotsjl_test.tex.ref b/test/documents/plotsjl/plotsjl_test.tex.ref index f29e5fe..f838604 100644 --- a/test/documents/plotsjl/plotsjl_test.tex.ref +++ b/test/documents/plotsjl/plotsjl_test.tex.ref @@ -15,6 +15,7 @@ p = plot(x, sin(x), size =(900,300)) \begin{juliaterm} julia> plot(x, sin(x)) + \end{juliaterm} \includegraphics[width=\linewidth]{figures/plotsjl_test_2_1.pdf} @@ -34,6 +35,7 @@ julia> plot(rand(100) / 3,reg=true,fill=(0,:green)) \begin{juliaterm} julia> scatter!(rand(100),markersize=6,c=:orange) + \end{juliaterm} \includegraphics[width=\linewidth]{figures/plotsjl_test_4_2.pdf} diff --git a/test/documents/plotsjl/plotsjl_test_gr.md.ref b/test/documents/plotsjl/plotsjl_test_gr.md.ref index 80d25c1..08cae80 100644 --- a/test/documents/plotsjl/plotsjl_test_gr.md.ref +++ b/test/documents/plotsjl/plotsjl_test_gr.md.ref @@ -21,11 +21,10 @@ p = plot(x, sin(x), size =(900,300)) ~~~~{.julia} julia> plot(x, sin(x)) + ~~~~~~~~~~~~~ -![](figures/plotsjl_test_gr_2_1.png)\ - ~~~~{.julia} plot(rand(100) / 3,reg=true,fill=(0,:green)) @@ -33,26 +32,15 @@ scatter!(rand(100),markersize=6,c=:orange) ~~~~~~~~~~~~~ -![](figures/plotsjl_test_gr_3_1.png)\ - ~~~~{.julia} julia> plot(rand(100) / 3,reg=true,fill=(0,:green)) -~~~~~~~~~~~~~ - - -![](figures/plotsjl_test_gr_4_1.png)\ - - -~~~~{.julia} julia> scatter!(rand(100),markersize=6,c=:orange) + ~~~~~~~~~~~~~ -![](figures/plotsjl_test_gr_4_2.png)\ - -![A random walk.](figures/plotsjl_test_gr_random_1.png) diff --git a/test/documents/pyplot_formats_ref.md b/test/documents/pyplot_formats_ref.md index 98d8c01..fe0226c 100644 --- a/test/documents/pyplot_formats_ref.md +++ b/test/documents/pyplot_formats_ref.md @@ -7,7 +7,7 @@ plot(x, sin(x)) ```` 1-element Array{Any,1}: - PyObject + PyObject ```` @@ -15,7 +15,7 @@ plot(x, sin(x)) ```` 1-element Array{Any,1}: - PyObject + PyObject ```` @@ -23,7 +23,7 @@ plot(x, sin(x)) ```` 1-element Array{Any,1}: - PyObject + PyObject ```` @@ -31,19 +31,20 @@ plot(x, sin(x)) ````julia julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x, sin(x)) - 1-element Array{Any,1}: - PyObject -julia> y = 20 + PyObject +julia> y = 20 20 + julia> plot(x, cos(x)) 1-element Array{Any,1}: - PyObject + PyObject + ```` @@ -56,7 +57,7 @@ contourf(x) ```` -PyObject +PyObject ```` diff --git a/test/documents/pyplot_formats_ref.rst b/test/documents/pyplot_formats_ref.rst index e93953f..7d6f834 100644 --- a/test/documents/pyplot_formats_ref.rst +++ b/test/documents/pyplot_formats_ref.rst @@ -3,13 +3,13 @@ using PyPlot x = linspace(0, 2π, 200) plot(x, sin(x)) - + :: 1-element Array{Any,1}: - PyObject + PyObject @@ -22,7 +22,7 @@ :: 1-element Array{Any,1}: - PyObject + PyObject @@ -35,7 +35,7 @@ :: 1-element Array{Any,1}: - PyObject + PyObject @@ -46,19 +46,20 @@ .. code-block:: julia julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x, sin(x)) - 1-element Array{Any,1}: - PyObject -julia> y = 20 + PyObject +julia> y = 20 20 + julia> plot(x, cos(x)) 1-element Array{Any,1}: - PyObject + PyObject + @@ -70,12 +71,12 @@ julia> plot(x, cos(x)) x = randn(100, 100) contourf(x) - + :: - PyObject + PyObject diff --git a/test/documents/pyplot_formats_ref.tex b/test/documents/pyplot_formats_ref.tex index 14bbe54..4d9e3c1 100644 --- a/test/documents/pyplot_formats_ref.tex +++ b/test/documents/pyplot_formats_ref.tex @@ -5,7 +5,7 @@ plot(x, sin(x)) \end{juliacode} \begin{juliaout} 1-element Array{Any,1}: - PyObject + PyObject \end{juliaout} \begin{figure}[ht] \center @@ -16,7 +16,7 @@ plot(x, sin(x)) \begin{juliaout} 1-element Array{Any,1}: - PyObject + PyObject \end{juliaout} \begin{figure}[htpb] \center @@ -26,25 +26,26 @@ plot(x, sin(x)) \begin{juliaout} 1-element Array{Any,1}: - PyObject + PyObject \end{juliaout} \includegraphics[width=\linewidth]{figures/pyplot_formats_cos2_fun_1.pdf} \begin{juliaterm} julia> x = linspace(0, 2π, 200) - 200-element LinSpace{Float64}: 0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319 + julia> plot(x, sin(x)) - 1-element Array{Any,1}: - PyObject -julia> y = 20 + PyObject +julia> y = 20 20 + julia> plot(x, cos(x)) 1-element Array{Any,1}: - PyObject + PyObject + \end{juliaterm} \includegraphics[width=\linewidth]{figures/pyplot_formats_4_1.pdf} @@ -53,6 +54,6 @@ x = randn(100, 100) contourf(x) \end{juliacode} \begin{juliaout} -PyObject +PyObject \end{juliaout} \includegraphics[width=15cm]{figures/pyplot_formats_5_1.pdf} diff --git a/test/formatter_test.jl b/test/formatter_test.jl index d13f5ac..4d394a5 100644 --- a/test/formatter_test.jl +++ b/test/formatter_test.jl @@ -24,13 +24,13 @@ f = Weave.format_chunk(dchunk, docformat.formatdict, docformat) parsed = Weave.read_doc("documents/chunk_options.noweb") doc = Weave.run(parsed, doctype = "md2html") -c_check = "
\nprintln(x)\n
\n" +c_check = "
\nx = [12, 10]\nprintln(y)\n
\n" doc.format.formatdict[:theme] = doc.highlight_theme c = Weave.format_code(doc.chunks[3].content, doc.format) @test c_check == c -o_check = "\nprintln(x)" -o = Weave.format_output(doc.chunks[3].content, doc.format) +o_check = "\nprintln(x)\n" +o = Weave.format_output(doc.chunks[4].content, doc.format) @test o_check == o doc.template = "templates/mini.tpl" @@ -43,18 +43,17 @@ doc = Weave.run(parsed, doctype = "md2tex") c_check = "\\begin{lstlisting}\n(*@\\HLJLnf{println}@*)(*@\\HLJLp{(}@*)(*@\\HLJLn{x}@*)(*@\\HLJLp{)}@*)\n\\end{lstlisting}\n" doc.format.formatdict[:theme] = doc.highlight_theme -c = Weave.format_code(doc.chunks[3].content, doc.format) +c = Weave.format_code(doc.chunks[4].content, doc.format) @test c_check == c -o_check = "\nx = [12, 10]\nprintln(y)" -o = Weave.format_output(doc.chunks[2].content, doc.format) +o_check = "\nx = [12, 10]\nprintln(y)\n" +o = Weave.format_output(doc.chunks[3].content, doc.format) @test o_check == o doc.template = "templates/mini.tpl" rendered = Weave.render_doc("Hello", doc, doc.format) @test rendered == "\nHello\n" - # Test header parsing and stripping header = """ ---