asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
326 stars 98 forks source link

Set kroki server url in settings #401

Closed Pierre-RA closed 3 years ago

Pierre-RA commented 3 years ago

Would it be possible to choose a custom kroki server url as a setting?

Is your feature request related to a problem? Please describe

I am currently working with a team using other IDEs than VScode, and they have this option. So all the adoc files generated do not have the kroki server url at the top of the document. Having to add this line myself each time I want to preview in VSCode is cumbersome. Furthermore, I am not sure my edits would be accepted with this edit.

Describe the solution you'd like

I would like to be able to edit the settings.json and add a custom kroki server url, so asciidoc can render kroki diagrams to the desired server.

anb0s commented 3 years ago

It is already possible via settings.json (no UI so far):

    "asciidoc.preview.attributes": {
        "kroki-server-url": "http://my-own-kroki:port"
    },

Shortcut Ctrl+, and search for asciidoc go to Preview: Attributes and select Edit in settings.json image

Pierre-RA commented 3 years ago

Amazing, thank you very much!

I've failed to spot this in documentation.

anb0s commented 3 years ago

You are welcome!

It's not described for this attribute, but you can set any attributes in this block, see README.md: asciidoc.preview.attributes: {}

It's same like calling asciidoctor -a my-attribute=my-value ...

All kroki related attributes are listed here: https://github.com/Mogztter/asciidoctor-kroki#Configuration