"plantuml" Macro

Last modified by Vincent Massol on 2026/10/21 19:17

Reference

This macro draws a diagram from the textual definition written in its content, in the PlantUML language.

The macro is listed in the "Content" category of the macros and also works inline, inside a paragraph. For a step-by-step use, see Add a Diagram to a Page.

Parameters

Parameter Default What it does
type plantuml Diagram type used when the content does not start with an @start line: the macro adds the start and end lines of that type. Ignored when the content has them. The values are listed in Diagram Types.
format png, unless the administrator set another default Output format: png, svg or txt, described in Output Formats.
title None Title added at the top of the diagram, unless the content already has a title line.
server The server configured by the administrator URL of the PlantUML server that generates this diagram. An empty value uses the configured server. PlantUML Macro 2.5+ Accepted only when the page was last saved by a wiki administrator, and never in comments.

Diagram Types

type Diagram Start and end lines
plantuml UML diagram: sequence, use case, class, activity, component, state, deployment, timing and others @startuml and @enduml
ditaa Ditaa diagram drawn with ASCII characters @startditaa and @endditaa
dot GraphViz diagram. PlantUML Macro 2.5+ Only generated through a PlantUML server: XWiki does not generate it itself with its default security profile. @startdot and @enddot
jcckit JCCKit chart @startjcckit and @endjcckit
salt Salt wireframe of a user interface @startsalt and @endsalt
mindmap Mind map @startmindmap and @endmindmap
regex Regular expression @startregex and @endregex
gantt Gantt chart @startgantt and @endgantt
chronology Chronology @startchronology and @endchronology
wbs Work breakdown structure @startwbs and @endwbs
ebnf Extended Backus-Naur form grammar @startebnf and @endebnf
json JSON data @startjson and @endjson
yaml YAML data @startyaml and @endyaml

Output Formats

format Displayed as Notes
png An image The default.
svg An SVG drawing inserted in the page Scales without blurring and keeps the links of the diagram clickable, as in the SVG example. PlantUML Macro 2.5+ Elements not allowed in the page are removed from the drawing, and diagrams in comments are displayed as images instead.
txt ASCII art in a preformatted block Available only for the diagram types that PlantUML can draw as text.

Examples

Class Diagram

{{plantuml}}
@startuml
package "Classic Collections" #DDDDDD {
  Object <|-- ArrayList
}

package net.sourceforge.plantuml {
  Object <|-- Demo1
  Demo1 *- Demo2
}
@enduml
{{/plantuml}}

Class diagram with an Object class extended by ArrayList in a Classic Collections package and by Demo1, composed of Demo2, in a net.sourceforge.plantuml package

Ditaa Diagram

{{plantuml}}
@startditaa
 Web Browser         JEE Server
 /--------\         +---------+     Database
 +--------+         |c789     |      +---+
 |c1FF    |<------->|  XWIKI  |<-=-->|{s}|
 |  Wiki  |  text   |         |      +---+
 |  page  |         +---------+
 |  with  |         |c789     |      +---+
 |diagrams|<------->|PlantUML |<-=-->|{o}|
 |        |  image  |   Server|      +---+
 \--------/         +---------+     Graphviz
@endditaa
{{/plantuml}}

Ditaa diagram of a web browser exchanging text and images with XWiki and a PlantUML server, which use a database and Graphviz

{{plantuml format="svg"}}
@startuml
title [[https://github.com/xwiki/xwiki-rendering XWiki Rendering]] General Architecture

file "Input Syntax" as Input
component Parser [
    [[https://github.com/xwiki/xwiki-rendering/blob/master/xwiki-rendering-api/src/main/java/org/xwiki/rendering/parser/Parser.java Parser]]
]
component Transformations [
    [[https://github.com/xwiki/xwiki-rendering/blob/master/xwiki-rendering-api/src/main/java/org/xwiki/rendering/transformation/Transformation.java Transformations]]
]
component Renderer [
    [[https://github.com/xwiki/xwiki-rendering/blob/master/xwiki-rendering-api/src/main/java/org/xwiki/rendering/renderer/Renderer.java Renderer]]
]
file Output

Input -> Parser
Parser -> Transformations : XDOM
Transformations -> Renderer : XDOM
Renderer -> Output
@enduml
{{/plantuml}}

SVG component diagram of the XWiki Rendering architecture whose title and Parser, Transformations and Renderer components are links

Related

Get Connected