50 lines
873 B
Markdown
50 lines
873 B
Markdown
Ставим jre или jdk:
|
||
|
||
```shell
|
||
sudo add-apt-repository ppa:webupd8team/java
|
||
sudo apt update && sudo apt install oracle-java8-installer -y
|
||
```
|
||
|
||
Ставим graphviz:
|
||
|
||
```shell
|
||
sudo apt install graphviz -y
|
||
```
|
||
|
||
Качаем plantuml:
|
||
|
||
```shell
|
||
mkdir -p ~/Tools/plantuml/
|
||
wget <https://sourceforge.net/projects/plantuml/files/latest/download> -O ~/Tools/plantuml/plantuml.jar
|
||
```
|
||
|
||
Настраиваем алиас в `.bashrc`:
|
||
|
||
```shell
|
||
...
|
||
alias puml="java -jar /home/$USER/Tools/plantuml/plantuml.jar"
|
||
source ~/.bashrc
|
||
```
|
||
|
||
## Пример использования
|
||
|
||
Создаем файл с диаграммой, например ~/Temp/seq-diagram.txt:
|
||
|
||
```
|
||
@startuml
|
||
Alice -> Bob: test
|
||
@enduml
|
||
```
|
||
|
||
Запускаем генерацию картинки:
|
||
|
||
```shell
|
||
puml ~/Temp/seq-diagram.txt
|
||
```
|
||
|
||
Появится файл:
|
||
|
||
```
|
||
~/Temp/seq-diagram.png
|
||
```
|