Skip to content

DOC: Clarify SVG hyperlink behavior in gallery hyperlinks example#31497

Open
jayaprajapatii wants to merge 1 commit intomatplotlib:mainfrom
jayaprajapatii:fix-svg-hyperlink-doc
Open

DOC: Clarify SVG hyperlink behavior in gallery hyperlinks example#31497
jayaprajapatii wants to merge 1 commit intomatplotlib:mainfrom
jayaprajapatii:fix-svg-hyperlink-doc

Conversation

@jayaprajapatii
Copy link
Copy Markdown
Contributor

@jayaprajapatii jayaprajapatii commented Apr 13, 2026

Closes #31452

Summary

Show the generated SVG outputs in the hyperlinks example by embedding them directly in the documentation.

Problem

The example generated SVG files with hyperlinks, but they were not visible or interactive in the documentation, making the behavior unclear.

Solution

The example still generates SVG files as before.
The documentation now embeds these SVGs using HTML (<object>), so that the hyperlinks inside the SVG remain interactive.

Impact

  • Makes SVG outputs visible in the documentation
  • Preserves hyperlink interactivity (clickable elements)

@github-actions github-actions Bot added the Documentation: examples files in galleries/examples label Apr 13, 2026
Copy link
Copy Markdown
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

This is not the intended solution for #31452

Instead, we want to show the SVG images. There are to possible approaches

  • the difficult one: make sphinx-gallery (optionally) support creating SVG output.
  • the hacked one: render the SVG image locally and add it as a static image to the example.

@jayaprajapatii
Copy link
Copy Markdown
Contributor Author

@timhoffm Thanks for the clarification!

I understand that the goal is to actually show the SVG output rather than just explain the behavior. I’ll work on implementing the second approach by rendering the SVG locally and adding it as a static image to the example.

Copy link
Copy Markdown
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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