PlantUML中的内联注释。

6

PlantUML(Markdown格式)中是否可能编写内联注释?

例如,我想要实现以下结果

@startuml
    participant Alice as A
    participant Bob as B

    A -> B    ' Here I would like to have my comment
    ...
@enduml

我知道以下符号可以使用:

' This is a comment on a single line
A -> B: Hello World
/' Multiple
comment
lines '/

我觉得奇怪的是这种样式:
participant Alice as A    /' Why does this comment work? '/
参与者可用的解决方案,并且可以成功使用。仅凭参考文献,这是不行的

此处提到的使用 '-- 符号的解决方案无法正常工作。

我已经检查了以下来源:

这里有可能吗?

1个回答

1
根据最新的规范,您在一个*.puml文件中有三种选项来添加评论部分: 1) 简单评论 以单引号'开头的所有内容都是评论。
@startuml
'Line comments use a single apostrophe
@enduml

2) 块注释
块注释使用C风格的注释,只是用撇号'代替星号*,然后您还可以使用/'开始和'/结束来在多行上添加注释。
@startuml
/'
many lines comments
here
'/
@enduml

3) 在同一行上添加块注释
@startuml
/' case 1 '/   A -> B : AB-First step 
               B -> C : BC-Second step
/' case 2 '/   D -> E : DE-Third step
@enduml

参考:QA-3906QA-3910

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接