我有 PlantUML 代码:
@startuml
hide methods
hide stereotypes
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
!define Enum(name,desc) class name as "desc" << (E,#FFFFAA) >>
!define primary_key(x) <b>x</b>
!define not_null(x) <u>x</u>
!define unique(x) <color:green>x</color>
Enum(menuitemtype,"Menu item types") {
category
text
sticker
user_action
}
Table(menuitem,"Menu item") {
primary_key(id) INTEGER
not_null(unique(name)) VARCHAR[32]
type INTEGER
anonymous BOOLEAN
parent INTEGER
type INTEGER
}
Table(chat,"Telegramm chats") {
primary_key(id) INTEGER
not_null(unique(chat_id)) INTEGER
is_group BOOLEAN
}
Table(requester,"Bot requester") {
primary_key(id) INTEGER
not_null(unique(tele_id)) INTEGER
is_boot BOOLEAN
user_name VARCHAR[32]
last_name VARCHAR[32]
first_name VARCHAR[32]
is_active BOOLEAN
last_access DATETIME
}
menuitem -- menuitemtype
menuitem "0..N" --> "1" menuitem
requester "1" --> "N" chat
@enduml
我从这里获取代码:https ://gist.github.com/QuantumGhost/0955a45383a0b6c0bc24f9654b3cb561
当 NetBeans 的 PlantUML 插件实际显示结构时:
/usr/share/plantuml/plantuml.jar
使用 apt-get 在 Ubuntu 16 上安装的 java 工具会出现以下错误:
$ cat SystemDB/schema.puml | plantuml -syntax -v
(0.000 - 119 Mo) 117 Mo - PlantUML Version 8024
(0.048 - 119 Mo) 115 Mo - GraphicsEnvironment.isHeadless() false
ERROR
5
Syntax Error?
并生成后续文件
根据:http: //plantuml.com/PlantUML_Language_Reference_Guide.pdf - 第 1.21 章,我看到刻板印象很方便