Skip to content

PlantUML in Emacs

In Emacs, run code block using C-c and show inline images, counsel-git-grep or ripgrep on text “beginsrc plantuml” for other examples search in notes begin_src plantuml and see complex examples at C4 model for visualising software architecture - C4 model for visualising software architecture

;; Disable prompt on code block execution in org-babel
(setq org-confirm-babel-evaluate nil)
  • Use a code block like the following and a results block like that below will be automatically generated.
  • Use M-x plantuml-download-jar to download it to ~/.config/emacs/plantuml/plantuml.jar. Make sure the jar is copied to that location
  • Use plantuml-mode on PlantUML files or highlight the PlantUML in a file like org-mode and plantuml-preview to generate diagrams
  • In git, png files starting with plantuml will be ignored.
  • Use :exports both in plantuml code block header to export both code and results during export
Alice -> Bob: test