question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve behaviour of clicked images in Jupyter Book (suggestion: Modal Image?)

See original GitHub issue

Is 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:

Screen Shot 2020-09-01 at 11 11 39 PM

Describe the solution you’d like

Suggested improvement (requires extra CSS and JS):

Screen Shot 2020-09-01 at 11 12 56 PM

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:open
  • Created 3 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
firasmcommented, Sep 3, 2020

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.

0reactions
quantitative-technologiescommented, Aug 11, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Images and figures - Jupyter Book
Markdown figures combine colon style admonitions and HTML image parsing, to produce a “Markdown friendly” syntax for figures, with equivalent behaviour to the ......
Read more >
Bring your Jupyter Notebook to life with interactive widgets
This is a complete tutorial of how you can take full control of the widgets to create powerful dashboards. We will start with...
Read more >
28 Jupyter Notebook Tips, Tricks, and Shortcuts - Dataquest
Jupyter Notebook is a powerful tool for data analysis. Here are 28 tips, tricks, and shortcuts to turn you into a Jupyter notebooks...
Read more >
Three Ways of Storing and Accessing Lots of Images in Python
Free Bonus: Click here to get the Python Face Detection & OpenCV Examples ... Institute for Advanced Research image dataset, better known as...
Read more >
Custom Styling - The Turing Way
Jupyter Book works by converting Markdown syntax to HTML . Therefore, to improve the overall styling of the book, CSS rules should target...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found