-
Notifications
You must be signed in to change notification settings - Fork 44
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
Feature Request: Allow for zooming of images generated #15
Comments
Patches are welcome. Perhaps it will need a trick to make UML images For now, |
I am thinking to maybe default |
Isn't it annoying that you find exactly the same image of the same size is |
For all diagrams that go inside a In that case clicking on a auto-downscaled image will make browser open it, this time in 100% size because the restricting container does not exist in that context. But as you say, clicking on images that fitted in the first place there will be no difference. Another use case is that when SVG in inside Unfortunately there is no way to know if the diagram will fit inside the container, it depends on HTML theme but also browser DPI and other things I think. I think it does not hurt to always wrap in |
I didn't know That said, neither the Sphinx core nor the graphviz extension appears to put So, instead of inserting |
Yeah I think that makes sense. So the extension just marks |
That sounds like a good approach to me. |
This is a possible JS custom script to use it with sphinxcontrib-images' lightbox when using the document.addEventListener('DOMContentLoaded', () => {
const imgs = document.querySelectorAll("p.plantuml > img");
let plantumlNo = 1;
for (const img of imgs) {
// Prepare link+lightbox
const link = document.createElement("a");
link.href = img.src;
link.dataset["lightbox"] = "plantuml-" + plantumlNo;
plantumlNo++;
// Reparent img tag
img.replaceWith(link);
link.append(img);
}
}); For me, however, this was not quite fitting since the lightbox does not have a zoom function. I found it more worthwhile to have the figure open in a new browser tab so it can be zoomed and panned with native browser functions: document.addEventListener('DOMContentLoaded', () => {
const imgs = document.querySelectorAll("p.plantuml > img");
for (const img of imgs) {
// Prepare link
const link = document.createElement("a");
link.href = img.src;
link.target = "_blank";
// Reparent img tag
img.replaceWith(link);
link.append(img);
}
}); |
As some UML diagrams can be very big it would be great if this plugin would allow for easy zooming on the images. Currently a
right-click
andShow Image
can be used in conjunction with the browser in-built zooming.It would be great to have something like the thumbnails and a lightbox as per this plugin:
https://pythonhosted.org/sphinxcontrib-images/#examples
The text was updated successfully, but these errors were encountered: