improving markdown
This commit is contained in:
parent
56e90a266a
commit
af3f3f436c
@ -88,6 +88,12 @@ const examples = PlotExample[
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
function createStringOfMarkDownCodeValues(arr, prefix = "")
|
||||||
|
string("`", prefix, join(arr, "`, `$prefix"), "`")
|
||||||
|
end
|
||||||
|
createStringOfMarkDownSymbols(arr) = createStringOfMarkDownCodeValues(arr, ":")
|
||||||
|
|
||||||
|
|
||||||
function generate_markdown(pkgname::Symbol)
|
function generate_markdown(pkgname::Symbol)
|
||||||
|
|
||||||
# set up the plotter, and don't show the plots by default
|
# set up the plotter, and don't show the plots by default
|
||||||
@ -103,11 +109,11 @@ function generate_markdown(pkgname::Symbol)
|
|||||||
md = open("$DOCDIR/$(pkgname)_examples.md", "w")
|
md = open("$DOCDIR/$(pkgname)_examples.md", "w")
|
||||||
|
|
||||||
write(md, "# Examples for backend: $pkgname\n\n")
|
write(md, "# Examples for backend: $pkgname\n\n")
|
||||||
write(md, "- Supported arguments: $(join(supportedArgs(pkg), ", "))\n")
|
write(md, "- Supported arguments: $(createStringOfMarkDownCodeValues(supportedArgs(pkg)))\n")
|
||||||
write(md, "- Supported values for axis: `:$(join(supportedAxes(pkg), "`, `:"))`\n")
|
write(md, "- Supported values for axis: $(createStringOfMarkDownSymbols(supportedAxes(pkg)))\n")
|
||||||
write(md, "- Supported values for linetype: $(supportedTypes(pkg))\n")
|
write(md, "- Supported values for linetype: $(createStringOfMarkDownSymbols(supportedTypes(pkg)))\n")
|
||||||
write(md, "- Supported values for linestyle: $(supportedStyles(pkg))\n")
|
write(md, "- Supported values for linestyle: $(createStringOfMarkDownSymbols(supportedStyles(pkg)))\n")
|
||||||
write(md, "- Supported values for marker: $(supportedMarkers(pkg))\n")
|
write(md, "- Supported values for marker: $(createStringOfMarkDownSymbols(supportedMarkers(pkg)))\n")
|
||||||
write(md, "- Is `subplot`/`subplot!` supported? $(subplotSupported(pkg) ? "Yes" : "No")\n\n")
|
write(md, "- Is `subplot`/`subplot!` supported? $(subplotSupported(pkg) ? "Yes" : "No")\n\n")
|
||||||
|
|
||||||
write(md, "### Initialize\n\n```julia\nusing Plots\n$(pkgname)!()\n```\n\n")
|
write(md, "### Initialize\n\n```julia\nusing Plots\n$(pkgname)!()\n```\n\n")
|
||||||
@ -122,6 +128,8 @@ function generate_markdown(pkgname::Symbol)
|
|||||||
|
|
||||||
# save the png
|
# save the png
|
||||||
imgname = "$(pkgname)_example_$i.png"
|
imgname = "$(pkgname)_example_$i.png"
|
||||||
|
|
||||||
|
# NOTE: uncomment this to overwrite the images as well
|
||||||
# savepng("$IMGDIR/$pkgname/$imgname")
|
# savepng("$IMGDIR/$pkgname/$imgname")
|
||||||
|
|
||||||
# write out the header, description, code block, and image link
|
# write out the header, description, code block, and image link
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
# Examples for backend: qwt
|
# Examples for backend: qwt
|
||||||
|
|
||||||
- Supported arguments: args, axis, color, fillto, heatmap_c, kwargs, label, legend, linestyle, linetype, marker, markercolor, markersize, nbins, reg, size, title, width, windowtitle, xlabel, ylabel, yrightlabel
|
- Supported arguments: `args`, `axis`, `color`, `fillto`, `heatmap_c`, `kwargs`, `label`, `legend`, `linestyle`, `linetype`, `marker`, `markercolor`, `markersize`, `nbins`, `reg`, `size`, `title`, `width`, `windowtitle`, `xlabel`, `ylabel`, `yrightlabel`
|
||||||
- Supported values for axis: `:auto`, `:left`, `:right`
|
- Supported values for axis: `:auto`, `:left`, `:right`
|
||||||
- Supported values for linetype: [:none,:line,:step,:stepinverted,:sticks,:scatter,:heatmap,:hexbin,:hist,:bar]
|
- Supported values for linetype: `:none`, `:line`, `:step`, `:stepinverted`, `:sticks`, `:scatter`, `:heatmap`, `:hexbin`, `:hist`, `:bar`
|
||||||
- Supported values for linestyle: [:auto,:solid,:dash,:dot,:dashdot,:dashdotdot]
|
- Supported values for linestyle: `:auto`, `:solid`, `:dash`, `:dot`, `:dashdot`, `:dashdotdot`
|
||||||
- Supported values for marker: [:none,:auto,:ellipse,:rect,:diamond,:utriangle,:dtriangle,:cross,:xcross,:star1,:star2,:hexagon]
|
- Supported values for marker: `:none`, `:auto`, `:ellipse`, `:rect`, `:diamond`, `:utriangle`, `:dtriangle`, `:cross`, `:xcross`, `:star1`, `:star2`, `:hexagon`
|
||||||
- Is `subplot`/`subplot!` supported? Yes
|
- Is `subplot`/`subplot!` supported? Yes
|
||||||
|
|
||||||
### Initialize
|
### Initialize
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user