Improve behaviour of clicked images in Jupyter Book (suggestion: Modal Image?)
See original GitHub issueIs your feature request related to a problem? Please describe.
When users click an image in a jupyter book (regardless of how it is added), they are taken to a new page with just the image. There is no longer a sidebar (left, or TOC) and users have to click on the Back buttons to return to the content.
For an example, see this page for an example.
Current Behaviour after clicking an image:
Describe the solution you’d like
Suggested improvement (requires extra CSS and JS):
Describe alternatives you’ve considered
- Doing nothing when images are clicked (not sure if this is better or worse?)
This is more of a discussion feature request to see if people have other ideas.
Additional context
Unfortunately (and of course) the solution doesn’t actually work at the moment - to get it to do what I want, I ended up editing the HTML file after running jb build
. This is super bad, but works in a pinch for this issue.
I got the code for this from w3schools.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
Top GitHub Comments
aha!! That was it! No problem, and thank you - my students have you to thank for this!!
@chrisjsewell this is a sufficient workaround for me, so I’m happy to close this but if you think this should be supported natively (perhaps using a sphinx extension) we can leave it open or create a new issue to track it.
Thanks @whitead for updating the post! However, now it seems to do nothing.
No worries, the default click on image behaviour is good enough for my current project.
A completely separate issue: It seems from your demo that you were able to make the middle content column wider relative to the sidebars. I posted an issue on this because I couldn’t figure out how to do it.