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

Failure to include PlantUML depending on the description method (v3.1.3) #765

Closed
iosory7 opened this issue Jul 24, 2023 · 5 comments
Closed

Comments

@iosory7
Copy link

iosory7 commented Jul 24, 2023

I love to use asciidoctor-vscode from v2.x.x, but I faced a trouble in v3.x.x use.

  • What you're trying to do

I tried to include plantuml file from asciidoc in different 3ways.

.
├── README.adoc
└── resources
    ├── main.puml
    ├── sub_a.puml
    └── sub_b.puml

README.adoc includes main.puml.
And then main.puml includes both sub_a.puml and sub_b.puml.

  • What happened

One include description (sample1) is succeeded, but other two descriptions (sample2, sample3) are failed.
"Failed" means include files (sub_a.puml and sub_b.puml) are not expanded into preview and html.

:includedir: {docdir}/resources
:imagesdir: {docdir}/resources
:imagesoutdir: {docdir}/resources

:allow-uri-read:
:data-uri:

:kroki-server-url: https://kroki.io
:kroki-fetch-diagram:
:kroki-plantuml-include-paths: {docdir}/resources

= test for asciidoctor.js + plantuml w/kroki

== test
docdir = {docdir} +
kroki-server-url = {kroki-server-url} +
kroki-plantuml-include-paths = {kroki-plantuml-include-paths} +

=== sample1

[plantuml,format="svg"]
....
include::{includedir}/main.puml[]
....

=== sample2

plantuml::{includedir}/main.puml[format="svg"]

=== sample3

[plantuml,format="svg"]
....
!include main.puml
....
@startuml
state NotShooting
  !include sub_a.puml

state Configuring
  !include sub_b.puml

scale 350 width
[*] --> NotShooting

@enduml
```:sub_a.puml
state NotShooting {
  [*] --> Idle
  Idle --> Configuring : EvConfig
  Configuring --> Idle : EvConfig
}
state Configuring {
  [*] --> NewValueSelection
  NewValueSelection --> NewValuePreview : EvNewValue
  NewValuePreview --> NewValueSelection : EvNewValueRejected
  NewValuePreview --> NewValueSelection : EvNewValueSaved

  state NewValuePreview {
     State1 -> State2
  }
}
  • What you expected to happen

Same outputs are expected in all 3ways.

I got the same outputs using command line as follows:
(I installed asciidoctor.js and asciidoctor-kroki manually)

asciidoctor -r asciidoctor-kroki README.adoc

Enviroment:
Ubuntu 22.04 @ WSL2(Win10)

@ggrossetie
Copy link
Member

kroki-fetch-diagram won't work in the VS code extension because it relies on unxhr to synchronously get the content. This is the same issue as: #731

Using :!kroki-fetch-diagram: produces the expected result:

image

@iosory7
Copy link
Author

iosory7 commented Aug 15, 2023

Thank you for your investigation and reply.

I tried to use :!kroki-fetch-diagram:, but the same results were obtained when using :kroki-fetch-diagram:...
image

If the :kroki-fetch-diagram: setting is the matter, shouldn't the include files not be expanded even with the sample1 method?

In my environment, kroki.io access is via proxy.
Could this lead to a difference in results between you and me?

@ggrossetie
Copy link
Member

In my environment, kroki.io access is via proxy.
Could this lead to a difference in results between you and me?

I don't think so... Could you please copy/paste what you get from "Help > About"?

@iosory7
Copy link
Author

iosory7 commented Mar 4, 2024

After that, I set up a kroki server on-premiss and set :kroki-server-url: to that server URL, and now it renders in each pattern of three! Thank you for your support.

@ggrossetie
Copy link
Member

I'm glad that it's working for you. Should we close this issue? Do you think we should add something in the documentation?

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

No branches or pull requests

2 participants