Output Name in title or footer

+1 vote
asked Jan 31, 2022 in Question / help by Gilles (140 points)

Hi,

I use the syntax @startuml name to manage the filename of the exported png/svg.

Is there a keyword to use this name in the footer ?

Currently, I use

footer %filename()

And I wish to have something like

@startuml diagram_name

[...]

footer %filename() - diagram_name

@enduml

Is it possible ?

commented Jan 31, 2022 by The-Lu (69,220 points)

Hello N.,

Unfortunately, not yet, see this similar request here:

Hoping for future development,
Regards.

1 Answer

0 votes
answered Aug 9 by dragondive (1,360 points)

[While this does not directly address the question as it is asked, I have found the following alternate approach useful and more practical in my diagrams. I'll leave it here for anyone else who comes here from a search engine.]

Define the diagram name as a "variable" and assign it from the CLI. So in the example from the question:

@startuml diagram_name
[...]
footer %filename() - diagram_name
@enduml

Let the "diagram_name" be an actual variable name rather than a "placeholder" as in the question. Then while generating the diagram, specify:

java -jar plantuml.jar -Ddiagram_name=My_Amazing_Diagram diagram.puml
...