Embedding Diagrams in DITA topics using PlantUML
Read time: 2 minute(s)
PlantUML is a neat library that takes textual descriptions of diagrams and produces visual diagrams from them.
Suppose you have a DITA topic that embeds such a textual description of a diagram: https://github.com/oxygenxml/dita-ot-diagrams-plugin/blob/master/com.oxygenxml.diagrams.svg/samples/testPlantUMLDiagram.dita.
To provide support in Oxygen for using such diagrams in DITA topics, you need to install
the following components:
- An Oxygen plugin that presents PlantUML textual descriptions as images when editing the content in the Author visual editing mode: https://github.com/oxygenxml/wsaccess-javascript-sample-plugins/tree/master/plantuml-images-support.
- A DITA Open Toolkit publishing plugin that, once installed in the DITA Open Toolkit, will convert the textual descriptions to diagrams for both the HTML-based and PDF outputs: https://github.com/oxygenxml/dita-ot-diagrams-plugin.
Once you have this setup, you can both visualize the diagrams when editing and publish them while having the diagram representations dynamically converted to SVG in the published output.