MkDocs¶
MkDocs is a Python based tool to create HTML documentations with navigation and search based on Markdown. It supports plugins and themes to provide additional features.
A very powerful extension is Material for MkDocs.
Installation:
pip install mkdocs-material
PlantUML integration¶
Requirements¶
PlantUML needs to be available as command plantuml
.
First download PlantUML:
curl -L http://sourceforge.net/projects/plantuml/files/plantuml.1.2022.13.jar/download > /opt/plantuml.jar
Then create a local script /usr/local/bin/plantuml
with the following contents:
#!/bin/sh
java -jar /opt/plantuml.jar ${@}
Installation¶
pip install plantuml-markdown
Use¶
First add the plugin to mkdocs.yml
and set SVG as output format (by default bitmaps are generated):
markdown_extensions:
- plantuml_markdown:
format: svg
To add a PlantUML diagram embed it as code block with plantuml
as language:
```plantuml
@startuml
component "Component One"
component "Component Two"
"Component One" --> "Component Two"
```
The result may look like this: