-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 Syntax error in procedure definition using asciidoc #99
Comments
Hi, I think the issue is the PlantUML version asciidoc is using, not recognizing the @startuml
version
@enduml and see what it generates. It should be something like If it's an older version (older than 1.2020.*), try using the https://github.com/plantuml-stdlib/C4-PlantUML/tree/release/1-0 branch |
I have no experience using asciidoc but I assume there is a plugin that actually handles plantuml files. Did you obtain that image after running asciidoc on a diagram file or did you just use your local copy of plantuml? I suspect that internally, the asciidoc plugin uses a different version of plantuml. For example, I found this asciidoc plugin:
From what I can tell it should use whatever server is set inside the environment variable PLANTUML_URL, maybe that is not the defaut http://www.plantuml.com/plantuml server. The master branch is compatible with the current online version of PlantUML. |
AsciiDoc has indeed a plugin that handles PlantUML files and that plugin uses a different PlantUML version. The image I posted above was generated by my local copy of PlantUML. Meanwhile, the image produced by running AsciiDoc on a diagram file like the one suggested is: Could the issue be related with PlantUML 1.2020.06? |
In that case, until they update their version you can use my fork that has a branch compatible with that version. While testing it I corrected some bugs on it. It should have pretty much all the features of the latest branch here but internally uses Tried this diagram with the plantuml jar version 1.2020.06: @startuml
!include https://raw.githubusercontent.com/adrianvlupu/C4-PlantUML/1.2019.09/C4_Container.puml
!define DEVICONS https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/devicons
!define FONTAWESOME https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/font-awesome-5
' uncomment the following line and comment the first to use locally
' !include C4_Container.puml
!include DEVICONS/angular.puml
!include DEVICONS/dotnet.puml
!include DEVICONS/java.puml
!include DEVICONS/msql_server.puml
!include FONTAWESOME/server.puml
!include FONTAWESOME/envelope.puml
' LAYOUT_TOP_DOWN()
' LAYOUT_AS_SKETCH()
LAYOUT_WITH_LEGEND()
title Container diagram for Internet Banking System
Person(customer, Customer, "A customer of the bank, with personal bank accounts")
System_Boundary(c1, "Internet Banking") {
Container(web_app, "Web Application", "Java, Spring MVC", "Delivers the static content and the Internet banking SPA", "java")
Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality to cutomers via their web browser", "angular")
Container(mobile_app, "Mobile App", "C#, Xamarin", "Provides a limited subset of the Internet banking functionality to customers via their mobile device", "dotnet")
ContainerDb(database, "Database", "SQL Database", "Stores user registraion information, hased auth credentials, access logs, etc.", "msql_server")
Container(backend_api, "API Application", "Java, Docker Container", "Provides Internet banking functionality via API", "server")
}
System_Ext(email_system, "E-Mail System", "The internal Microsoft Exchange system", "envelope")
System_Ext(banking_system, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
Rel(customer, web_app, "Uses", "HTTPS")
Rel(customer, spa, "Uses", "HTTPS")
Rel(customer, mobile_app, "Uses")
Rel_Neighbor(web_app, spa, "Delivers")
Rel(spa, backend_api, "Uses", "async, JSON/HTTPS")
Rel(mobile_app, backend_api, "Uses", "async, JSON/HTTPS")
Rel_Back_Neighbor(database, backend_api, "Reads from and writes to", "sync, JDBC")
Rel_Back(customer, email_system, "Sends e-mails to")
Rel_Back(email_system, backend_api, "Sends e-mails using", "sync, SMTP")
Rel_Neighbor(backend_api, banking_system, "Uses", "sync/async, XML/HTTPS")
@enduml and it outputs |
Yes, the the 2019.09 branch of your PlantUML fork worked for me. The diagram was correctly inserted in the AsciiDoc. Thanks, @adrianvlupu! |
As as side note, the direct generation of the diagram from the |
Glad it helped Sadly the version that works with asciidoc doesn't work with the newer version of plantuml so you have to switch includes. Can you tell me what plugin you use for asciidoc? Maybe there is a way to configure it to use the latest plantuml version |
I use the asciidoctor-intellij-plugin. As far as I can tell from the plugin's source code, it seems to be using asciidoctor-diagram version 2.0.5 to add PlantUML diagrams to AsciiDocs. asciidoctor-diagram 2.0.5 in turn uses PlantUML 1.2020.06, based on asciidoctor-diagram's changelog. It makes sense that 1.2020.06 shows the syntax error mentioned in this issue, as according to PlantUML news, It looks like asciidoctor-diagram 2.0.6 uses PlantUML 1.2020.21. One solution would probably be for the plugin to switch to that asciidoctor-diagram version. |
Anyway, everything seems to point to this issue not being caused by C4-PlantUML. |
@joao-martins-tdx I think this issue can now be closed. Are you okay with that? |
@Potherca Yes, you may close it. It turns out that the issue wasn't actually caused by C4-PlantUML, but by asciidoctor-diagram pre 2.1.0 using an old version of PlantUML that doesn't support procedures. Everything is working correctly in asciidoctor-diagram 2.1.0. Thank you for your support 🙏 |
When I import plantuml diagram from an asciidoc file is given me a syntax error in C4.plum specifically on HIDE_STEREOTYPE procedure creation.
My plantuml diagram looks like this:
And I import it in asciidoc file like this:
The error is the following:
Versions:
asciidoctor-maven-plugin --> 2.1.0
asciidoctorj --> 2.4.2
asciidoctorj-diagram --> 2.0.5
Regards Carolina
The text was updated successfully, but these errors were encountered: