Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

support plantuml diagrams #166

Open
richardwthompson opened this issue Dec 20, 2015 · 9 comments
Open

support plantuml diagrams #166

richardwthompson opened this issue Dec 20, 2015 · 9 comments

Comments

@richardwthompson
Copy link

plantuml (http://plantuml.com/) is a lightweight text language that turns simple text into diagrams.

I have started including plantuml text in my markdown documents as code blocks.

The following snippet is example plantuml text that generates a sequence diagram.

  plantuml
  @startuml 
  Alice -> Bob: Authentication Request 
  Bob --> Alice: Authentication Response
  Alice -> Bob: Another authentication Request 
  Alice <-- Bob: another authentication Response 
  @enduml

It would be awesome if markdown-preview-plus could detect if a code block is representing a plantuml diagram and actually generate and display the image as part of the preview

@appanp
Copy link

appanp commented Dec 21, 2015

+1 for this feature

@trickyEdecay
Copy link

+2 for this feature

@Galadirith
Copy link
Collaborator

@richardwthompson @appanp @trickyEdecay Thanks so much for the suggestion and I really apologise that its taken me so long to reply to you all.

We use markdown-it as our markdown parser and in theory its possible to extend it with a plugin to support plantuml. Unfortunately it doesn't look like such a plugin already exists and it is not something I would have the time to implement myself.

I will label this as a wont-implement however if anyone would like to implement it I would be happy to consider a PR. Thanks again @richardwthompson @appanp @trickyEdecay

@flomine
Copy link

flomine commented Oct 23, 2018

@lierdakil
Copy link
Collaborator

markdown-it-plantuml seems to send diagram code to the third-party service over the net, over plain HTTP no less. So, an obvious drawback is that it won't work offline, it will also eat into your data cap if you have one, and there are of course all the associated privacy concerns present. For that reason, I'm not too keen on including it with MPP. There's a fork that supposedly doesn't do that https://github.com/DeepElement/markdown-it-plantuml-offline, but it seems like it's not particularly well-maintained.

@mritzco
Copy link

mritzco commented Aug 30, 2019

Perhaps users could choose between the default third party or starting a local server, it takes one line with docker:

docker run -d --name plantuml -p 8080:8080 plantuml/plantuml-server:tomcat

The npm package @flomine mentioned, seems to support setting your own server.

const options = {
  generateSource: function generateSource(umlCode) {
    return `https://your.server/plant-uml/${yourEncodeFunction(umlCode)}`;
  }
}

Lately, we use Gitlab extensively and it has configurable support for plantuml, being able to preview the content with diagrams as it appears on Gitlab would be amazing!

https://docs.gitlab.com/ee/administration/integration/plantuml.html

@lierdakil
Copy link
Collaborator

lierdakil commented Aug 30, 2019 via email

@mritzco
Copy link

mritzco commented Aug 30, 2019

My apologies, I felt like constructively contributing to the conversation to improve a plug-in I like with functionality that a group of people including myself seem to want.
Thanks for the pointers to your cursory search.

@mritzco
Copy link

mritzco commented Dec 17, 2019

Someone already build a solution that works great out of the box:

https://shd101wyy.github.io/markdown-preview-enhanced/#/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants