Hyperlinks have been introduced in iterative mode so there have been some slight syntax changes with different versions.
Starting with version 8058, syntax about hyperlink is now clearly defined and stable.
Unfortunately, there are some tiny changes from previous legacy syntax, so you may have to update your existing source diagrams.
This is something we do not like, because we try to guarantee ascending compatibility as far as possible.
But in some cases, we have to move forward.
The good news is that older legacy diagrams will still be generated by newer versions of PlantUML.
The only impact is that some links may be displayed differently, so we think it is an acceptable change.
Simple links are define using two square brackets (or three square brackets for field or method on class diagram).
Example:
[[http://plantuml.com]]
[[]](empty link)
Link with optional label
It is possible to give an optional label that will be printed instead of the link itself.
A space is used as separator after the URL itself.
Example:
[[http://plantuml.com This label is printed]]
Link with optional tooltip
Finally you can also have an optional tooltip using round brackets, just after the URL and before the optional label.
Example:
[[http://plantuml.com{Optional tooltip} This label is printed]]
Only tooltip
You can also have only a tooltip using round brackets.
Example:
[[{A tooltip}]]
Only tooltip and label
You can also have only a tooltip using round brackets, and a label.
Example:
[[{A tooltip} This label is printed]]
シーケンス図におけるリンク
以下はリンクの機能の例です:
@startuml
actor Bob [[http://plantuml.com/sequence]]
actor "This is [[http://plantuml.com/sequence Alice]] actor" as Alice
Bob -> Alice [[http://plantuml.com/start]] : hello
note left [[http://plantuml.com/start]]
a note with a link
end note
Alice -> Bob : hello with [[http://plantuml.com/start{Tooltip for message} some link]]
note right [[http://plantuml.com/start]] : another note
note left of Bob
You can use [[http://plantuml.com/start links in notes]] also.
end note
@enduml
Links in sequence diagram
The following example lists some links features:
@startuml
actor Bob [[http://plantuml.com/sequence]]
actor "This is [[http://plantuml.com/sequence Alice]] actor" as Alice
Bob -> Alice [[http://plantuml.com/start]] : hello
note left [[http://plantuml.com/start]]
a note with a link
end note
Alice -> Bob : hello with [[http://plantuml.com/start{Tooltip for message} some link]]
note right [[http://plantuml.com/start]] : another note
note left of Bob
You can use [[http://plantuml.com/start links in notes]] also.
end note
@enduml
クラス図におけるリンク
@startuml
class Car [[http://plantuml.com/link]]
class Wheel [[http://plantuml.com/sequence]]
note left [[http://plantuml.com]]
foo
end note
Car *-- Wheel [[http://plantuml.com/class]] : has some
@enduml
@startuml
class Car {
- Some field [[[http://plantuml.com]]]
Some method() [[[http://plantuml.com/link]]]
}
@enduml
@startuml
Object <|-- Foo
class Foo {
+ Object[] [[[http://www.google.com]]]
+ methods1() [[[http://www.yahoo.com/A1{Some explainations about this method}]]]
+ methods2() [[[http://www.yahoo.com/A2]]]
}
class Foo2 {
+ methods1() [[[http://www.yahoo.com/B1]]]
+ methods2() [[[http://www.yahoo.com/B2]]]
}
class Object [[http://www.yahoo.com]]
@enduml
Links in class diagram
@startuml
class Car [[http://plantuml.com/link]]
class Wheel [[http://plantuml.com/sequence]]
note left [[http://plantuml.com]]
foo
end note
Car *-- Wheel [[http://plantuml.com/class]] : has some
@enduml
There is a special syntax with 3 square brackets in class definition when you want to define
a link on field or method.
For example:
@startuml
class Car {
- Some field [[[http://plantuml.com]]]
Some method() [[[http://plantuml.com/link]]]
}
@enduml
@startuml
Object <|-- Foo
class Foo {
+ Object[] [[[http://www.google.com]]]
+ methods1() [[[http://www.yahoo.com/A1{Some explainations about this method}]]]
+ methods2() [[[http://www.yahoo.com/A2]]]
}
class Foo2 {
+ methods1() [[[http://www.yahoo.com/B1]]]
+ methods2() [[[http://www.yahoo.com/B2]]]
}
class Object [[http://www.yahoo.com]]
@enduml
アクティビティ図におけるリンク
@startuml
start
[[http://plantuml.com]]:Some activity;
:Some [[http://plantuml.com link]];
end
@enduml
Links in activity diagram
@startuml
start
[[http://plantuml.com]]:Some activity;
:Some [[http://plantuml.com link]];
end
@enduml
@startuml
:Foo:
note left of Foo [[http://www.google.com]]
This is a note
end note
note right of Foo
Yet another link to [[http://www.google.com]] as demo.
You can also [[http://www.yahoo.fr specify a text]] for the link.
And even [[http://www.yahoo.fr{This is a tooltip} add a tooltip]] to the link.
end note
@enduml
It is also possible to specify a link at the beginning of a note (the link applies to the full note), or inside a note (for a portion of the note).
@startuml
:Foo:
note left of Foo [[http://www.google.com]]
This is a note
end note
note right of Foo
Yet another link to [[http://www.google.com]] as demo.
You can also [[http://www.yahoo.fr specify a text]] for the link.
And even [[http://www.yahoo.fr{This is a tooltip} add a tooltip]] to the link.
end note
@enduml
@startuml
Bob -> Alice : ok
url of Bob is [[http://www.google.com]]
@enduml
クラス図
@startuml
skinparam topurl http://www.google.com
Dog --|> Mammal
url of Mammal is [[/search]]
url of Dog is [[http://www.yahoo.com{This is Dog}]]
Dog o-- Cat
Cat --|> Mammal
@enduml
ユースケース図
@startuml
actor Mamal
usecase Dog
url of Mamal is [[http://www.google.com]]
url of Dog is [[http://www.yahoo.com{This is Dog}]]
@enduml
コンポーネント図、配置図
@startuml
node Mamal
component Dog
url of Mamal is [[http://www.google.com]]
url of Dog is [[http://www.yahoo.com{This is Dog}]]
@enduml
@startuml
Bob -> Alice : ok
url of Bob is [[http://www.google.com]]
@enduml
On class diagram
@startuml
skinparam topurl http://www.google.com
Dog --|> Mammal
url of Mammal is [[/search]]
url of Dog is [[http://www.yahoo.com{This is Dog}]]
Dog o-- Cat
Cat --|> Mammal
@enduml
On usecase diagram
@startuml
actor Mamal
usecase Dog
url of Mamal is [[http://www.google.com]]
url of Dog is [[http://www.yahoo.com{This is Dog}]]
@enduml
On component or deployment diagram
@startuml
node Mamal
component Dog
url of Mamal is [[http://www.google.com]]
url of Dog is [[http://www.yahoo.com{This is Dog}]]
@enduml