mirror of https://github.com/mpastell/Weave.jl
Fix tests
parent
70c850e79e
commit
0ffa04b3fd
|
@ -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)"))
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
````
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
````
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
|
|
|
@ -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}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
|
|
|
@ -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}}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
````
|
||||
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@ julia> df
|
|||
│ 24 │ 'x' │ 24 │
|
||||
│ 25 │ 'y' │ 25 │
|
||||
│ 26 │ 'z' │ 26 │
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
|
|
|
@ -94,6 +94,7 @@ julia> df
|
|||
│ 24 │ 'x' │ 24 │
|
||||
│ 25 │ 'y' │ 25 │
|
||||
│ 26 │ 'z' │ 26 │
|
||||
|
||||
\end{juliaterm}
|
||||
|
||||
\begin{juliacode}
|
||||
|
|
|
@ -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)
|
||||
|
||||
--------------------------------------
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -7,7 +7,7 @@ plot(x, sin(x))
|
|||
|
||||
````
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fe35ad5f208>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd590d7860>
|
||||
````
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ plot(x, sin(x))
|
|||
|
||||
````
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fe35ae08e48>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd60094160>
|
||||
````
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ plot(x, sin(x))
|
|||
|
||||
````
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fe35e9a7518>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd5905c7b8>
|
||||
````
|
||||
|
||||
|
||||
|
@ -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 <matplotlib.lines.Line2D object at 0x7fe35adcce80>
|
||||
julia> y = 20
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd60047fd0>
|
||||
|
||||
julia> y = 20
|
||||
20
|
||||
|
||||
julia> plot(x, cos(x))
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fe35adcd898>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd6004eeb8>
|
||||
|
||||
````
|
||||
|
||||
|
||||
|
@ -56,7 +57,7 @@ contourf(x)
|
|||
|
||||
|
||||
````
|
||||
PyObject <matplotlib.contour.QuadContourSet object at 0x7fe35ac04898>
|
||||
PyObject <matplotlib.contour.QuadContourSet object at 0x7fbd5a506128>
|
||||
````
|
||||
|
||||
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
using PyPlot
|
||||
x = linspace(0, 2π, 200)
|
||||
plot(x, sin(x))
|
||||
|
||||
|
||||
|
||||
|
||||
::
|
||||
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7f1e029e5c18>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd50edb0b8>
|
||||
|
||||
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
|||
::
|
||||
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7f1e294769b0>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd514a7780>
|
||||
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
|||
::
|
||||
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7f1e293d9c88>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd580c6080>
|
||||
|
||||
|
||||
|
||||
|
@ -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 <matplotlib.lines.Line2D object at 0x7f1e293bcf60>
|
||||
julia> y = 20
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd585a7320>
|
||||
|
||||
julia> y = 20
|
||||
20
|
||||
|
||||
julia> plot(x, cos(x))
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7f1e02b32710>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd58612128>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -70,12 +71,12 @@ julia> plot(x, cos(x))
|
|||
|
||||
x = randn(100, 100)
|
||||
contourf(x)
|
||||
|
||||
|
||||
|
||||
|
||||
::
|
||||
|
||||
PyObject <matplotlib.contour.QuadContourSet object at 0x7f1e293217f0>
|
||||
PyObject <matplotlib.contour.QuadContourSet object at 0x7fbd5a2d8e48>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ plot(x, sin(x))
|
|||
\end{juliacode}
|
||||
\begin{juliaout}
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7f8aa1b99588>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd66371c50>
|
||||
\end{juliaout}
|
||||
\begin{figure}[ht]
|
||||
\center
|
||||
|
@ -16,7 +16,7 @@ plot(x, sin(x))
|
|||
|
||||
\begin{juliaout}
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7f8aa1d6cf60>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd66325a20>
|
||||
\end{juliaout}
|
||||
\begin{figure}[htpb]
|
||||
\center
|
||||
|
@ -26,25 +26,26 @@ plot(x, sin(x))
|
|||
|
||||
\begin{juliaout}
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7f8aa1cd9f28>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd6629cf28>
|
||||
\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 <matplotlib.lines.Line2D object at 0x7f8aa1cc0ba8>
|
||||
julia> y = 20
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd600ca588>
|
||||
|
||||
julia> y = 20
|
||||
20
|
||||
|
||||
julia> plot(x, cos(x))
|
||||
1-element Array{Any,1}:
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7f8aa1cc0e10>
|
||||
PyObject <matplotlib.lines.Line2D object at 0x7fbd600f4c18>
|
||||
|
||||
\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 <matplotlib.contour.QuadContourSet object at 0x7f8aa1c2f198>
|
||||
PyObject <matplotlib.contour.QuadContourSet object at 0x7fbd600ba9b0>
|
||||
\end{juliaout}
|
||||
\includegraphics[width=15cm]{figures/pyplot_formats_5_1.pdf}
|
||||
|
|
|
@ -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 = "<pre class='hljl'>\n<span class='hljl-nf'>println</span><span class='hljl-p'>(</span><span class='hljl-n'>x</span><span class='hljl-p'>)</span>\n</pre>\n"
|
||||
c_check = "<pre class='hljl'>\n<span class='hljl-n'>x</span><span class='hljl-t'> </span><span class='hljl-oB'>=</span><span class='hljl-t'> </span><span class='hljl-p'>[</span><span class='hljl-ni'>12</span><span class='hljl-p'>,</span><span class='hljl-t'> </span><span class='hljl-ni'>10</span><span class='hljl-p'>]</span><span class='hljl-t'>\n</span><span class='hljl-nf'>println</span><span class='hljl-p'>(</span><span class='hljl-n'>y</span><span class='hljl-p'>)</span>\n</pre>\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 = """
|
||||
---
|
||||
|
|
Loading…
Reference in New Issue