sphinx-contrib / images

sphinxcontrib-images extension
Apache License 2.0
17 stars 14 forks source link

Support for Sphinx 4 #24

Closed fish-train closed 1 year ago

fish-train commented 3 years ago

I upgraded Sphinx. Now i had version 4.

There is mistake, when i make html:

Extension error (sphinxcontrib.images): Handler <function install_backend_static_files at 0x046DD1E0> for event 'env-updated' threw an exception (exception: 'Sphinx' object has no attribute 'add_stylesheet')

SilverRainZ commented 3 years ago

What version of sphinxcontrib.images are you using? I think the latest version works well under Sphinx4.

fish-train commented 3 years ago

@SilverRainZ could you help me please, how to see sphinxcontrib.images version?

SilverRainZ commented 3 years ago

@SilverRainZ could you help me please, how to see sphinxcontrib.images version?

pip show sphinxcontrib-images

fish-train commented 3 years ago

0.9.2

@SilverRainZ How i can upgrade extension?

SilverRainZ commented 3 years ago

I think it would be better to google it before asking here.

For this question: pip install --upgrade sphinxcontrib-images.

jonascj commented 3 years ago

Version 0.9.3 is correctly working with Sphinx 4 (tested with sphinx 4.0.2), but version 0.9.2 is not working with Sphinx4.

The reason being https://github.com/sphinx-contrib/images/pull/12 was not included in release 0.9.2.

I don't think we can change version 0.9.2 requirements now, but back then we could have required Sphinx versions 3.x or below, hence users of 0.9.2 and 0.9.1 would get an error if they upgraded Sphinx to 4.x or if they did pip install sphinxcontrib-images they would get a compatible version of Sphinx installed (not 4.x, but 2.x or 3.x).