diagramm version info

0 votes
asked Apr 20 by sheriff (120 points)
Is there a way to automatically display/ print out a version information of the diagram in a PlantUML chart (e.g. a Timestamp or SVN  revision number or somthing like that)?
This is necessary to compare or for reviews after regular updating (export of the charts as PNG into a Word document).

1 Answer

0 votes
answered Apr 20 by plantuml (131,770 points)

Sorry, you have to be more specific in your request: I am not sure to understand it fully.

Today, you can print the current version of PlantUML:
@startuml
version
@enduml


Or using the preprocessor ( http://plantuml.com/preprocessing ), you can also have:

@startuml
header generated at %DATE%
Bob -> Alice : hello
@enduml


Is this what you are expecting ?
Thanks!
 

commented Apr 20 by sheriff (120 points)
thanks for the quick answer:

"version" dosn´t work for me => the response is "Forbidden line version"
but "header generated at %DATE%" works very well.
Thanks for the hint!
commented Apr 21 by sheriff (120 points)
Hello,
The solution is good, unfortunately, updates the variable %date% every  time if I open a diagram. I need the last modification date. Is there another variable or possibility here? Where can I view a list of variables?
commented Apr 21 by plantuml (131,770 points)
By default, there is also %filename% and %dirpath% but those variables won't help you for version control.

We could add some %filedate% variable. Note that this won't help you neither if you are using the Word Plugin (is this what you are using ?) because this will be the date of the temporary file generated by Word, that changes at each run.

Another option is to set some variable from the command line http://plantuml.com/command-line
For example:
java -jar plantuml.jar -DVERSION=1.4 ...

@startuml
header generated by version VERSION
Bob -> Alice : hello
@enduml
commented Apr 21 by sheriff (120 points)
I don´t use the Word Plugin.
a %filedate% variable would be perfect.
Thanks
commented Apr 21 by plantuml (131,770 points)
Ok, with last beta:
https://www.dropbox.com/s/koo42q3d9gxw288/plantuml.jar?dl=0
You can use %filedate%

There is no way to format the date right now (as for %date%) but we will add this in the future if needed.

Tell us if it helps!
commented Apr 21 by sheriff (120 points)
How can I integrate / use it with the Eclipse Plugin?
PlantUML Feature    1.1.8.8057    net.sourceforge.plantuml.feature.feature.group    / PlantUML Team
commented Apr 21 by plantuml (131,770 points)
Sorry, our correction will not work with Eclipse Plugin, because the integration between PlantUML and Eclipse is not based on command line interface.

However, you should open a request on https://github.com/hallvard/plantuml/issues so that we could work together with the Eclipse Team to provide such %filedate% option from Eclipse.
...