Please allow to specify a filename after @startuml and set the extension automatically

0 votes
asked Feb 10, 2017 in Closed feature request by anonymous

I'd like to write:

@startuml filename

and e.g. the parameter "-pdf" should lead to filename.pdf
while the parameter "-tpng" should lead to filename.png

2 Answers

0 votes
answered Feb 10, 2017 by plantuml (177,280 points)
selected Mar 23 by Anthony-Gaudino
 
Best answer
Good suggestion, thanks!

So we've built a new beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

With this beta, if no file extension if given after the "@startuml filename", we add the corresponding one.

The only drawback to us is that it breaks somehow the compatibility. someone uses PlantUML today with "@startuml filename" without extension, he will have a slightly different result (because some extension will be added to the filename). However, since we do NOT append an extension if some is already present, we expected that this will impact very few people, because probably people are putting extension to filename.

Tell us if it's working for you!
0 votes
answered Feb 10, 2017 by Serge Wenger Work (9,630 points)

Hello,

The "filename" of the file with the PalntUML code give the "filename".

If version.txt content is:

@startuml
version
@enduml
 
java -jar C:\PgmFiles\PlantUML\plantuml.jar -tpng version.txt 
generate version.png
 
java -jar C:\PgmFiles\PlantUML\plantuml.jar -tsvg version.txt
generate version.svg
 
...