kkeisuke / plantuml-editor

PlantUML online demo client
https://github.com/kkeisuke/plantuml-editor2
MIT License
434 stars 75 forks source link

Load plantUML from image link #9

Open ryardley opened 4 years ago

ryardley commented 4 years ago

Thanks for doing this the editor it looks great!

If I create a diagram say for github but then I want to edit it, is there a way to load the diagram back into the editor?

Say I have:

<img src="https://plantuml-server.kkeisuke.app/svg/[encoded-plantuml-code].svg"/>

How can I load this into the editor? I can't seem to find a way to do it.

Perhaps it would be good to make a route where it is possible to pass in the image url to load it into localStorage in the editor? Eg.

https://plantuml-editor.kkeisuke.com?img=https://plantuml-server.kkeisuke.app/svg/SyfFKj2rKt3CoKnELR1Io4ZDoSa700.svg

Then this could become a dialog that accepts a url?


I found a python script to decode the string perhaps it could be ported over to JS?

https://gist.github.com/ryardley/64816f5097003a35f9726aab676920d0

alinradut commented 4 years ago

Hey, I actually needed the same thing and I added it in my fork here: https://github.com/alinradut/plantuml-editor

Also disabled automatic local storage saves and added history pushstate/popstate.

I probably implemented this the wrong way as far as vue is concerned, but it works for me.