Skip to content

Commit

Permalink
Autogen unicodeplots and inspectdr (#246)
Browse files Browse the repository at this point in the history
* autogen unicodeplots and inspectdr

* fix generation for unicodeplots - add ansi color support

* bypass svg for :inspectdr

Co-authored-by: t-bltg <t-bltg@users.noreply.github.com>
  • Loading branch information
t-bltg and t-bltg authored Jul 12, 2021
1 parent de8b4bb commit b36ef11
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
11 changes: 7 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ using Documenter, PlotDocs, Plots, PlotThemes
ENV["MPLBACKEND"] = "agg"

# Initialize backends
inspectdr()
unicodeplots()
pyplot()
pgfplotsx()
plotly()
Expand Down Expand Up @@ -59,22 +61,23 @@ const PAGES = Any[
"Plotly" => "generated/plotly.md",
"PyPlot" => "generated/pyplot.md",
"PGFPlotsX" => "generated/pgfplotsx.md",
"UnicodePlots" => "examples/unicodeplots.md",
"InspectDR" => "examples/inspectdr.md",
"UnicodePlots" => "generated/unicodeplots.md",
"InspectDR" => "generated/inspectdr.md",
],
]

generate_attr_markdown()
generate_supported_markdown()
generate_graph_attr_markdown()
generate_colorschemes_markdown()
for be in (:gr, :plotly, :pyplot, :pgfplotsx)
for be in (:gr, :plotly, :pyplot, :pgfplotsx, :unicodeplots, :inspectdr)
generate_markdown(be)
end
@time makedocs(
format = Documenter.HTML(
prettyurls = get(ENV, "CI", nothing) == "true",
assets = ["assets/favicon.ico"]
assets = ["assets/favicon.ico"],
ansicolor = true
),
sitename = "Plots",
authors = "Thomas Breloff",
Expand Down
15 changes: 13 additions & 2 deletions src/PlotDocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,28 @@ function generate_markdown(pkgname::Symbol; skip = get(Plots._backend_skips, pkg
```@example $pkgname
Plots.reset_defaults() # hide
""")
if pkgname (:unicodeplots, :inspectdr)
write(md, """
using Logging # hide
Logging.disable_logging(Logging.Warn) # hide
""")
end
for expr in example.exprs
pretty_print_expr(md, expr)
end
if pkgname == :unicodeplots
write(md, """
Plots._show(stdout, MIME("text/plain"), current()) # hide
""")
end
if i in (2, 31)
write(md, "gif(anim, \"anim_$(pkgname)_ex$i.gif\") # hide\n")
end
if pkgname (:plotly, :plotlyjs)
if pkgname (:plotly, :plotlyjs, :inspectdr)
write(md, "png(\"$(pkgname)_ex$i\") # hide\n")
end
write(md, "```\n")
if pkgname (:plotly, :plotlyjs)
if pkgname (:plotly, :plotlyjs, :inspectdr)
write(md, "![]($(pkgname)_ex$i.png)\n")
end
end
Expand Down

0 comments on commit b36ef11

Please sign in to comment.