Skip to content

DOC: Add thumbnail for hyperlinks_sgskip gallery example#31377

Open
abhinavjha98 wants to merge 3 commits intomatplotlib:mainfrom
abhinavjha98:doc/hyperlinks-thumbnail
Open

DOC: Add thumbnail for hyperlinks_sgskip gallery example#31377
abhinavjha98 wants to merge 3 commits intomatplotlib:mainfrom
abhinavjha98:doc/hyperlinks-thumbnail

Conversation

@abhinavjha98
Copy link

PR summary

Adds a thumbnail for the hyperlinks_sgskip gallery example, which was missing one (showing a placeholder blob instead).

The example uses the SVG backend and saves output directly to disk, so it carries the _sgskip suffix meaning sphinx-gallery does not execute it automatically. Since the image scraper cannot capture a thumbnail from it, this PR manually sets one using sphinx_gallery_thumbnail_path.

The thumbnail is an SVG screenshot of the grayscale image plot produced by the example.

Closes part of #17479

Abhinav Jha added 3 commits March 25, 2026 11:57
Set a dedicated gallery thumbnail path and add a compact PNG thumbnail for the hyperlinks sgskip example to address missing-docs thumbnail coverage.

Made-with: Cursor
Point the gallery thumbnail path to a committed SVG generated from the example output so the sgskip example has a stable docs thumbnail without changing execution behavior.

Made-with: Cursor
@github-actions
Copy link

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide.
Please let us know if (and how) you use AI, it will help us give you better feedback on your PR.

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@story645
Copy link
Member

Can you just set the path to the svg produced by the PR? Or if you're gonna use a screenshot, can it somehow highlight the URL part since that's what's important about this example?

@abhinavjha98
Copy link
Author

Can you just set the path to the svg produced by the PR? Or if you're gonna use a screenshot, can it somehow highlight the URL part since that's what's important about this example?

I set sphinx_gallery_thumbnail_path to a committed SVG (doc/_static/hyperlinks_thumbnail.svg) generated from the example output. Since this example is _sgskip, build-time scatter.svg is not guaranteed to exist, so referencing a checked-in SVG is more reliable. I can also provide an annotated screenshot if preferred, but I used the generated SVG to stay closest to the example output.

@story645
Copy link
Member

Since this example is _sgskip

Does it have to be sgskip if it's given a manual thumbnail path?

@abhinavjha98
Copy link
Author

Yes, it still needs to be _sgskip regardless of the manual thumbnail path. The _sgskip suffix tells sphinx-gallery to skip executing the script during the docs build — this is necessary because the example saves output directly to disk (scatter.svg, image.svg) using the SVG backend, which sphinx-gallery cannot capture automatically. The sphinx_gallery_thumbnail_path directive only controls which image is used as the gallery thumbnail; it has no effect on whether the script is executed. So even with a manual thumbnail, the execution-related reasons for skipping remain.

@melissawm melissawm moved this to Needs review in First Time Contributors Mar 25, 2026
@melissawm melissawm moved this from Needs review to Waiting for author in First Time Contributors Mar 25, 2026
@story645
Copy link
Member

The _sgskip suffix tells sphinx-gallery to skip executing the script during the docs build — this is necessary because the example saves output directly to disk (scatter.svg, image.svg)

Why is this necessary? Why does sphinx-gallery care if this is skipped? What happens if you don't skip this?

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

Labels

Projects

Status: Waiting for author

Development

Successfully merging this pull request may close these issues.

3 participants