Skip to content

Conversation

@BeastyBlacksmith
Copy link
Member

Also changes CI from travis to gh-actions

Copy link
Member Author

@BeastyBlacksmith BeastyBlacksmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnnychen94 I got around to give DemoCards.jl a go.

This is a mostly working version for GR alone, the titles look funny sometimes. Like Open/High/Low/Close

It would be nice to have different backends as tabs.

@BeastyBlacksmith
Copy link
Member Author

BeastyBlacksmith commented Dec 16, 2021

Backends

  • GR
  • PyPlot
  • PlotlyJS Errors with ERROR: BoundsError: attempt to access 10-element Vector{Float64} at index [-1:8] in example 41 when creating the png file (fixed in Fix fillranges with OffsetVectors for plotly Plots.jl#4006)
  • PGFPlotsX runs longer than I am willing to wait ( after interrupting example 45 the page is built, but some examples have broken links, e.g. "Unconnected-lines-using-missing-or-NaN" )
  • InspectDR
  • Gaston Errors with MethodError: no method matching iterate(::Nothing) (worked around by showing png output)
  • UnicodePlots Doesn't error, but also doesn't produce any useful output

Create a preview via

rm("docs/gallery/generated", recursive = true); generate_cards(BACKEND); preview_demos("docs/gallery")

to get titles for empty cards you'd need (JuliaDocs/DemoCards.jl#103)

rm("docs/gallery/generated", recursive = true); generate_cards(BACKEND); preview_demos("docs/gallery");  preview_demos("docs/gallery")

where BACKEND is e.g. :gr or :pgfplotsx.

@johnnychen94
Copy link
Contributor

I'm glad that you have worked it out a few backends.

Sorry it's near the end of this semester and I can't comment much right now; I'll continue the work on DemoCards in Jan.

@BeastyBlacksmith
Copy link
Member Author

This works now somewhat, but somehow all card links give a ERR_FILE_NOT_FOUND

* generate demo page per backend

Instead of generating all backend demos in one demo page, this commit
generates one page per backend. This makes exploring the demos easier.

- entry "id" is added to resolve the url-link issue
- notebook generation is disabled
- attributes are generated as hidden page

* Update PlotDocs.jl

Co-authored-by: Simon Christ <SimonChrist@gmx.de>
@BeastyBlacksmith
Copy link
Member Author

@johnnychen94 if I run make.jl I get the following error

ERROR: IOError: readdir("~/.julia/dev/PlotDocs.jl/docs/src/democards"): no such file or directory (ENOENT)
Stacktrace:
 [1] uv_error
   @ ./libuv.jl:97 [inlined]
 [2] readdir(dir::String; join::Bool, sort::Bool)
   @ Base.Filesystem ./file.jl:851
 [3] readdir
   @ ./file.jl:846 [inlined]
 [4] (::DemoCards.var"#107#111"{String, String, String, String, String, String, String, Vector{String}})()
   @ DemoCards ~/.julia/packages/DemoCards/w8V2k/src/generate.jl:214
 [5] (::var"#5#6")(cb::DemoCards.var"#107#111"{String, String, String, String, String, String, String, Vector{String}})
   @ Main ~/.julia/dev/PlotDocs.jl/docs/make.jl:103
 [6] foreach(f::var"#5#6", itr::Vector{Any})
   @ Base ./abstractarray.jl:2694
 [7] top-level scope
   @ ~/.julia/dev/PlotDocs.jl/docs/make.jl:101

@johnnychen94
Copy link
Contributor

johnnychen94 commented Mar 11, 2022

This might due to the fact that all demo files are generated from another function generate_cards. The callbacks generated by DemoCards are not so smart to figure out the real source path.

foreach(galleries_cb) do cb
    # URL redirection for DemoCards-generated gallery
    cb()
end

The callbacks are currently specific to redirect the URL of "Edit on Github" button. A workaround is to not use the generated callbacks and manually remove this button in the generated HTML files.

@BeastyBlacksmith
Copy link
Member Author

preview is up again: https://docs.juliaplots.org/previews/PR256/
I don't get, why I get the titles for skipped examples for GR but not for the other backends.

@BeastyBlacksmith
Copy link
Member Author

Also I have trouble getting that custom stylesheet working, it always complains about having an absolute path, though I did specify a relative path

Copy link
Contributor

@johnnychen94 johnnychen94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get, why I get the titles for skipped examples for GR but not for the other backends.

Would you mind pointing me to which case is broken? I'm not sure what is expected and what is not.

Co-authored-by: Johnny Chen <johnnychen94@hotmail.com>
@BeastyBlacksmith
Copy link
Member Author

Would you mind pointing me to which case is broken? I'm not sure what is expected and what is not.

On the GR cards it shows e.g. "DataFrames" and the blank card, which is desired and on the PlotlyJS cards its "plotlyjs_ref25" and same for the other backends.

johnnychen94 and others added 4 commits March 17, 2022 13:35
* use default order for demos

By default DemoCards sort the demos by their filenames.

* wrap source cards generation using IOBuffer

For unknown reasons, the generated files are still empty when calling
`makedemos` unless we wrap the `jl` file with IOBuffer.

* correct backend name titlecase

* try bulmagrid theme

* add a few DemoCards comments

* use empty card description

* debug: try to sleep a while after each demo generation

* restore order

Co-authored-by: Simon Christ <SimonChrist@gmx.de>
@BeastyBlacksmith
Copy link
Member Author

BeastyBlacksmith commented Mar 17, 2022

It seems I kinda broke github
feed84e not showing up here, can't reopen and opening a new PR errors out.

@johnnychen94
Copy link
Contributor

johnnychen94 commented Mar 17, 2022

It seems I kinda broke github

Yes it is was broken https://www.githubstatus.com/

@johnnychen94
Copy link
Contributor

It seems everything works now.

From a user's perspective, I still dislike the empty cards; it feels like something is broken.

@BeastyBlacksmith
Copy link
Member Author

From a user's perspective, I still dislike the empty cards; it feels like something is broken.

That's actually the point. To show what is working on which backend and what is not. This lets you quickly evaluate the expectation about the functionality of a backend by scrolling through the galllery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants