JuliaDocs / DemoCards.jl

Let's focus on writing demos
MIT License
65 stars 14 forks source link

Add generate_cover (default __) and execute (default true) options #131

Closed frankier closed 10 months ago

frankier commented 1 year ago

I haven't added any documentation or tests yet, but I can along with revising the details of the implementation.

This PR addresses two issues.

  1. Currently examples are given an initial run in case they generate images. I am not sure this should be the default behaviour. I did a quick check and the majority of the listed users do generate images, however I believe that many potential users would not given many examples do not generate a single identifiable image as part of their execution. I think this behaviour makes sense as opt-in because you already have to arrange for the image generation, so opting in at this point seems reasonable. I realise this is a breaking change, but I thought it was worth bringing up.
Library Cover
AlgebraOfGraphics.jl Generated
Augmentor.jl Generated
Bokeh.jl Static
FractionalDiffEq.jl Static
LeetCode.jl None
Images.jl Generated  
ImageMorphology.jl Generated  
ReinforcementLearning.jl Generated
Plots.jl Generated
PSSFSS.jl Generated
  1. Currently examples are always executed. In the case of some examples including interactive examples that e.g. readlines() execution doesn't really make much sense. This can also be the case for interactive plots. So the PR adds a single option execute which is true by default. Setting it to false disables all execution, but of course users can still execute the script or notebook on their machine or on binder.
johnnychen94 commented 1 year ago

BTW, for pages with non-cover images, we'd probably need to provide a theme template for people to use. I only provided the "None" theme version, but maybe you have other ideas?

frankier commented 10 months ago

Okay! I've updated this. Sorry for the long gap. I didn't quite initially understand your feedback on the first read and promptly forgot about this PR.

I've changed the default for generate_cover to depend on whether cover is specified. Now it won't try to generate a cover if one is specified explicitly, otherwise it will.

The stuff about ugly blank covers/inappropriate templates is understood now. I'm putting together other PRs for that so hopefully they can be merged independently.