mdBook preprocessor to render PlantUML code blocks as images in your book.
First create the preprocessor in your book.toml file: ```toml [book] authors = ["Dzjengis Khan"] multilingual = false src = "src" title = "mdBook PlantUML preprocessor"
[preprocessor.plantuml] plantuml-cmd="plantuml.exe" ```
The above assumes both the mdbook-preprocessor and the plantuml executable are on your path.
Then simply add a PlantUML code block in your book text: ````markdown Some text here
plantuml
@startuml
A --|> B
@enduml
Some more text.
````
The plantuml code block will be replaced an image reference to an SVG image if possible, or png if PlantUML does not support svg for the requested diagram type (i.e. ditaa).
Below is an example server configuration.
You can test your server by appending the URL with "/png/SoWkIImgAStDuGh8ISmh2VNrKT3LhR5J24ujAaijud98pKi1IW80", in this example you'd end up with this URL. When it is working correctly you should see the following image:
```toml [book] authors = ["Dzjengis Khan"] multilingual = false src = "src" title = "mdBook PlantUML preprocessor"
[preprocessor.plantuml] plantuml-cmd="http://localhost:8080/plantuml" ```
mdBook communicates to the preprocessor using stdio. As a result no log output from the preprocessor is printed to screen. When the preprocessor's markdown error output is insufficient for you it is also to redirect logging to the file ./output.log. by using the command line switch -l. See the config below for an example:
```toml [book] authors = ["Sytse Reitsma"] multilingual = false src = "src" title = "mdBook E2E test book"
[preprocessor.plantuml] plantuml-cmd="http://localhost:8080/plantuml" command = "mdbook-plantuml -l" ```