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

Failure during GitHub build #35

Closed phreed closed 3 months ago

phreed commented 3 months ago

While running a Run mkdocs gh-deploy --force in a GitHub action I got the following error.

Traceback (most recent call last):
PDF export is disabled (set environment variable ENABLE_PDF_EXPORT to 1 to enable)
root dir: /home/runner/work/FreeTAKServer-User-Docs/FreeTAKServer-User-Docs/docs/diagrams, src dir: /home/runner/work/FreeTAKServer-User-Docs/FreeTAKServer-User-Docs/docs/diagrams/src
Could not find include [Errno 2] No such file or directory: '/home/runner/work/FreeTAKServer-User-Docs/FreeTAKServer-User-Docs/docs/diagrams/src/osaPuml/Common.puml'[Errno 2] No such file or directory: '/home/runner/work/FreeTAKServer-User-Docs/FreeTAKServer-User-Docs/docs/diagrams/osaPuml/Common.puml'
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/mkdocs_build_plantuml_plugin/plantuml.py", line 275, in _readIncludeLine
    temp_file = self._read_incl_line_file(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/mkdocs_build_plantuml_plugin/plantuml.py", line 303, in _read_incl_line_file
    with open(inc_file_abs, "r") as inc:
         ^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/FreeTAKServer-User-Docs/FreeTAKServer-User-Docs/docs/diagrams/src/osaPuml/Common.puml'

The mkdocs.yml is equipped with the following plugin configuration:


  - build_plantuml:
      render: 'server'
      bin_path: "/usr/local/bin/plantuml"
      server: 'https://www.plantuml.com/plantuml'
      disable_ssl_certificate_validation: true
      output_format: 'svg'
      allow_multiple_roots: false
      diagram_root: 'docs/diagrams'
      output_folder: 'gen'
      input_folder: 'src'
      input_extensions: ''

It seems to me that the plugin is looking for a local osaPuml/Common.puml. When I load the puml files into 'https://www.plantuml.com/plantuml' manually they generate svg files correctly.

This is for an open source project FreeTAKServer. https://github.com/babeloff/FreeTAKServer-User-Docs/actions/runs/8383303790/job/22958758554

phreed commented 3 months ago

I found the problem. It is mostly a me error but I think the documentation could be improved.

It was not clear that httplib2 needed to installed by pip. The default input_extensions is blank, I presumed changing the suffix on a puml file would prevent it from being processed. A file other than those I was expecting to be processed was picked up and it had an !include bug.

I am working on a fork that improves these things. Expect a pull request soon.

christo-ph commented 3 months ago

Thank you for your contribution, very welcome. I released 1.10 with your PR.