numpy-tutorials icon indicating copy to clipboard operation
numpy-tutorials copied to clipboard

Tiled layout w/ images for front page

Open rossbar opened this issue 2 years ago • 3 comments

I had the idea to try to replicate a gallery-like layout on the landing page, similar to what you would get from e.g. sphinx-gallery. I think this is a really effective way to showcase the tutorials as the thumbnail helps summarize the tutorial and hopefully pique the readers' interest.

I couldn't find a tool that would create the gallery in the way I wanted with the necessary flexibility, so I created this manually by combining sphinx-panels for the thumbnail layout and the glue feature from myst_nb for creating the thumbnail content. The downside is that it takes a little extra effort to add a thumbnail (I will have to add the procedure to the contributing doc).

Since this is based on sphinx-panels I also added a couple examples of adding "badges" to the thumbnails as discussed in #7. Currently the badges are purely decorative, but we can (and should) make them linkable to indices of tutorials that share badges, though I'm not planning on pushing on that idea too much in this PR.

Anyways, feedback on the layout idea and the approach used to implement would be appreciated!

rossbar avatar Jan 29 '22 05:01 rossbar

af82e8e includes some very rudimentary instructions on creating the thumbnail with sphinx-panels. I only added it to the contributing.md so it's not in the readme, but I'd like to deduplicate all of that content in a followup PR.

rossbar avatar Feb 01 '22 03:02 rossbar

@rossbar I'd love to merge this, is there anything else you'd like to do before we put it in?

melissawm avatar Mar 16 '22 19:03 melissawm

One drawback of glue is that it does not currently support alt-text, which means some of the thumbnails on the front page wouldn't have alt-text. I'm not sure whether that's a blocker, but it'd be nice to have. The feature seems to be on myst-nb's radar and will hopefully be incorporated soon. It'd also be nice to fix the thumbnail size, but I haven't looked at that yet - again, whether that's a blocker or a follow-up :shrug: .

Aside from those issues, nothing else comes to mind.

rossbar avatar Mar 24 '22 20:03 rossbar

I'm going to go ahead and close this one, as it's now pretty out of date due to inaction on my end (e.g. sphinx-panels has been replaced with sphinx-design). I still think this is a worthwhile endeavor but so much has changed in the underlying tooling that it's probably worth a fresh start.

Thanks for the feedback!

rossbar avatar Jan 16 '23 06:01 rossbar