Credit to https://blog.anoff.io/2019-05-08-asciidoc-plantuml-vscode/
[NOTE]
====
This requires a PlantUML server. There are multiple options:
. use the public plantuml.com/plantuml server
. deploy your own plantuml-server
. run plantuml/plantuml-server docker container on your local machine
====
We will go with option 1
WARNING: This is a potential security risk as the rendered images are served via http, ASAM assumes no liability for taking this route.
The option we will use for this feature is asciidoc.preview.attributes that allows you to set arbitrary AsciiDoc attributes. These attributes will be injected into the preview. 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. 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.
Under the hood the AsciiDoc VS Code extension relies on the javascript port of asciidoctor and the asciidoctor-plantuml.js extension. This extension needs the :plantuml-server-url: attribute to be set in the AsciiDoc document to become active and parse PlantUML blocks.
So all you need to do in VS Code is to hop into your user settings and add the following entry
The PlantUML images are served over http:// and you must allow your preview to include data from unsafe sources. To do this open your command palette (⌘+P, ctrl+P) and enter asciidoc preview security and choose Allow insecure content. In case you are running a local PlantUML server you may choose Allow insecure local content.