To test it out just create an example file with some PlantUML content.įigure 3. Live Preview AsciiDoc with embedded PlantUML opening asciidoc preview security settings In case you are running a local PlantUML server you may choose Allow insecure local content.įigure 1. To do this open your command palette (⌘+P, ctrl+P) and enter asciidoc preview security and choose Allow insecure content. The PlantUML images are served over and you must allow your preview to include data from unsafe sources. ⚠️ The downside of using the public server is that it does not offer SSL encrypted endpoints and you must weaken your VS Code security settings to preview correctly. So all you need to do in VS Code is to hop into your user settings and add the following entry This extension needs the :plantuml-server-url: attribute to be set in the AsciiDoc document to become active and parse PlantUML blocks. Under the hood the AsciiDoc VS Code extension relies on the javascript port of asciidoctor and the asciidoctor-plantuml.js extension. Build systems in the AsciiDoc ecosystem like Antora allow you to set attributes during the build process (see this example), so having a local editor that also injects these attributes is super handy. You could also set the attribute manually on each file but that is really something you do not want to do for generic configs like a server URL. These attributes will be injected into the preview. The option we will use for this feature is that allows you to set arbitrary AsciiDoc attributes. This post will use option 1 as it just works out of the box while following these instructions. Finally the third option of running it locally within docker is great if you are on the road or sitting somewhere without WiFi. Setting up a PlantUML server is rather easy if you are familiar with Docker, you can see an example setup in my blog post from march 2019. run plantuml/plantuml-server docker container on your local machineįor test cases option 1 works fine even if the server claims it does not store any data I would advise you to host your own server if you are working on anything professionally that is not open source.The third thing you need is a PlantUML server. □ The feature we are going to use here is rather new and shipped with 2.6.0 of the AsciiDoc plugin. Code -install-extension joaompinto.asciidoctor-vscode
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |