Closed agrexgh closed 10 months ago
:kroki-fetch-diagram:
is not supported when running Asciidoctor Kroki in VS Code. The reason is that unxhr
does not work in VS Code: https://github.com/ggrossetie/unxhr/issues/98
With the following configuration:
"asciidoc.preview.asciidoctorAttributes": {
"allow-uri-read": true,
"kroki-fetch-diagram": true
}
Asciidoctor Kroki won't work with either kroki.io or local instance.
I've updated the documentation: https://github.com/asciidoctor/asciidoctor-vscode/pull/820
@ggrossetie Thank you for replying.
I'd like to use local kroki to preview plantuml diagrams on asciidoc preview. I understood ‘kroki-fetch-diagram‘ is necessary to do that, but unfortunately it's not supported. Do you have any alternative solutions to preview plantuml diagrams with local kroki than ‘kroki-fetch-diagram‘?
I'd like to use local kroki to preview plantuml diagrams on asciidoc preview. I understood ‘kroki-fetch-diagram‘ is necessary to do that, but unfortunately it's not supported.
You don't need kroki-fetch-diagram
to use a local Kroki instance. This option is useful for publishing an HTML document without having a dependency on a Kroki instance. If it's just for local preview, there's no need for kroki-fetch-diagram
. Otherwise, I recommend exporting to HTML outside of VS Code using the asciidoctor
command line (where the kroki-fetch-diagram
will work).
Did you understand that the option was necessary while reading the documentation? Maybe we need to clarify that.
@ggrossetie I understand that ‘kroki-fetch-diagram‘ was necessary based on the actual behavior of the extension, not from the documents.
I'll write "actual behavior". With ‘kroki-fetch-diagram‘ diagrams were shown in the preview and without it diagrams weren't shown. The version of this extension is v3.1.7.
Do you still reproduce this issue with the latest version (3.1.8)?
Could you please try to reproduce in a clean environment:
Thanks!
@ggrossetie I tested with below
{
"asciidoc.extensions.enableKroki": true,
"asciidoc.preview.asciidoctorAttributes": {
"kroki-server-url": "http://localhost:8000"
}
}
With v3.1.8
: It works! The diagrams in preview was shown.
With v3.1.7
: It doesn't work.
It seems this issue was fixed in v3.1.8
,
I'd like to know what issue fixed this issue.
Do you know this?
I made a fix to allow the Kroki server defined in the preview attributes (by adding it to the CSP rules)
Please note that it should also work in 3.1.7 if you disable the preview security.
Please note that it should also work in 3.1.7 if you disable the preview security.
Excuse me, could you tell me how to disable the.preview security and enable it?
When the preview is opened, open the command palette (https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_command-palette) and search for "Manage Preview Security Settings".
Thank you, I'll try it after a few days!
When the preview is opened, open the command palette (https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_command-palette) and search for "Manage Preview Security Settings".
I tried this. When preview security setting was "Allow insecure local content", the preview of plantuml was shown in also v3.9.7! Thank you for telling it to me!
My problems were all solved:)
Please provide details about:
What you're trying to do I'd like to preview plantuml diagram with this extension with local kroki
What happened
What you expected to happen The preview shows plantuml diagram with target
Please share relevant sample content. Or better yet, provide a link to a minimal reproducible example.
How to reproduce 1.
docker run --rm -it -p 8000:8000 yuzutech/kroki
2.Set below to settings.jsonOpen the adoc file. The content is below.
We'll also need your system information (get it under "Help" -> "About" in VS Code). Share the installed extension version (Ctrl + Shift + X or Cmd + Shift + X on macOS).
v3.1.7
Provide steps to reproduce the issue and, if applicable, add screenshots to make it easier to understand. There is also extension logs where errors show up. Go to the Command Palette and select the option 'Developer: Open Extension Logs Folder'. The screenshot shows that vs code doesn't show the Figure "with target" 's preview but the Figure "without target".
Look among the logs there for errors.