mdBook PlantUML

mdBook preprocessor to render PlantUML code blocks as images in your book.

Contents

Usage

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).

Options

Example server configuration

Below is an example server configuration.

You can test your server by appending the URL with "/png/SoWkIImgAStDuGh8ISmh2VNrKT3LhR5J24ujAaijud98pKi1IW80". Using the example below 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" ```

Troubleshooting rendering issues

mdBook communicates to the preprocessor using stdio. As a result log output from the preprocessor is not printed to the screen. When the preprocessor's markdown error output is insufficient for you it is posibble 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" ```

Change log

0.5.0 (2019-11-08)

0.4.0 (2019-09-25)

0.3.0 (2019-08-29)

0.2.0 (2019-07-08)

0.1.0 (2019-07-08)

Building and installing on Linux

I primarily work on Windows, and rust is not that portable yet apparently.

When you get the following error while installing/building mdbook-plantuml on Linux: failed to run custom build command for `openssl-sys v0.9.49`

Make sure you have libssl-dev and pkg-config installed: sh sudo apt update sudo apt install libssl-dev pkg-config