AVATEAM-IT-SYSTEMHAUS / mkdocs-kroki-plugin

MkDocs plugin for Kroki-Diagrams
MIT License
46 stars 29 forks source link

BPMN not working in release 0.8.1 #71

Closed brunobcosta closed 1 month ago

brunobcosta commented 1 month ago

After release 0.8.1 the BPMN diagrams is not working anymore. I checked configs and logs to figure a config field renamed in this version is the problem:

mkdocs.yml:

plugins:
  - techdocs-core
  - kroki:
      ServerURL: "http://host.docker.internal:8000"
      FencePrefix: ""
      HttpMethod: "POST"
      EnableBpmn: true

teckdocs-cli logs:

verbose: DEBUG   -  kroki: Configuring config: {'ServerURL': 'http://host.docker.internal:8000', 'EnableBlockDiag': True, 'EnableBpmn': True, 'EnableExcalidraw': True, 'EnableMermaid': True, 'EnableDiagramsnet': False, 'HttpMethod': 'POST', 'UserAgent': 'kroki.config/0.8.1', 'FencePrefix': '', 'FileTypes': ['svg'], 'FileTypeOverrides': {}, 'FailFast': False, 'DownloadImages': None, 'Enablebpmn': None, 'DownloadDir': None}
verbose: DEBUG   -  kroki: File and Diagram types configured: {'mermaid': 'svg', 'excalidraw': 'svg', 'blockdiag': 'svg', 'seqdiag': 'svg', 'actdiag': 'svg', 'nwdiag': 'svg', 'packetdiag': 'svg', 'rackdiag': 'svg', 'bytefield': 'svg', 'ditaa': 'svg', 'erd': 'svg', 'graphviz': 'svg', 'nomnoml': 'svg', 'plantuml': 'svg', 'structurizr': 'svg', 'c4plantuml': 'svg', 'svgbob': 'svg', 'vega': 'svg', 'vegalite': 'svg', 'wavedrom': 'svg', 'pikchr': 'svg', 'umlet': 'svg', 'd2': 'svg', 'dbml': 'svg', 'tikz': 'svg', 'symbolator': 'svg', 'wireviz':'svg'}

Note that we have two fields to BPPM (the new one and the deprecated) but only one has value:

'EnableBpmn': True
'Enablebpmn': None

Checking the code I noticed that the variable was renamed and the old one marked as deprecated, but it was not changed where it is used: https://github.com/AVATEAM-IT-SYSTEMHAUS/mkdocs-kroki-plugin/blob/6460fae9e42a76603d9ddc8fd60ae1f872b98c96/kroki/plugin.py#L21

The MKDocs lib transfers the value to the new config variable and raises a warning about the deprecated, but also cleans the old variable and don't raise error if you still use it. Maybe an improvement to that lib!

oniboni commented 1 month ago

Thank you for the issue and the fix! :tada:

oniboni commented 1 month ago

Released.