Sitelet https://github.com/lbaile21/instructlab/tree/main/docs
Skip to content

Latest commit

 

History

History
 
 

README.md

Workflow PlantUML

Workflow figure is generated using PlantUML with the ditaa. To generate it yourself, the easiest way is to install the PlantUML plugin in VS Code (with the prerequisite installed), open the file and click preview.

Remote rendering

If you don't want to install the dependencies locally, you can use the following settings to make the preview work with a remote render:

"plantuml.render": "PlantUMLServer",
"plantuml.server": "https://www.plantuml.com/plantuml",

Note that the public PlantUML server may be slow or rate-limited during peak hours. For faster iteration, consider running a local server via Docker:

docker run -d -p 8080:8080 plantuml/plantuml-server:jetty

Then point the plantuml.server setting to http://localhost:8080.

Editing tips

ASCIIFlow is a helpful tool to edit the source code of the ditaa diagrams. When the diagram grows large, prefer splitting it into multiple smaller figures rather than a single dense one — rendering time scales roughly with the number of cells, and smaller diagrams are easier to review in pull requests.

Regenerating figures

After editing a .puml source, export the rendered PNG/SVG alongside the source file and commit both. This avoids forcing every reader to re-run the renderer locally.

Command-line export

If you have the PlantUML JAR installed, you can regenerate figures from the command line without opening VS Code:

# Render a single file to PNG (default)
java -jar plantuml.jar workflow.puml

# Render to SVG, which is preferred for diagrams embedded in web docs
java -jar plantuml.jar -tsvg workflow.puml

# Render every .puml file in the current directory
java -jar plantuml.jar -tsvg "*.puml"

For ditaa-based figures specifically, pass -tlatex or -tpng as appropriate; ditaa output is raster-only, so SVG is not available for those diagrams.

Troubleshooting

  • Blank preview in VS Code. Ensure Java is on your PATH and Graphviz (dot) is installed for non-ditaa diagrams. The plugin's output panel will usually report the missing dependency.
  • "Dot executable not found." Install Graphviz (brew install graphviz, apt install graphviz, or the Windows installer) and restart VS Code so the updated PATH is picked up.
  • Diff noise in PRs. PlantUML embeds a timestamp in PNG metadata by default. Pass -nometadata when exporting to keep diffs minimal.
  • Fonts differ between machines. Pin a font explicitly in the diagram (e.g. skinparam defaultFontName "DejaVu Sans") so renders are reproducible across contributors.