👘

How to handle PlantUML

2022/02/02に公開約1,300字

In this article, I introduce how to use plantUML.

Omg, I got the detailed reference with discription.

https://plantuml.com/ja/guide

Build an environment

$ source ~/.zshrc
$ brew install graphviz adoptopenjdk plantuml

let's code in .pu file. Btw, the extension, .pu is so cute, is it? haha.

@startuml name

actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C
@enduml

It's very easy because it is drawn on vscode:D
if you want to output as an image, you have to follow the steps below.

  1. ⌘ + Shift + P Open the command palette.
  2. Enter PlantUML: Export Current Diagram in the command palette.
    After reinstalling vscode, the preview disappeared in mystery, so I solved it as follows.
  3. Execute the following command.
$ docker run -d -p 8080:8080 plantuml/plantuml-server:jetty
  1. In preference → Plantuml: Render → PlantUMLServer、Plantuml: Server → http://localhost:8080/ 
    Then it was displayed and the image could be output.
    Reference article:
    https://qiita.com/zonbitamago/items/7946acfb4cbaa139f00a
    https://qiita.com/Ping/items/64930e8c21fb95bec095#uml画像の保存

Excute

if you want to output an image, enter option+D

Discussion

ログインするとコメントできます