plantuml中的内联评论

发布于 2025-02-10 19:26:59 字数 1112 浏览 1 评论 0原文

是否可以在 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? '/

适用于参与者,可以成功使用。只有使用参考文献而不是工作。

带有'的解决方案 -表示法,此处无法正常工作。

我已经检查了以下资源:

这里有可能吗?

Is it possible to write an inline comment in the PlantUML (Markdown format)?

For example, I would like to achieve the following result

@startuml
    participant Alice as A
    participant Bob as B

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

I know that the following notations can be used:

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

What I find strange is that this style:

participant Alice as A    /' Why does this comment work? '/

works for the participants and can be used successfully. Only with the references this does not work.

The solutions with the ' and -- notation which were mentioned here do not work properly.

I already checked the following sources:

Is there a possibility here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过气美图社 2025-02-17 19:26:59

根据最新规范,您有三个选项可以在*。puml文件中添加注释部分:

1)简单注释

所有以简单Quote ''< /代码>是评论。

@startuml
'Line comments use a single apostrophe
@enduml

2)块评论

strong *您使用postrophe ',然后您也可以在使用/'启动的几行,'/结束。

@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-3906

According to the latest specification, you have three options to add comment section in a *.puml file:

1) Simple comment

Everything that starts with simple quote ' is a comment.

@startuml
'Line comments use a single apostrophe
@enduml

2) Block comment

Block comment use C-style comments except that instead of * you use an apostrophe ', then you can also put comments on several lines using /' to start and '/ to end.

@startuml
/'
many lines comments
here
'/
@enduml

3) Put block comment on the same line

@startuml
/' case 1 '/   A -> B : AB-First step 
               B -> C : BC-Second step
/' case 2 '/   D -> E : DE-Third step
@enduml

Reference: QA-3906 and QA-3910

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文