Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

How to start generating picture with pipe mode

0 votes
Hello,

I'm trying to use plantuml "-pipe" parameter to start plantuml only once for generation of many pictures.

But it seems that the generation only takes place if stdin is getting closed. This means I have to start

plantuml again which costs time. Is there a possibility to let plantuml run once and to put one picture description

via stdin after another with getting one picture after another via stdout (with apropriate separator)?

With kind regards,

Stefan
asked 4 days ago by anonymous

1 Answer

0 votes
We've just published a new beta https://www.dropbox.com/s/koo42q3d9gxw288/plantuml.jar?dl=0

This beta should better handle the -pipe option : you can now send several diagrams in stdin (please use appropriate @startXXX / @endXXX delimitor for those diagrams).

Right now, there are no delimitor between pictures in stdout : you have to detect PNG header start : is it possible for you ?

In the future, we may add some optional delimitor (using for example a -delimitor flag) in the command line.

This has not been widely tested, so please feedback if you find issues!

Thanks

PS: Note that you could also use the FTP option to generate several diagrams without having to restart java process. See http://plantuml.sourceforge.net/qa/?qa=5694/c%23-plantuml-jar-alternative
answered 4 days ago by plantuml (111,340 points)
Thanks. Looks nearly good. Would it be possible to print the delimitor in time directly at the end of the generated picture, then I can use it as the end marker of the generation. It seems that you print it only before outputting the next picture.

With kind regards,
Stefan
Ok, beta7 should do the job
https://www.dropbox.com/s/koo42q3d9gxw288/plantuml.jar?dl=0
Feedback welcome!
Thanks for all. This works like expected under Windows. I will now
try to but all the pieces together for what I want.
Thanks very much.
With kind regards,
Stefan
Hello again,
I tried some things and there is sadly one more problem:
For my plan I send nearly every keystroke via pipe to plantuml, so they script is not syntactically correct some times. In this situation I get:
     ┌─┐          ┌─┐
     │A│          │B│
     └┬┘          └┬┘
      │            │
      │───────────>│
     ┌┴┐          ┌┴┐
     │A│          │B│
     └─┘          └─┘
===END-OF===
.. (skipping 9 lines) ...
                          
A -> B                    
                          
E                         
^                         
 Syntax error: E          
===END-OF===
ERROR
12
Syntax error: E

In this example, same as if using -tpng, I sent a correct description,
-pipedelimiter is "===END-OF===", and afterwards a false one.

In this situation the error is given as text, which is a picture with -tpng. But after the delimiter I get additional text which is necessary for
telling the user where the error is, but it comes after the delimiter.

Would it be possible to:
- have the delimiter at the end of all
- the error description as picture (for tools which need this)
- and an additional error message in ascci, as if using -tutxt,
  which would it make simpler to show the user the previous picture
 and an error message as overlay right in the source.
Perhaps an the mechanism of the delimiter can be changed to have
an real end marker and perhaps a separator of the parts of the answer.

I hope I have clearly written down my problem, looking forward for
an answer.

With kind regards,
Stefan
Do not worry about iterative development : this is usually how we work.

Firstly, diagrams images (PNG or ASCII) are sent to Standard Ouput and error message are sent to Error Ouput, so there should not need to separate them (they are not in the same flow).
Printing information to Error Ouput was useful when only one diagram was generated.
I've got the feeling that you are using PlantUML in some daemon mode here, to printing information to Error Ouput maybe make no sense.

So in last beta, we decided to remove any flow to Error Ouput when -pipedelimitor is used. Note that this is not a final decision, just a try.
https://www.dropbox.com/s/koo42q3d9gxw288/plantuml.jar?dl=0

Does it make it easier to use for you ?
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...