Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring/image handling #46

Merged

Conversation

oniboni
Copy link
Collaborator

@oniboni oniboni commented Oct 13, 2023

fix: downloaded image handling

  • place referenced image files next to page
  • take metadata into account for image name generation
  • update to mkdocs 1.4 plugin config
  • remove temp dir and download dir
  • deprecate DownloadImages -> HttpMethod='POST' realizes this
    functionality as well
    • let option automatically set HttpMethod: 'POST' for compatibility
  • deprecate DownloadDir option to get rid of relative and absolute
    path issues
  • move kroki response handling to kroki client
  • add type hints
  • docs: update config section

Fixes #11, fixes #32, fixes #39, fixes #41

* place referenced image files next to page
* take metadata into account for image name generateion
* update to mkdocs 1.4 plugin config
* remove temp dir and download dir
* deprecate `DownloadImages` -> `HttpMethod='POST'` realizes this
  functionality as well
* deprecate `DownloadDir` option to get rid of relative and absolute
  path issues
* move kroki response handling to kroki client
* add type hints
@stanislav-c
Copy link

We have tested this PR and can confirm that it fixes the downloaded image URLs. We use this plugin in our organization and would be grateful if you released a new version of the plugin containing this fix.

@karelbemelmans
Copy link

I can also confirm this plugin works for us. Would be nice to get this merged so we can switch from our fork to the upstream release.

@Moulick
Copy link

Moulick commented Jan 4, 2024

@b-bittner any hopes of getting this in please?

@karelbemelmans
Copy link

Just an FYI here: This code change makes the plugin require a higher Python version than 3.8. Our techdocs fail to render with 3.8, but work with 3.10:

Failed example:

    File "/usr/local/lib/python3.8/site-packages/kroki/plugin.py", line 17, in <module>
      from kroki.config import KrokiDiagramTypes
    File "/usr/local/lib/python3.8/site-packages/kroki/config.py", line 6, in <module>
      class KrokiDiagramTypes:
    File "/usr/local/lib/python3.8/site-packages/kroki/config.py", line 61, in KrokiDiagramTypes
      file_types: list[str],
  TypeError: 'type' object is not subscriptable

@b-bittner
Copy link
Contributor

Thanks for your hint, just updated the dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants