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 diagram with includes is not rendered #233

Closed
anb0s opened this issue Nov 8, 2019 · 7 comments
Closed

PlantUML diagram with includes is not rendered #233

anb0s opened this issue Nov 8, 2019 · 7 comments
Labels
💬 discussion Disccussion on new features, projects, etc... ✨ enhancement

Comments

@anb0s
Copy link
Contributor

anb0s commented Nov 8, 2019

Is your feature request related to a problem? Please describe

If i'm using PlantUML diagrams with includes the includes are not loaded before sending to PlantUML server. Therefore server cannot generate the diagram, because include cannot be resolved.

[plantuml, Name, png]
....
!include puml/StyleClass.puml
box "Sync"
  participant Convertor
  participant Session
end box
....

image

Describe the solution you'd like

The includes have to be resolved and included to temporary file that is sended then to server instead of original content.

Describe alternatives you've considered

Use local planuml.jar if possible?

@anb0s anb0s added 💬 discussion Disccussion on new features, projects, etc... ✨ enhancement labels Nov 8, 2019
@DBuret
Copy link

DBuret commented Dec 24, 2019

the include syntax you are using is a plantuml syntax. that means that the ascidoctor engine will not understand it. So it sends it as-is to plantuml server.

if you want asciidoctor to process the include, you must use asciidoctor syntax:

include::puml/StyleClass.puml

Or you can ask the plantuml to use its syntax to fetch the file by itself, serving it throug http(s):
include: https://raw.githubusercontent.com/user/repo/branch/path/file
noet this will work only on publix repo (plantuml server will not be able to log into a private repo to read your file)

@anb0s
Copy link
Contributor Author

anb0s commented Dec 26, 2019

@DBuret Thanks! Yes i know all this. BUT: If the included PlantUML file also uses other includes e.g. for style etc. it will not work and i do not want to change the PlantUML files for AsciiDoc usage only.

In the asciidoc file:
include::puml/Sync.puml

In the Sync.puml file:

!include puml/StyleClass.puml
box "Sync"
  participant Convertor
  participant Session
end box

It would be good if some kind of "include processor" for PlantUML can be implemented, e.g. see the other plugin "https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml" that implements this (qjebbs/vscode-plantuml#260). May be it can be used directly or done same way before sending the file to PlantUML server etc.

I do not know if this should be done in the editor plugin or in the asciidoctor_js or in the asciidoc-diagram module of asciidoctor...

P.S.: The usage of the local plantuml server instead of plantuml.jar is preferable, because it is very fast and the only missing feature is the include support as it's good to have separated PlantUML files for styles, other digrams etc.

@danyill
Copy link
Contributor

danyill commented Jan 24, 2020

I think is an upstream issue and given that it's been filed upstream, can we close it here?

It doesn't seem to have gained much traction yet however I don't think this extension can take on the role of implementing language features.

@anb0s
Copy link
Contributor Author

anb0s commented Jan 24, 2020

Yes, it can be closed as we need new asciidoctor-plantuml.js with patched plantuml-encoder, but there is no answer from maintainer after long time :(

I think forked version of asciidoctor-plantuml.js + plantuml-encoder will not be accepted as dependency by this plugin?

We have lot of users working with plantuml server (as it's much faster then plantuml.jar) and preview is not working if AsciiDoc is used...

@gdw2
Copy link

gdw2 commented Mar 12, 2020

Given the unresponsiveness of the maintainer, I think we should at least consider adopting the fork in the meantime.

@anb0s
Copy link
Contributor Author

anb0s commented Mar 14, 2020

@gdw2 yes, i've created own version, but there are two problems:

  • i've created a fork and created new version but it has an integration issue
  • in the meantime the maintainer reviewed the PR from the original fix and had minor comments, but the PR was closed by the original author and was not finished

I've no experience with JS and it would be good if somebody can help to rework the original patch. Please comment in the other projects two projects...

@anb0s
Copy link
Contributor Author

anb0s commented May 10, 2020

As asciidoctor-plantuml is no longer maintained we are switching to asciidoctor-kroki and add include support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 discussion Disccussion on new features, projects, etc... ✨ enhancement
Projects
None yet
Development

No branches or pull requests

4 participants