|home| |posts| |projects| |cv| |bookmarks| |github|

Plantuml on the Command Line

Install PlantUML

See install step from PlantUML in Emacs

Usage

Create source file

Create a file named dead_parrot_sketch.plantuml with the following content:

@startuml

title Dead Parrot sketch

Mr.Praline -> Owner: 'Ello, I wish to register a complaint.

Mr.Praline -> Owner: 'Ello, Miss?
Owner --> Mr.Praline: What do you mean "miss"?

Mr.Praline -> Owner: I'm sorry, I have a cold

@enduml

Generate ASCII art diagram

Run the following command:

plantuml -Ttxt dead_parrot_sketch.plantuml

This will generate a file named dead_parrot_sketch.atxt which should have the following content:

                    Dead Parrot sketch

     ,----------.                              ,-----.
     |Mr.Praline|                              |Owner|
     `----+-----'                              `--+--'
          | 'Ello, I wish to register a complaint.|
          | -------------------------------------->
          |                                       |
          |              'Ello, Miss?             |
          | -------------------------------------->
          |                                       |
          |        What do you mean "miss"?       |
          | <- - - - - - - - - - - - - - - - - - -
          |                                       |
          |        I'm sorry, I have a cold       |
          | -------------------------------------->
     ,----+-----.                              ,--+--.
     |Mr.Praline|                              |Owner|
     `----------'                              `-----'

Generate PNG diagram

Run the following command:

plantuml -Tpng dead_parrot_sketch.plantuml

This will generate a file named dead_parrot_sketch.png which should have the following content: