As a developer, I work with the IntelliJ IDEA development environment, as do many other developers. I don’t want to discuss its many advantages for developers here, but rather how to use Playfair with the AsciiDoc plugin. Playfair is a small library that allows you to embed charts in AsciiDoc documents without the need for additional tools.
The AsciiDoc fragment shown here generates a bar chart with bars sorted by size.
[barchart,float=left] ---- data: 31451, 51253, 43149, 32204, 36140, 3078, 54861 index.labels: Freemarker, FreshMarker, Mustache, Handlebars, Velocity, Thymeleaf, Pebble palette: funky opacity: 255 127 sorted: on ----
Of course, it would be nice if the charts were already visible when the AsciiDoc files are displayed within IntelliJ IDEA. Until now, I haven’t had much hope that this wish would come true. Especially since support for Asciidoctor Diagram and Kroki is integrated explicitly into the AsciiDoc plugin.
A brief note in an online forum put me on the right track. Custom extensions can be integrated if a .asciidoctor/lib directory with the necessary libraries is provided in your own IntelliJ IDEA project.
In our case, these are the following files.
echosvg-awt-util-2.3.jar echosvg-codec-2.3.jar echosvg-constants-2.3.jar echosvg-i18n-2.3.jar echosvg-svggen-2.3.jar echosvg-util-2.3.jar playfair-asciidoctor-1.0.0.jar playfair-core-1.0.0.jar
If you now open an AsciiDoc file with embedded charts, you will see the following in IntelliJ IDEA.

All changes in the chart description are automatically updated in the preview. Have fun documenting!