Home Emacs에서 PlantUml을 사용하자
Post
Cancel

Emacs에서 PlantUml을 사용하자

Table of Contents

  1. PlantUml 다운로드
  2. graphviz 설치
  3. emacs 설정
  4. 사용법

emacs의 org-mode에서 uml을 작성하고 생성할 수 있는 plantuml을 emacs에 설정해보겠다.
맥에서 세팅중이라 맥을 기준으로 작성하겠다.

PlantUml 다운로드

PlanUml 사이트 다운로드 : https://plantuml.com/ko/download
해당 사이트에서 PlanUml을 적당한 위치에 다운로드 한다.

graphviz 설치

PlantUml이 Class Diagram을 생성할때 graphviz를 필요로 하므로 미리 설치한다.

1
brew install graphviz

emacs 설정

1
2
3
4
5
6
7
8
;; 위에서 다운받은 plantuml.jar 위치를 지정해준다.
(setq org-plantuml-jar-path
      (expand-file-name "~/.emacs.d/custom/package/plantuml.jar"))
;; plantuml 문법으로 uml 작성 후, C-c C-c를 누르면 이미지가 생성된다
(add-hook 'org-babel-after-execute-hook
          (lambda ()
            (when org-inline-image-overlays
              (org-redisplay-inline-images))))

사용법

1
2
3
#+BEGIN_SRC plantuml :file 파일명.png
ClassA -> ClassB
#+END_SRC

이제 위의 코드 블록에서 C-c C-c를 누르면 결과 Uml이 출력이 된다.

This post is licensed under CC BY 4.0 by the author.

Doom mode line 설정

DDIA - 신뢰할 수 있고 확장 가능하며 유지보수하기 쉬운 애플리케이션