1
1
module PlotDocs
2
2
3
- using Plots, DataFrames, MacroTools, OrderedCollections, Dates
4
- import Plots: _examples
3
+ using Plots, DataFrames, MacroTools, OrderedCollections, Dates, StableRNGs
4
+ import Plots: _examples, PLOTS_SEED
5
5
using JSON
6
6
7
+ import Random
8
+
7
9
export
8
10
generate_cards,
9
11
generate_supported_markdown,
@@ -79,7 +81,10 @@ function generate_cards(pkgname::Symbol; skip = get(Plots._backend_skips, pkgnam
79
81
end
80
82
# DemoCards use Literate.jl syntax with extra leading `#` as markdown lines
81
83
write (jl, " # $(replace (example. desc, " \n " => " \n # " )) \n " )
84
+ write (jl, " using StableRNGs #hide\n " )
85
+ write (jl, " rng = StableRNG($PLOTS_SEED ) #hide\n " )
82
86
isnothing (example. imports) || pretty_print_expr (jl, example. imports)
87
+ # pretty_print_expr(jl, Plots.replace_rand(example.exprs))
83
88
pretty_print_expr (jl, example. exprs)
84
89
85
90
# NOTE: the supported `Literate.jl` syntax is `#src` and `#hide` NOT `# src` !!
@@ -90,7 +95,7 @@ function generate_cards(pkgname::Symbol; skip = get(Plots._backend_skips, pkgnam
90
95
" png(\" assets/$(pkgname) _ex$i .png\" ) #src\n "
91
96
end )
92
97
if pkgname === :plotlyjs
93
- write (jl, " nothing#hide\n " )
98
+ write (jl, " nothing #hide\n " )
94
99
write (jl, " #  _ex$i .png)\n " )
95
100
end
96
101
0 commit comments