Mac VSCode: How to plantUML preview within markdown.
$ mkdir -p ~/java
$ cd ~/java
$ brew install maven
$ git clone https://github.com/plantuml/plantuml-server.git
$ cd plantuml-server
$ export PATH=/opt/apache-maven-3.6.3/bin:$PATH
- Install
PlantUML
andMarkdown PDF
extensions. - Add PlantUML Settings.
⌘⇧p
- Select
Preferences: Open Settings (JSON)
- Add setting to
settings.json
"plantuml.render": "PlantUMLServer",
"plantuml.server": " http://localhost:9999/plantuml",
"plantuml.commandArgs": [ "-Xmx2g", "-DPLANTUML_LIMIT_SIZE=16384" ],
- Choose
Allow local content
in VSCode warning dialog.
$ cd ~/java/plantuml-server
$ mvn jetty:run -Djetty.port=9999
- create a new file
a.md
' a.md
@startuml
A->B: Hello
@enduml
⌥d
to prerview
Nice work thanks! Is it worth adding a bash function to simplify the plantuml wakeup?I use the below:
function markdown () {
## Starts plantuml server
cur_dir=$PWD
cd ~/java/plantuml-server
nohup mvn jetty:run -Djetty.port=9999 &
cd $cur_dir
}