Multilingual Wiki Documentation

You are currently using syntax.
In an attempt to improve PlantUML documentation...
Please do not use this website for your own diagrams.
You can click here and use the online server here for your own documentation.

Wiki Toc    Recent changes    View page history    Add new chapter    Reorder page    Raw


概述

原来,图表的描述需要以"@startuml"开头,以@enduml结束,PlantUML在支持UML同时支持其他图表,既然如此,"@startuml"就没有存在的必要了。

所以,通用规则允许图表描述以@startXYZ开头,以@endXYZ结束,"XYZ"根据图表的类型而改变。

注意,XYZ可以是任何字符串(包括空格)。

这意味着我们鼓励插件开发者,以@start代替@startuml作为标识。

Generalisation

PlantUML now can generate diagrams other than UML. In such cases the usual @startuml does not make sense anymore. So now we allow diagrams start with @startXYZ and finish with @endXYZ, where XYZ can change with the type of diagram and can be any characters (including spaces).

This means that plugin developers are encouraged to change their code to recognize @start instead of @startuml.

DITAA diagrams are usually formatted as @startditaa...@endditaa.

Ditaa

Ditaa 是一个支持通过文本描述生成通用图表的开源项目。这个理念和PlantUML非常相近,所以,支持除UML之外其他图表的文档化将会很有很有意义。

所以最新版本的PlantUML支持下面的语法:

@startuml
ditaa
+--------+   +-------+    +-------+
|        +---+ ditaa +--> |       |
|  Text  |   +-------+    |diagram|
|Document|   |!magic!|    |       |
|     {d}|   |       |    |       |
+---+----+   +-------+    +-------+
    :                         ^
    |       Lots of work      |
    +-------------------------+
@enduml

你可以在 这里 找到它的完整的文档。

如果你的插件还不支持@startditaa,可以使用 临时 解决方案:在你的文档描述首行使用@startuml,通过ditta关键字来支持 Ditaa

你同样可以在@startditaa或者@ditta关键字后面使用一些设置:

  • -E 或者 --no-separation 移除分隔符
  • -S 或者 --no-shadows 移除阴影
  • scale=XYZ to 缩放图表

@startuml
ditaa(--no-shadows, scale=0.8)
/--------\   +-------+
|cAAA    +---+Version|
|  Data  |   |   V3  |
|  Base  |   |cRED{d}|
|     {s}|   +-------+
\---+----/
@enduml

只支持PNG格式。 ⚠ On PlantUML, only PNG generation is supported.
WARNING
 This translation need to be updated. 
WARNING

Ditaa

Ditaa (DIagrams Through Ascii Art) is an Open Source project that allows to generate general diagrams from a text descriptions. The idea is close to PlantUML, and it may be useful for documentation to generate other diagrams than UML.

So last version of PlantUML allows this :

@startuml
ditaa
+--------+   +-------+    +-------+
|        +---+ ditaa +--> |       |
|  Text  |   +-------+    |diagram|
|Document|   |!magic!|    |       |
|     {d}|   |       |    |       |
+---+----+   +-------+    +-------+
    :                         ^
    |       Lots of work      |
    +-------------------------+
@enduml

You will find the complete documentation about ditaa on:

If your plugin does not support @startditaa yet, a temporary feature has been set up : it is also possible to use Ditaa with @startuml by using ditaa keyword on the very first line of your description.

⚠ On PlantUML, only PNG generation is supported.

Option supported by PlantUML

You can also use some option, after the @startditaa or ditaa keyword:

  • -E or --no-separation to remove separator
  • -S or --no-shadows to remove shadow
  • scale=<XYZ> to scale up or down the diagram

Without option

@startditaa
+---------+  /--------\   +-------+
| cBLU    +--+cAAA    +---+Version|
|         |  |  Data  |   |   V3  |
|    +----+  |  Base  |   |cRED{d}|
|    |cPNK|  |     {s}|   +-------+
|    |    |  \---+----/
+----+----+    
@endditaa

Remove separator

@startditaa -E
+---------+  /--------\   +-------+
| cBLU    +--+cAAA    +---+Version|
|         |  |  Data  |   |   V3  |
|    +----+  |  Base  |   |cRED{d}|
|    |cPNK|  |     {s}|   +-------+
|    |    |  \---+----/
+----+----+    
@endditaa

Remove shadow or scale diagram

@startuml
ditaa(--no-shadows, scale=0.7)
+---------+  /--------\   +-------+
| cBLU    +--+cAAA    +---+Version|
|         |  |  Data  |   |   V3  |
|    +----+  |  Base  |   |cRED{d}|
|    |cPNK|  |     {s}|   +-------+
|    |    |  \---+----/
+----+----+    
@enduml

Tags

Tag Description
{c} Choice or Decision
{d} Document - Symbol representing a document
{io} Input/Output - Symbol representing input/output
{mo} Manual operation
{o} Ellipse
{s} Storage - Symbol representing a form of storage, like a database or a hard disk.
{tr} Trapezoid

@startditaa
+------+------+------+------+------+------+------+
| c {c}|d {d} |io{io}|mo{mo}|o{o}  |s{s}  |tr{tr}|
+------+------+------+------+------+------+------+
@endditaa

More documentation

You will find the complete documentation about ditaa on:


Please report any bugs to plantuml@gmail.com or here.
This website is still in beta testing.