@wafer-li 's hexo-filter-plantuml has been transfered to me duo to maintain issues.
I have created another hexo plugin called hexo-filter-kroki, which supports 20+ diagrams (including plantuml).
Features
- Generate raw/base64/urlencoded svg at compile time, no external css and js required.
- Privacy guaranteed. Support rendering locally or self-hosting server.
- Zero npm dependencies.
How Does it work
Install
npm install --save hexo-filter-plantuml
Minimum configuration
No configuration required. By default, it will send your text to plantuml.com
for rendering, and the base64-encoded images will be inlined in the html.
Advanced configuration
Server-side(recommend)
Please keep in mind, if you want more about privacy/safety, please replace your own self-hosting render server.
plantuml:
render: "PlantUMLServer"
server: "http://www.plantuml.com/plantuml"
link: "inline"
outputFormat: "svg"
Client-side
It may be slower for plantuml.jar will restart JVM per code fragment.
plantuml:
render: "Local"
link: "inline"
GraphvizDotFile: "/usr/local/bin/dot"
PlantJar: "/usr/local/Cellar/plantuml/1.2021.5/libexec/plantuml.jar",
outputFormat: "svg"
How to use it?
puml
and plantuml
directives both work.
```plantuml
@startuml
Object <|-- ArrayList
Object : equals()
ArrayList : Object[] elementData
ArrayList : size()
@enduml
```
@startuml
and @endpuml
are ALWAYS required or the image will fail to be generated.
or
{% plantuml %}
@startuml
Object <|-- ArrayList
Object : equals()
ArrayList : Object[] elementData
ArrayList : size()
@enduml
{% endplantuml %}
Plugin will pick up block body and replace it with generated base64 svg diagram.
see more details at http://plantuml.com/sitemap-language-specification