Skip to content

Improve visuals of the notebook gallery #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
drbenvincent opened this issue Oct 16, 2022 · 7 comments
Open

Improve visuals of the notebook gallery #447

drbenvincent opened this issue Oct 16, 2022 · 7 comments

Comments

@drbenvincent
Copy link
Contributor

The gallery is great, but there is definitely room for improvement. This is particularly noticeable since the core notebooks were added to the top of the page. The thumbnails are small and the full width of the central column of the page is not used.

I'm not sure, but can we fix this simply by editing the thumbnail size here?

def create_thumbnail(infile, width=275, height=275, cx=0.5, cy=0.5, border=4):

Anyone know where the formatting code for the core notebooks is?

Example 1

Screenshot 2022-10-16 at 11 57 50

Example 2

With a narrower browser window, the right bar becomes hidden (which is fine), but now we have 4 columns of notebooks rather than 3 for the regular notebooks. Not sure if this is set to fill available space.

Screenshot 2022-10-16 at 12 01 27

Tagging @OriolAbril , @twiecki, @reshamas

@reshamas
Copy link
Contributor

cc: @symeneses, in case you have any ideas on sphinx.

@OriolAbril
Copy link
Member

I suspect it is a css and/or javascript issue with sphinx gallery but I have no idea for how to fix it.

Anyone know where the formatting code for the core notebooks is?

The grid and cards for core notebooks has no formatting code in our codebase. We use https://sphinx-design.readthedocs.io/en/sbt-theme/ and everything works straight out of the box

@twiecki
Copy link
Member

twiecki commented Oct 20, 2022

I bet it's because not getting picked up in

nb_paths = glob("*/*.ipynb")

How are the NBs from the pymc repo included?

@OriolAbril
Copy link
Member

They are manually (both name and image) included in https://github.com/pymc-devs/pymc-examples/blob/main/examples/gallery.rst#core-notebooks. They use a different approach to generate the grid and card view though, as they are not in this repo they can't be included via the gallery extension.

@twiecki
Copy link
Member

twiecki commented Oct 25, 2022

I see, but we could place a thumbnail into the thumbnail dir manually, no?

@OriolAbril
Copy link
Member

We can define an image for the card manually yes and put that image in the thumbnail dir or anywhere else

@OriolAbril
Copy link
Member

I have added some custom images in #539. They are in _thumbnails/core_notebooks. I am not closing this issue though, I think it should be closed once someone makes those images have a more square ration so they look nicer or they are directly updated to something else that looks better and/or makes more sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants