Here's a note on how to use PlantUML with Visual Studio Code by October 30, 2020. I created it based on this person's article. (Https://qiita.com/couzie/items/9dedb834c5aff09ea7b2)
The procedure is as follows. Environment introduction
Operation check
How to deal with each error
Reference information
Install Java as an effective environment for PlantUML.
This is the software used to draw UML with PlantUML.
If such a screen is displayed, press ** [Execute] **.
Install PlantUML as an extension of Visual Studio Code.
** * Precautions If you install the extension in the remote state, it will not work, so make sure that you are not connected remotely. ** ** From the bottom left of VS Code, make sure you are not remote OK if the green mark is in this state
This completes the environment introduction
@startuml
(*) --> "Find Event"
"Find Event" -> "Attend Event"
if "Capacity?" then
->[ok] "Create Ticket"
else
-->[full] if "Standby?" then
->[ok] "Standby Ticket"
else
-->[no] "Cancel Ticket"
"Cancel Ticket" --> (*)
endif
endif
"Create Ticket" --> ==show==
"Standby Ticket" --> ==show==
==show== --> "Show Ticket"
"Show Ticket" --> (*)
@enduml
OK if a preview screen like the above image is displayed
Output the created UML as an image
Open the command palette with ** "Ctrl + Shift + P" **
Enter ** PlantUML: Export Current Diagram **
Select the output format from ** png, svg, eps, pdf, vdx, xmi, scxml, html **
Four. The image is saved in the directory where the code is saved. (You can check the save destination from the terminal)![UML1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/837080/783ecf61-9030-ec65-7a05 -386717e43e18.png)
*** Installation is complete if possible. However, if the error image is displayed, see how to deal with each error ***
Describe the cause and remedy when an error image is output when ** "Alt + D" ** is entered. The error is mainly output when the Graphviz or PlantUML installation is incorrect.
In case of such output, Graphviz has not been installed. Check the save destination to see if Graphviz is installed.
In the case of the above image, it is possible that Graphviz's PATH does not pass. Such an image does not appear in the version installed this time, but it may be output in the case of another version. As a workaround
dot -c
This image shows PlantUML running in a remote environment. Or you may have PlantUML installed in a remote environment. Make sure you are not in a remote environment and install PlantUML.
If you cannot use PlantUML by all means, online server (http://www.plantuml.com/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000) To use. However, the code cannot be saved, so be careful to save it separately.
Regarding environment introduction https://qiita.com/couzie/items/9dedb834c5aff09ea7b2 https://qiita.com/BARANCE_TW/items/c3f7816d38cc9e746bbd https://qiita.com/walkerjito/items/a7dd3fece3c6414867b2
Article on how to write PlantUML
PlantUML Check Sheet(https://qiita.com/ogomr/items/0b5c4de7f38fd1482a48) UML drawing life at PlantUML (https://qiita.com/qualitia_cdev/items/55644b15eaf7e8328ac1) PlantUML Overview (https://plantuml.com/ja/)
If you search for [PlantUML] etc., it will be quite good
Recommended Posts