您可以点击此处在此页面上做出贡献  (Menu)

 

 

通用命令

 

 

= 注释 =

所有以 单引号 '开头的语句,被认为是一个注释.

多行注释,以 /''/ 作为注释的开始和结束

 

 

页眉和页脚

你可以使用 headerfooter命令在生成的图中增加页眉和页脚。

你可以选择指定center, leftright关键字使页眉或页脚实现居中、左对齐和右对齐。

像标题一样,页眉或页脚内容可以在多行中定义,而且同样可以在页眉或页脚中输入一些HTML代码。

@startuml
Alice -> Bob: Authentication Request

header
<font color=red>Warning:</font>
Do not use in production.
endheader

center footer Generated for demonstration

@enduml

 

 

= 缩放 =

You can use the scale command to zoom the generated image.

You can use either a number or a fraction to define the scale factor. You can also specify either width or height (in pixel). And you can also give both width and height : the image is scaled to fit inside the specified dimension.

@startuml
scale 180*90
Bob->Alice : hello
@enduml

 

 

= 标题 =

使用 title 关键字添加标题。 你可以在标题描述中使用 \n 添加新行。

Some skinparam settings are available to put borders on the title.

@startuml
skinparam titleBorderRoundCorner 15
skinparam titleBorderThickness 2
skinparam titleBorderColor red
skinparam titleBackgroundColor Aqua-CadetBlue

title Simple communication\nexample

Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

@enduml

You can use creole formatting in the title.

You can also define title on several lines using title and end title keywords.

@startuml

title
 <u>Simple</u> communication example
 on <i>several</i> lines and using <back:cadetblue>creole tags</back>
end title

Alice -> Bob: Authentication Request
Bob -> Alice: Authentication Response

@enduml

 

 

图片标题

使用 caption 关键字在图像下放置一个标题.
@startuml

caption figure 1
Alice -> Bob: Hello

@enduml

 

 

图例说明

legendend legend 作为关键词,用于配置一个图例(legend). 支持可选地使用left,right,center为这个图例指定对齐方式.

@startuml

Alice -> Bob : Hello
legend right
  Short
  legend
endlegend

@enduml
@startuml

Alice -> Bob : Hello
legend left
  Short
  legend
endlegend

@enduml