What is PlantUML
PlantUML is an open source text language to generate UML (Unified Modeling Language) diagrams.
Tip
・We recommend using curly brackets {} when noting PlantUML and LaTex syntax
Sample 1
```{plantuml}
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
```
Sample 2
```{plantuml}
package "Some Group" {
HTTP - [First Component]
[Another Component]
}
node "Other Groups" {
FTP - [Second Component]
[First Component] --> FTP
}
cloud {
[Example 1]
}
database "MySql" {
folder "This is my folder" {
[Folder 3]
}
frame "Foo" {
[Frame 4]
}
}
[Another Component] --> [Example 1]
[Example 1] --> [Folder 3]
[Folder 3] --> [Frame 4]
```
Sample 3
```{plantuml}
(*) --> "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" --> (*)
```
Sample 4
```{plantuml}
!define StudentName Misidentified vocational school student
!define CriminalName Middle school student criminal
!define BidderName Bidder
participant "StudentName" as Student
participant "CriminalName" as Criminal
participant "2HighSchoolGirls" as HS_2
participant "TicketShop" as TicketShop
participant "BidderName" as Bidder
Senmon -> Criminal : Sell ticket for 80,000 yen
Senmon <- Criminal : Buy
Senmon -> Criminal : Share bank account of “StudentName”
Criminal -> HS_2 : Sell ticket for 40,000 yen
Criminal <- HS_2 : Buy
Criminal -> HS_2 : Share bank account of “StudentName”
JK_2 -> Student : Deposit 40,000 yen each (total 80,000 yen)
Senmon -> Criminal : Request ticket buyer’s address
Criminal -> TicketShop : S ell ticket for 60,000 yen
TicketShop <- Bidder : Buy
Criminal -> TicketShop : Receive info of “BidderName”
Criminal <- TicketShop : Show info of “BidderName”
Senmon <- Criminal : Share address of “BidderName”
Senmon -> Bidder : Send ticket
TicketShop <- Bidder : Confirmation of received ticket
Criminal -> TicketShop : Sales withdrawal
Criminal <- TicketShop : Deposit sales to account of “CriminalName”
```
Sample 5
```{plantuml}
@startuml
User ||--o{ WatchRepository
WatchRepository }o--|| Repository
Repository ||--o{ Issue
Issue ||--o{ Event
User ||--o{ WatchIssue
WatchIssue }o--|| Issue
@enduml
```
Sample 6
```{plantuml}
actor Client
Client -> Rails : HTTP request
Rails -> Hypernova : { "name": "Editor", "props": { "foo", "bar" } }
Hypernova -> Rails : "<div class='editor'>...</div>"
Rails -> Client : HTTP response
```
Sample 7
```{plantuml}
actor Foo1
boundary Foo2
control Foo3
entity Foo4
database Foo5
collections Foo6
Foo1 -> Foo2 : To boundary
Foo1 -> Foo3 : To control
Foo1 -> Foo4 : To entity
Foo1 -> Foo5 : To database
Foo1 -> Foo6 : To collections
```
Sample 8
```{plantuml}
|Swimlane1|
start
:foo1;
|#AntiqueWhite|Swimlane2|
:foo2;
:foo3;
|Swimlane1|
:foo4;
|Swimlane2|
:foo5;
stop
```
Sample 9
```{plantuml}
Alice -> Bob: Authentication Request
alt successful case
Bob -> Alice: Authentication Accepted
else some kind of failure
Bob -> Alice: Authentication Failure
group My own label
Alice -> Log : Log attack start
loop 1000 times
Alice -> Bob: DNS Attack
end
Alice -> Log : Log attack end
end
else Another type of failure
Bob -> Alice: Please repeat
end
```
Sample 10
```{plantuml}
:Process1;
note left
Multi-line annotation
Multi-line annotation
end note
fork
:ParallelProcessing2-1;
fork again
:ParallelProcessing2-2;
end fork
if (some decision) then (yes)
:Process3;
elseif (some different decision) then (yes)
:Process4;
else (not applicable)
:Process5;
endif
repeat
:Process6;
repeat while (repeat decision?)
while (repeat decision?) is (loop necessary)
:Process7;
-> string arrow;
endwhile (loop unnecessary)
end
```
LaTeX syntax
To use LaTeX syntax, use the label {latex}to write equations with MathJax. In addition, use $`...` $ for inlineMath, which allows you to embed equations in text.
For sample LaTeX notations by MathJax, please refer to the MathJax basic tutorial and quick reference .