Search code examples
yamlplantumlmkdocs

Stuck with the PlantUml within Mkdocs


I'm configuring the PlantUML plugin for my MkDocs installation and I'm stuck. I cannot configure mkdocs.yml correctly. I get either configuration errors or parsing errors every time I enable this plugin.

The errors are:

ERROR    -  Config value: 'plugins'. Error: Invalid config options for the > 'build_plantuml' plugin.

Error: MkDocs encountered an error parsing the configuration file:
while parsing a block mapping
 in "/home/igor/mksite/mkdocs.yml", line 1, column 1
expected <block end>, but found '<block mapping start>'
 in "/home/igor/mksite/mkdocs.yml", line 17, column 5

Error: MkDocs encountered an error parsing the configuration file:
mapping values are not allowed here
in "/home/igor/mksite/mkdocs.yml", line 15, column 13

What is my problem?

Here is my mkdocs.yml file:

site_name: CardsMobile
site_url: http://127.0.0.1:8000/
nav:
- index: index.md
- simplePage: simplePage.md
- testUml: testuml.md
- images: images.md
docs_dir: /home/igor/mksite/docs
repo_url: https://github.com/ishahbazyan/mkdocs-test.git/
repo_name: mkdocs-test

plugins:
- search
- build_plantuml:
  - render: local # or "local" for local rendering
  - bin_path: /home/igor/mksite/ # ignored when render: server
  - server: http://www.plantuml.com/plantuml # offical plantuml server
  - output_format: svg # or "png"
  - diagram_root: docs/diagrams # should reside under docs_dir
  - output_folder: out
  - input_folder: src
  - input_extensions: puml # comma separated list of extensions to parse, by default every file is parsed```

Solution

  • I am using mkdocs with the plugin in a similar configuration. I believe the error is comming from the - bin_path: /home/igor/mksite/ # ignored when render: server. It is expecting to have a binary that can execute the plantuml. I'm in Windows, so in my case, I have a .bat file calling the plantuml.jar executable.

    You should add the path to the binary plantuml file. Or use the option server:

      - render: server # or "local" for local rendering
    

    To use the plantuml server to render:

      - server: http://www.plantuml.com/plantuml # offical plantuml server
    

    Hope this is useful.