GithubHelp home page GithubHelp logo

Comments (11)

agrexgh avatar agrexgh commented on September 25, 2024 1

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:)

from asciidoctor-vscode.

ggrossetie avatar ggrossetie commented on September 25, 2024

:kroki-fetch-diagram: is not supported when running Asciidoctor Kroki in VS Code. The reason is that unxhr does not work in VS Code: ggrossetie/unxhr#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: #820

from asciidoctor-vscode.

agrexgh avatar agrexgh commented on September 25, 2024

@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‘?

from asciidoctor-vscode.

ggrossetie avatar ggrossetie commented on September 25, 2024

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.

from asciidoctor-vscode.

agrexgh avatar agrexgh commented on September 25, 2024

@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.

from asciidoctor-vscode.

ggrossetie avatar ggrossetie commented on September 25, 2024

Do you still reproduce this issue with the latest version (3.1.8)?

Could you please try to reproduce in a clean environment:

  • no other extension
  • reset your user and workspace settings
  • install latest version of the AsciiDoc extension
  • enable Kroki
  • create a simple Asciidoc file with a diagram

Thanks!

from asciidoctor-vscode.

agrexgh avatar agrexgh commented on September 25, 2024

@ggrossetie
I tested with below

  • no other extension
  • reset user settings and add below(This includes enabling kroki.)
{
  "asciidoc.extensions.enableKroki": true,
  "asciidoc.preview.asciidoctorAttributes": {
    "kroki-server-url": "http://localhost:8000"
  }
}
  • I think the adoc content which I quoted in this issue origin is enough simple.

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?

from asciidoctor-vscode.

ggrossetie avatar ggrossetie commented on September 25, 2024

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.

from asciidoctor-vscode.

agrexgh avatar agrexgh commented on September 25, 2024

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?

from asciidoctor-vscode.

ggrossetie avatar ggrossetie commented on September 25, 2024

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".

from asciidoctor-vscode.

agrexgh avatar agrexgh commented on September 25, 2024

Thank you, I'll try it after a few days!

from asciidoctor-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.