mkdocs_build_plantuml icon indicating copy to clipboard operation
mkdocs_build_plantuml copied to clipboard

Endless loop with mkdocs serve if plantuml diagrams contains a name

Open DanielK990 opened this issue 10 months ago • 1 comments

If a plantuml diagram contains a diagram name as follows:

@startuml "mydiagram"
a --> b
b --> a
@enduml

and the puml file is modified while mkdocs serve is running, this leads to an infinite loop in mkdocs serve. The plantuml diagrams with name in the diagram are continuously re-generated. Diagrams without name are not affected.

Used versions:

  • mkdocs==1.6.1
  • mkdocs-build-plantuml-plugin==1.9.0

mkdocs.yaml

plugins:
  - search
  - awesome-pages
  - build_plantuml:
      render: 'local' # or "local" for local rendering
      bin_path: '.plantuml/plantuml' # ignored when render: server
      output_format: 'svg' # or "png"
      allow_multiple_roots: false # in case your codebase contains more locations for diagrams (all ending in diagram_root)
      diagram_root: 'docs/diagrams' # should reside under docs_dir
      output_folder: 'out'
      input_folder: 'src'
      input_extensions: '' # comma separated list of extensions to parse, by default every file is parsed
      theme_enabled: false
  - mkdocs-material-adr/adr:
      graph_file: adrs/overview.md
  - material/tags

DanielK990 avatar Feb 19 '25 11:02 DanielK990

When formed like this, I don't see the issue:

@startuml my-page

However, if I accidentally have two tags with different names in the same file, it will endless reload:

@startuml my-page

@startuml my-oops

This is an invalid file. It seems to get hung up for a while during processing, then somehow triggers a watch once the file drops. I think there is a larger issue with having the output dir underneath docs.

wtjones avatar Apr 29 '25 21:04 wtjones