file extension when using @startuml filename

0 votes
asked Feb 10 in Wanted features by anonymous
Is there a way to automatically generate the file extension based on the output format?

I want 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 by Serge Wenger Work (5,400 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
 
0 votes
answered Feb 10 by plantuml (134,570 points)
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!
...