Advanced Use

Preprocessor

  • !define, !undef

  • including files

    • can .zip a file and include it
    • You can use system environment variable or constant definition when using include
    !include %windir%/test1.txt
    !define PLANTUML_HOME /home/foo
    !include PLANTUML_HOME/test1.txt
    
  • include URL

  • constants

  • date and time

Macros

  • !definelong
  • !enddefinelong
  • default values for macro parameters !define some_macro(x, y = "some default" , z = 'another default' ) x and y and z
  • conditions
  • append text to a macro argument use the ## syntax.
  • a macro can be defined by another macro
  • can have varying argument count (polymorphic)

Icon Sets (“StdLib”)

@startuml
listicons
@enduml

Sprites

@startuml listicons @enduml

Running from Other Programs

Java

Ex:

Python

Ex:
  • Can extract the original PlantUML source from a PNG file with the -metadata option:
-metadata            To retrieve PlantUML_ sources from PNG images

see: https://mrhaki.blogspot.com/2016/12/plantuml-pleasantness-get-plantuml.html

Running via an ANT Task