Generate PlantUML using Command Line
This is part of a series creating around PlantUML and Diagrams as Code.
- Authoring Plant UML files in Visual Studio Code
- Creating Image file from PlantUML using command line (This Post)
- Creating Pipeline to build and check-in Diagrams as Code
- Optimise the Pipeline
You may have read my previous post about using Visual Studio Code Extension to create a PlantUML files. https://www.azuredevops.tips/build-diagramsplantuml/. In this post I will cover how to bulk generate image files. This is handy if you need to bulk regenerate the diagrams without using the command line or Visual Studio Code.
Getting Started
Dependencies
I assume you have installed the required files as specified in this post https://www.azuredevops.tips/build-diagramsplantuml/ . Alternatively if you have Chcoloaty installed which can be found https://chocolatey.org/ . This is a package manager that will install the packages using command line. You need to have the right permission on your machine to install the packages.
Once Installed you can run:
|
|
Install
The node package to carry out the image conversion. We will be using node-plantuml which has been created by Markus Hedvall.
|
|
Check Everything is ready
To make sure your system is ready run the following command.
|
|
This will indicate if everything is installed and configured.
Command line
I assume you have a plantUML file already if not create one for example will be enough to test it.
|
|
PNG
To create a PNG file see the command below.
|
|
The following will be created
SVG
You can create SVG file
|
|
Unicode
|
|
ASCII Art
|
|
Bulk Command
I create the following powershell script to iterate over all the folders to generate the Puml files and generate a png of the file.
|
|