plantuml
Table of Contents
Installation
pacman -S plantuml
Steps
- In any directory and create a txt file in it.
- Give a name to the txt file.
- Insert plantuml syntax for a sequence diagram (or any other kind of diagram) in this txt file.
- Launch plantuml from terminal in that directory (plantuml installation in the machine is a prerequisite).
plantuml . - A png image is exported into that same directory by plantuml.
Other options
The VS code plugin didn’t work when I tried it. Didn’t spend too much time on it though.
References
Many good examples here:
In terminal
- Save the code in a file with
.pumlextension - Run this to generate the image from terminal in the same folder as the puml file
Or, run this from anywherecd /home/explorer436/.emacs.d java -jar plantuml-mit-1.2025.0.jar /home/explorer436/Downloads/GitRepositories/my-personal-things/finances/personal/my-finances-plantuml-source.pumljava -jar /home/explorer436/.emacs.d/plantuml-mit-1.2025.0.jar /home/explorer436/Downloads/GitRepositories/my-personal-things/finances/personal/my-finances-plantuml-source.puml
In emacs
Reference: https://plantuml.com/emacs
-
Download plantuml.jar from official download page and save it at a location in your computer. e.g. /home/you/path/to/plantuml.jar
-
install plantuml-mode via melpa.
-
in scratch execute
(setq org-plantuml-jar-path (expand-file-name "/home/you/path/to/plantuml.jar")) (add-to-list 'org-src-lang-modes '("plantuml" . plantuml)) (org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t))) -
put some uml in your org file e.g.
title Authentication Sequence Alice->Bob: Authentication Request note right of Bob: Bob thinks about it Bob->Alice: Authentication Response -
export e.g. with
C-c C-e h oEvaluate this with
C-c C-ctitle Authentication Sequence Alice->Bob: Authentication Request note right of Bob: Bob thinks about it Bob->Alice: Authentication Response