Global Keywords and Options

Also see:

  • Creole markup
  • Settings (skinparams)
  • Notes

@startuml
' This prints the current directory (Current Dir) of... ??
'  and the "default path" (which is really the current directory!)
path
'!include ../../plantuml-styles/ae-copyright-footer.txt
@enduml

@start[uml | ditaa | jcckit]

from the FAQ:

The @startuml/@startditaa/@startjcckit is useful to determine the type of diagram (uml, ditaa, jcckit…), and because you can optionally put a filename after the @startXXX. This also allows to have several diagrams inside the same file.

@startuml

Todo

@startuml - explain that it’s the most common, but there are others

@startditaa

Todo

@startditaa - explain t

@startjcckit

Todo

@startjcckit - explain t

Rectangle

Usage:

rectangle <name> [ <color>] { <items listed on a new line> }

Puts a rectangular box around the items that are listed within the brackets ({}).

Diagram Layout Direction

Default direction is top to bottom

Usage:[ top to bottom direction | left to right direction ]

Titles, Headers, and Footers

Title

Caption

Legend

Page Break (newpage)

Usage:

newpage

Breaks up the diagram into another page. Equivalent to a “page break”

Only works on these pages (confirmed these only):

  • Use Case
  • Sequence

Todo

newpage is common to what diagrams exactly? Check the source code

Images and Icons

Images

Icons

Zoom

Comments

Include files

Constants

Macros

(explanation)

A macro can include another macro (must it be previously defined?)

A macro can be polymorphic with argument count.

Special Variables

%date%

%date% the current date and time

%dirpath%

%dirpath% Path of the current file

  • for use with including files – to specify a path
  • does not render anything when used in a diagram

%filename%

%filename% Name of the current file

  • for use with including files – to specify a path
  • does not render anything when used in a diagram
  • default values
  • !ifdef !else !endif
  • !ifndef
  • && (boolean AND)
  • || (boolean OR)
  • !import (a zipped library)
  • ## (append text to a macro)

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