quantorconsulting / mkdocs_build_plantuml

MkDocs plugin to help generate your plantuml images locally or remotely as files (NOT inline)
MIT License
57 stars 15 forks source link

Could not find include 'BuildPlantumlPlugin' error #21

Closed michael-nok closed 2 years ago

michael-nok commented 2 years ago

It seems the sourcing of the theme folder is now broken.

Source puml files are in docs/diagram/src.

mkdocs.yml

  - build_plantuml:
      render: "local"
      bin_path: "/usr/local/bin/plantuml"
      server: "http://www.plantuml.com/plantuml"
      output_format: "svg"
      diagram_root: "docs/diagrams"
      output_folder: "out"
      input_folder: "src"
root dir: /docs/docs/diagrams, src dir: /docs/docs/diagrams/src
Converting /docs/docs/diagrams/src/test.puml
Could not find include 'BuildPlantumlPlugin' object has no attribute '_readInclLineFile'[Errno 2] No such file or directory: '/docs/docs/include/themes/light.puml'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/mkdocs_build_plantuml_plugin/plantuml.py", line 235, in _readInclLine
    temp_file = self._readInclLineFile(
AttributeError: 'BuildPlantumlPlugin' object has no attribute '_readInclLineFile'

FileNotFoundError: [Errno 2] No such file or directory: '/docs/docs/include/themes/light.puml'

However, I can avoid this error if I change the diagram_root parameter to just "diagrams". Now the mkdocs build command works, but plantuml does not build any output files.

root dir: /docs/diagrams, src dir: /docs/diagrams/src
INFO     -  Cleaning site directory
INFO     -  Building documentation to directory: /docs/site
INFO     -  Documentation built in 9.46 seconds
michael-nok commented 2 years ago

In looking at lines 235-237, I see this:

            temp_file = self._readInclLine(
                diagram, temp_file, dark_mode, inc_file_abs
            )

Later, lines 243-245 has the following:

                temp_file = self._read_incl_line_file(
                    diagram, temp_file, dark_mode, inc_file_abs
                )

This is the procedure definition.

    def _read_incl_line_file(self, diagram, temp_file, dark_mode, inc_file_abs):
michael-nok commented 2 years ago

https://github.com/christo-ph/mkdocs_build_plantuml/pull/22

christo-ph commented 2 years ago

Very stupid mistake from my side. Sorry about that.

Thank you very much for your support!

Released 1.7.3 with your fix.