Please provide a macro to access the last modification date of the diagram source file

0 votes
asked Apr 20, 2017 in Closed feature request by sheriff (120 points)
I'd like to automatically display/print out a the last modification date of the diagram source file.

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, 2017 by plantuml (294,960 points)
selected Mar 23, 2018 by Anthony-Gaudino
 
Best answer

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, 2017 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, 2017 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, 2017 by plantuml (294,960 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, 2017 by sheriff (120 points)
I don´t use the Word Plugin.
a %filedate% variable would be perfect.
Thanks
commented Apr 21, 2017 by plantuml (294,960 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, 2017 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, 2017 by plantuml (294,960 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.
commented Jan 28, 2021 by Arne
I cannot find the %filedate% variable in the preprocessor documentation. Has it been removed? Is there any alternative method to get the modification timestamp of the source file?
...