Blog Logo
TAGS

mkdocs_puml - Bringing PlantUML Diagrams to MkDocs

`mkdocs_puml` is a fast and simple package that brings plantuml diagrams to MkDocs documentation. This package uses PlantUML as an HTTP service to send GET requests and receives `svg` images representing the diagrams. The `plantuml` plugin parses `.md` documentation files and looks for `puml` code blocks. When a `puml` code block is found, it is saved to the buffer for a later request to the PlantUML service, and in this step, we replace the `puml` block with the uuid. After all pages are parsed, `plantuml` plugin requests PlantUML service with the collected diagrams. To install `mkdocs_puml`, run the following command: `pip install mkdocs_puml`. To use it, just add the `plantuml` plugin to the `plugins` section of your `mkdocs.yml` file. The package also provides different parameters that can be used in the `mkdocs.yml` file to configure the plugin according to your requirements. If you wish to run [plantuml/plantuml-server](https://hub.docker.com/r/plantuml/plantuml-server) as a Docker container, you can add a new service to the `docker-compose.yml` file and substitute `puml_url` config with a local URL in the `mkdocs.yml` file. This package is an excellent tool for generating diagrams in documentation.