hediet / vscode-drawio

This unofficial extension integrates Draw.io (also known as diagrams.net) into VS Code.
https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio
GNU General Public License v3.0
9.09k stars 414 forks source link

How to view specific page of multi-page *.drawio.svg in HTML #296

Open shah opened 2 years ago

shah commented 2 years ago

This is a fantastic extension, thanks for writing it!

I have a multi-page *.drawio.svg file -- single xyz.drawio.svg file with multiple tabs with multiple images. I am able to view and edit the xyz.drawio.svg in VS Code and it works great (very impressive integration!).

For publishing I use the xyz.drawio.svg as a source in <img> and <svg> tags. When I use <svg> tag in my HTML to show the *.drawio.svg file it shows the first page perfectly.

Is there a way to also have a second or multiple <svg> tags in my HTML to show other pages in the *.drawio.svg file or do I need to separate them into individual *.drawio.svg files?

ThysBrits commented 2 years ago

We would also like to know how to do this. We use this in our readme.md files on git and don't want to split the drawio files into separate files, just so we can show the different images on a readme file.

hediet commented 2 years ago

Unfortunately, for techincal reasons, there can only be one page in a single SVG...

I recommand you to split up the pages into multiple SVG files.

ThysBrits commented 2 years ago

I have come to that realisation, but still think this would be a very nice feature, instead of having to create multiple files. In DrawIO we can have all our images in one drawing file. So for now from DrawIO we will have to export to multiple files everytime.

hediet commented 2 years ago

Well, it is impossible: SVG files are static, a single SVG file can only contain a single image.

Draw.io could export all pages into a single SVG image & or the extension could export several SVGs for every page whenever you save.

richelin commented 2 years ago

This issue is duplicated by #333

I have made a suggestion that serve as a fix. See my comment here