oniboni / mkdocs-inline-svg-plugin

MIT License
0 stars 2 forks source link

Upgrade to work with mkdocs 1.5 #1

Closed Moulick closed 4 months ago

Moulick commented 1 year ago

Since mkdocs 1.5 has been released, can you please upgrade the dependency. I would submit a PR but I tried doing it locally but run into errors. I don't know enough about mkdocs to debug 😞

ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /images/kroki_generated/Tips%20%26%20Tricks-71c25a34c7a0ef962e56753a840cd334.svg (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x108daf1d0>: Failed to establish a new connection: [Errno 61] Connection refused'))

Local test logs ```shell INFO - Building documentation... INFO - kroki.plugin Configuring: {'ServerURL': 'https://kroki.io', 'EnableBlockDiag': True, 'Enablebpmn': True, 'EnableExcalidraw': True, 'EnableMermaid': True, 'EnableDiagramsnet': True, 'HttpMethod': 'POST', 'DownloadImages': True, 'EmbedImages': False, 'DownloadDir': 'images/kroki_generated', 'FencePrefix': 'kroki-', 'FileTypes': ['svg'], 'FileTypeOverrides': {}} INFO - kroki.config File and Diagram types configured: {'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', 'blockdiag': 'svg', 'seqdiag': 'svg', 'actdiag': 'svg', 'nwdiag': 'svg', 'packetdiag': 'svg', 'rackdiag': 'svg', 'bpmn': 'svg', 'excalidraw': 'svg', 'mermaid': 'svg', 'diagramsnet': 'svg'} INFO - kroki.client Initialized: POST, https://kroki.io INFO - [INLINE_SVG] Configuring: {'AltName': 'Kroki', 'IncludeAssets': False, 'AssetDir': 'assets/', 'PatchStyle': False} INFO - Cleaning site directory INFO - An absolute path to '/...' is included in the 'nav' configuration, which presumably points to an external resource. INFO - kroki.plugin reading kroki block from file: "/Users/moulick.aggarwal/redacted/redacted/redacted/docs/diag/file.excalidraw" ERROR - Error reading page 'Tips & Tricks.md': HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /images/kroki_generated/Tips%20%26%20Tricks-71c25a34c7a0ef962e56753a840cd334.svg (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /images/kroki_generated/Tips%20%26%20Tricks-71c25a34c7a0ef962e56753a840cd334.svg (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused')) ```

PS: Thank you for the plugin!

oniboni commented 1 year ago

Thank you for the issue!

I've just removed the version pinning, bc it does not make any sense on this side as a middleware package without any tests (yet!) :neutral_face: I've also tested it with the current versions. Seems fine on my end. Feel free to raise another issue, if it does not work. And of course I would be glad, if you could confirm, that /this/ issue is solved for you! :cat2:

Moulick commented 1 year ago

Thank you for taking this into consideration. But ermm, https://github.com/oniboni/mkdocs-inline-svg-plugin/commit/19ebfc696c2af921ad63618948b280d58d17eeda#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R25 is still pinning it to <= 1.4.2

image

I think something like this below makes sense. Pinning it to just the major versions. Requests and beautifulsoup are so well established that I don't think there will ever be a breaking change within a minor version. Mkdocs definitely does breaking within minor versions but probably best left up to the end-user to pin in their own dependencies

dependencies = [
  "mkdocs",
  "requests == 2.*",
  "beautifulsoup4 == 4.*",
]
oniboni commented 1 year ago

OMG, you are completely right! Wasn't that focused yesterday night... :face_with_spiral_eyes:

Just fixed it now. Sorry for the inconvenience!

Moulick commented 1 year ago

Hahaha happens to us all, thank you for the change

I get this error, not sure why

image
Moulick commented 1 year ago

Any idea @oniboni?

oniboni commented 12 months ago

Sorry for the late reply. I will try to reproduce this and find a solution.

Moulick commented 8 months ago

@oniboni did you ever get around to checking this please?

oniboni commented 8 months ago

Yes, I did. Sadly, I also had to fix stuff in the underlying mkdocs-kroki-plugin which seems to be abandoned.

I couldn't bring myself yet to forking this as an own package, but maybe will do..

Sorry for the inconvenience..

Moulick commented 8 months ago

Oh I see, Thank you for your work!

Moulick commented 7 months ago

Got merged πŸ˜‰