vscode-plantuml icon indicating copy to clipboard operation
vscode-plantuml copied to clipboard

Is diagram name an official feature?

Open dawngerpony opened this issue 3 years ago • 7 comments

When I load a diagram without a name, I see a warning:

Diagram unnamed. Try "@startuml name"

I see nothing in the PlantUML specification about naming diagrams, but I did find an issue (https://github.com/Enteee/plantuml-parser/issues/24) related to the subject, but with no clear conclusion.

Should a warning be generated when a diagram has no name, given that it doesn't seem to be an official PlantUML feature?

image

dawngerpony avatar Apr 23 '21 11:04 dawngerpony

I use the feature a lot, and I think it's a useful warning because the other features offered by the extension (generating markdown, exporting files) rely on having a name.

fuhrmanator avatar Apr 24 '21 21:04 fuhrmanator

@dawngerpony of course it's an official feature, if not, why there is no parse error for this syntax? It's only not documented, but mentioned in some posts of the forum. But as @fuhrmanator said, this features is useful, so I chose to show those msg.

qjebbs avatar Apr 25 '21 01:04 qjebbs

Fair enough, thanks for your thoughts! I agree that it's a useful feature, I just wish it was documented on plantuml.com somewhere.

dawngerpony avatar Apr 26 '21 08:04 dawngerpony

Hello, I was wondering if there was a way to remove those warnings though? or an alternative to use the name of the file rather than the title to name the exports? I removed the titles so I could get the same filename by default when I export, but I am now flooded with these messages, and I cant quite figure out how to ignore them. I could not find an easy way to ignore this specific rule through VSCore but that may be my inexperience

Carglass avatar May 19 '21 20:05 Carglass

qjebbs wrote:

"of course it's an official feature"

@qjebbs Are you sure? How? Where is it documented?

I looked on these pages:

  • https://plantuml.com/class-diagram
  • https://plantuml.com/preprocessing

See also:

  • https://forum.plantuml.net/10366/are-diagram-names-a-supported-feature

xpe avatar Jul 13 '21 01:07 xpe

Hello all,

FYI: it is quickly defined here:

  • https://plantuml.com/sources

See also:

  • https://forum.plantuml.net/8202/how-to-define-output-filename
  • https://forum.plantuml.net/5483/please-specify-filename-@startuml-extension-automatically

Regards.

The-Lum avatar Jul 27 '21 17:07 The-Lum

PlantUML gives users the ability to set the diagram filename, as an optional. As a long time user of plantuml, I would recommend to avoid it and only use it when you have a special need - following the principle to keep it as simple as possible.

So, PlantUML does not require the setting of the diagram name. To play nice with other tools (i e to ensure that behavior is consistent along the toolchain), neither should any tools based on it.

As for reference, there is no mention of the diagram filename setting in the language reference guide, but PlantUML mentions it in the PlantUML FAQ when discussing the @startXXX tags, and clarifies that the filename is optional:

you can optionally put a filename after the @startXYZ. This also allows to have several diagrams inside the same file.

image

chipbite avatar Sep 10 '21 14:09 chipbite