How to display blockdiagram in asciidoc preview?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to display blockdiagram in asciidoc preview?

siddjain
Hello

I have a blockdiagram (http://blockdiag.com/en/blockdiag/examples.html#simple-diagram) in my asciidoc. Example

blockdiag {
   A -> B -> C -> D;
   A -> E -> F -> G;
}

But this does not render in the asciidoc preview. How can I make it render in asciidoc preview? I have tried the preview for both Atom as well as Brackets. As I have lot of diagrams, I would like them to see in the preview before converting to PDF. I am able to see the diagram in PDF. Thanks

Sid
Reply | Threaded
Open this post in threaded view
|

Re: How to display blockdiagram in asciidoc preview?

abelsromero
Not all diagrams are supported out-of-the-box by all previews, and some like blockdiag require to install the specific converter and have it in the system path*.
In this case, I tested vscode and intellij and it only worked in the latest once I install blockdiag :/

If you can render the pdf from shell, that means you have the commands installed, so my suggestion is to ask in the respectives repositories of the previewers to support it.


* There are third party options like kroki that rely on webservices, but I don't know if some previewer uses it.
Reply | Threaded
Open this post in threaded view
|

Re: How to display blockdiagram in asciidoc preview?

Alexander Schwartz
Using the IntelliJ plugin you have two options:

  1. Use a locally installed executable for blockdiag
  2. Use Kroki, a cloud service to render the diagram for preview.

While using the locally installed version is the default, you'll need to go to the settings and enable Kroki support. This will use a cloud service, but you can also host your own instance of Kroki (although I have never done this).

The AsciiDoc preview plugin for Chrome (and Firefox) also has the Kroki option, and it also needs to be enabled in the settings of the plugin.

The example I used:

[blockdiag]
----
blockdiag {
A -> B -> C -> D;
A -> E -> F -> G;
}
----
Alexander Schwartz (alexander.schwartz@gmx.net)
https://www.ahus1.de