asciidoctor / asciidoctor-intellij-plugin

AsciiDoc plugin for products on the IntelliJ platform (IDEA, RubyMine, etc)
https://intellij-asciidoc-plugin.ahus1.de/
Apache License 2.0
342 stars 145 forks source link

Cannot include external plantuml files with !includeurl #1614

Closed Maxeh closed 1 month ago

Maxeh commented 2 months ago

Observed vs. expected behavior

I want to include a .puml file which includes external .puml files with !includeurl. I can show this file just fine with the plantuml plugin in Intellij, however, it cannot be included in the adoc file, a syntax error is thrown. Apparently adoc cannot parse the external file correctly:

image

Steps to reproduce

Ascidoc:

[plantuml]
....
include::../feature/infrastructure/test.puml["My test PUML"]
....

The complete (minimal) puml file which is included:

@startuml "test"
!define AzurePuml https://raw.githubusercontent.com/plantuml-stdlib/Azure-PlantUML/release/2-2/dist
!includeurl AzurePuml/AzureCommon.puml
!includeurl AzurePuml/DevOps/AzurePipelines.puml

left to right direction
AzurePipelines(ado, "CI/CD\nAzure Pipelines", "Global")
@enduml

Environment

Plugin Version: 0.41.13 IntelliJ IDEA 2024.1 (Ultimate Edition) Build #IU-241.14494.240, built on March 28, 2024

ahus1 commented 1 month ago

It took me a moment to figure out your setup for this issue:

It seems you've enabled Kroki diagram rendering in the plugin's settings. It seems that Kroki doesn't allow to include remote diagrams, and therefore shows the 400 error message.

When you choose to render the diagrams in the AsciiDoc plugin not with Kroki, but the Asciidoctor Diagram and PlantUML directly, the preview will work.

See be low for the diagram settings, and the rendered preview:

image

The preview:

image

Please let me know if this resolves your problem, and if this issue can be closed.

Maxeh commented 1 month ago

Thanks for the explanation, it works now. I was not even aware that Kroki is a cloud service - disabled now.

ahus1 commented 1 month ago

Thank you for the timely feedback. Closing this issue.

PS: Kroki isn't enabled by default. If you still like it, you can run it as containers locally: https://intellij-asciidoc-plugin.ahus1.de/docs/users-guide/features/preview/diagrams.html#using-a-local-kroki-instance