mirror of https://github.com/mpastell/Weave.jl
Fix deprecations from tests
parent
af7a6779a5
commit
b41b4b4d41
|
@ -1,7 +1,7 @@
|
||||||
~~~~{.julia}
|
~~~~{.julia}
|
||||||
using Plots
|
using Plots
|
||||||
gr()
|
gr()
|
||||||
x = linspace(0, 2*pi)
|
x = range(0, stop=2π, length=50)
|
||||||
println(x)
|
println(x)
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
\begin{juliacode}
|
\begin{juliacode}
|
||||||
using Plots
|
using Plots
|
||||||
gr()
|
gr()
|
||||||
x = linspace(0, 2*pi)
|
x = range(0, stop=2π, length=50)
|
||||||
println(x)
|
println(x)
|
||||||
\end{juliacode}
|
\end{juliacode}
|
||||||
\begin{juliaout}
|
\begin{juliaout}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
```julia
|
```julia
|
||||||
using Plots
|
using Plots
|
||||||
gr()
|
gr()
|
||||||
x = linspace(0, 2*pi)
|
x = range(0, stop=2π, length=50)
|
||||||
println(x)
|
println(x)
|
||||||
p = plot(x, sin.(x), size =(900,300))
|
p = plot(x, sin.(x), size =(900,300))
|
||||||
p
|
p
|
||||||
|
@ -21,5 +21,5 @@ scatter!(rand(100),markersize=6,c=:orange)
|
||||||
|
|
||||||
|
|
||||||
```{julia;echo=false; fig_cap="A random walk."; label="random"}
|
```{julia;echo=false; fig_cap="A random walk."; label="random"}
|
||||||
plot(cumsum(randn(1000, 1)))
|
plot(cumsum(randn(1000, 1), dims=1))
|
||||||
```
|
```
|
||||||
|
|
|
@ -15,12 +15,13 @@ chunk.figures = ["figs/figures_plot1.png"]
|
||||||
@test Weave.formatfigures(chunk, Weave.github) == "![](figs/figures_plot1.png)\n"
|
@test Weave.formatfigures(chunk, Weave.github) == "![](figs/figures_plot1.png)\n"
|
||||||
@test Weave.formatfigures(chunk, Weave.hugo) == "{{< figure src=\"../figs/figures_plot1.png\" >}}"
|
@test Weave.formatfigures(chunk, Weave.hugo) == "{{< figure src=\"../figs/figures_plot1.png\" >}}"
|
||||||
@test Weave.formatfigures(chunk, Weave.multimarkdown) == "![][figs/figures_plot1.png]\n\n[figs/figures_plot1.png]: figs/figures_plot1.png \n"
|
@test Weave.formatfigures(chunk, Weave.multimarkdown) == "![][figs/figures_plot1.png]\n\n[figs/figures_plot1.png]: figs/figures_plot1.png \n"
|
||||||
@test Weave.formatfigures(chunk, Weave.adoc) == "image::figs/figures_plot1.png[width=nothing]\n"
|
|
||||||
@test Weave.formatfigures(chunk, Weave.rst) == ".. image:: figs/figures_plot1.png\n :width: nothing\n\n"
|
|
||||||
@test Weave.formatfigures(chunk, Weave.md2html) == "<img src=\"figs/figures_plot1.png\" />\n"
|
@test Weave.formatfigures(chunk, Weave.md2html) == "<img src=\"figs/figures_plot1.png\" />\n"
|
||||||
|
|
||||||
chunk.options[:fig_cap] = "Nice plot"
|
|
||||||
chunk.options[:out_width] = "100%"
|
chunk.options[:out_width] = "100%"
|
||||||
|
@test Weave.formatfigures(chunk, Weave.adoc) == "image::figs/figures_plot1.png[width=100%]\n"
|
||||||
|
@test Weave.formatfigures(chunk, Weave.rst) == ".. image:: figs/figures_plot1.png\n :width: 100%\n\n"
|
||||||
|
|
||||||
|
chunk.options[:fig_cap] = "Nice plot"
|
||||||
@test Weave.formatfigures(chunk, Weave.tex) == "\\begin{figure}[!h]\n\\center\n\\includegraphics[width=100%]{figs/figures_plot1.png}\n\\caption{Nice plot}\n\\end{figure}\n"
|
@test Weave.formatfigures(chunk, Weave.tex) == "\\begin{figure}[!h]\n\\center\n\\includegraphics[width=100%]{figs/figures_plot1.png}\n\\caption{Nice plot}\n\\end{figure}\n"
|
||||||
@test Weave.formatfigures(chunk, Weave.pandoc) == "![Nice plot](figs/figures_plot1.png){width=100%}\n"
|
@test Weave.formatfigures(chunk, Weave.pandoc) == "![Nice plot](figs/figures_plot1.png){width=100%}\n"
|
||||||
@test Weave.formatfigures(chunk, Weave.md2tex) == "\\begin{figure}[!h]\n\\center\n\\includegraphics[width=100%]{figs/figures_plot1.png}\n\\caption{Nice plot}\n\\end{figure}\n"
|
@test Weave.formatfigures(chunk, Weave.md2tex) == "\\begin{figure}[!h]\n\\center\n\\includegraphics[width=100%]{figs/figures_plot1.png}\n\\caption{Nice plot}\n\\end{figure}\n"
|
||||||
|
|
|
@ -35,7 +35,7 @@ using Test
|
||||||
end
|
end
|
||||||
|
|
||||||
@testset "Plots" begin
|
@testset "Plots" begin
|
||||||
info("Test: Weaving with Plots.jl")
|
@info("Test: Weaving with Plots.jl")
|
||||||
include("plotsjl_test.jl")
|
include("plotsjl_test.jl")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue