Skip to content
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

PlantUML support #379

Closed
181502 opened this issue Jan 30, 2019 · 10 comments
Closed

PlantUML support #379

181502 opened this issue Jan 30, 2019 · 10 comments
Labels
enhancement New feature or request plugin candidate This should probably be implemented via a third-party plugin

Comments

@181502
Copy link

181502 commented Jan 30, 2019

Feature description

Just as mermaid is supported, I would like to see plantuml diagrams(plantuml.com) supported as well

Feature motivation

Would make it possible to add uml digrams to noites

@fabiospampinato fabiospampinato added the enhancement New feature or request label Jan 30, 2019
@fabiospampinato fabiospampinato added the plugin candidate This should probably be implemented via a third-party plugin label Feb 21, 2019
@fabiospampinato
Copy link
Member

fabiospampinato commented Jan 16, 2020

@kulkarniamit Just add your "👍" to the main post, "+1" comments just waste people's time.


I've taken a closer look at this and it seems that PlantUML is a Java application, and JS plugins that enable support for it, like this work pretty weirdly, basically encoding diagrams in a url that plantuml.com will then render.

On one hand this adds almost nothing to the codebase, on the other end who wants to wait for networks roundtrips, have this not work when offline, and having their diagrams transparently sent to a server somewhere? 🤔

If there was a WASM or pure-JS version of PlantUML this could be implemented a lot better I think 🤔

@fabiospampinato fabiospampinato changed the title Plantuml support PlantUML support Jan 16, 2020
@fabiospampinato
Copy link
Member

Reference Docker configuration, in case we decide to set-up our own PlantUML server: https://docs.gitlab.com/ee/administration/integration/plantuml.html#docker

@davidmichaelhuber
Copy link

In case this feature goes live I personally would really appreciate if there is some kind of mechanism that ensures that every user knows about that external rendering is applied to one's notes. For example that one has to explicitly opt-in for PlantUML external rendering in the settings.

@fabiospampinato
Copy link
Member

fabiospampinato commented Feb 21, 2020

@davidmichaelhuber IMHO the ideal scenario is:

  • Somebody comes up with a WASM PlantUML implementation that I can embed in the app and render everything locally.

As that's unlikely to happen I'd argue the next best thing is:

  • I'll host the PlantUML renderer under https://plantuml.notable.md, so that no data is sent anywhere I don't control.
  • PlantUML diagrams are rendered by default using that endpoint.
  • Options are added for disabling PlantUML rendering and/or providing an alternative endpoint, so that the renderer could be self-hosted.

I'd rather not disable this by default for the following reasons:

  • As far as I can see there really are no embeddable alternative renderers, so people who are using PlantUML (vscode extension, markdown-it plugin etc.) are already having their diagrams sent somewhere.
    • This is IMHO less of a problem with my proposed implementation as I will be controlling the endpoint.
  • Burying this feature under a setting switch will most probably mean that some people that will like this feature will never discover it and those who discover it will be bothered by this extra step they'll have to take to have the feature working.
    • And realistically how many people who'd like this feature and know about the setting switch will not enable it? I think it would make more sense to make this opt-out rather.

Just my 2c, if any PlantUML users would like to share their thoughts I'd be interested in earing those.

@davidmichaelhuber
Copy link

Factoring in the points you stated another opt-in strategy could be to capture ```plantuml blocks and show some sort of a little warning icon next to them. Expanding the icon then can show a description that states that external rendering is needed for PlantUML as well as a button to enable that feature.

I personally just like it much more having to opt-in instead of having to opt-out for features that affect an applications local boundaries.

@fabiospampinato
Copy link
Member

fabiospampinato commented Feb 22, 2020

@davidmichaelhuber That sounds like a potentially good idea 🤔 Maybe that's the best option, however how many users that will have that icon/button/link shown to them would not click it? I can't imagine that that number being below 1% probably.

@davidmichaelhuber
Copy link

I would argue that a yellow or maybe even a high contrast (to the background) icon might be pretty noticeable inside of the markdown editor pane where one would only expect plain text. Also another indicator for the user will be the fact that their PlantUML didn't actually render. So the same warning icon might make sense in the rendered view.

The same opt-in mechanism then could also be used for external renderers that might be requested in the future.

@fabiospampinato
Copy link
Member

fabiospampinato commented Mar 20, 2020

Done.

I'll post a preview in the subreddit about this as soon as I have a few more features to showcase too.

image

I haven't added a confirmation dialog as I don't think that would be very useful, I'm however hosting the renderer myself for added privacy: http://plantuml.notable.md

I'll add an option for supplying a custom renderer url, which other than enhancing privacy would make this work faster if the renderer is hosted locally.

@0xsajjad
Copy link

0xsajjad commented Aug 12, 2022

Any hopes about this feature will be available anytime soon. No release after 20 Jan 2020, rendering isn't working for the insider version.

@fabiospampinato
Copy link
Member

Any hopes about this feature will be available anytime soon. No release after 20 Jan 2020, rendering isn't working for the insider version.

The plantuml server is a big finicky at times, I haven't narrowed down why, you can try changing the endpoint from the setting to the official one, which I believe is either https://www.plantuml.com/plantuml or https://www.plantuml.com. If that doesn't work after a restart please open a separate issue as that's a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin candidate This should probably be implemented via a third-party plugin
Development

No branches or pull requests

4 participants