diff --git a/ChangeLog.md b/ChangeLog.md index ad8aa19..0a73065 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,9 @@ # Change Log +## [0.1.3] - 2024-11-21 + +- Fix: Image node URI must be relative to path given in the document instead of path calculated by ``get_image_paths``. + ## [0.1.2] - 2024-11-15 - Fix: Add sphinx_colorschemed_images/static directory to Python distribution. diff --git a/dist/js/sphinx-colorschemed-images.esm.js b/dist/js/sphinx-colorschemed-images.esm.js index 9ae2365..8123e5f 100644 --- a/dist/js/sphinx-colorschemed-images.esm.js +++ b/dist/js/sphinx-colorschemed-images.esm.js @@ -1,5 +1,5 @@ /*! - * sphinx-colorschemed-images v0.1.2 (https://github.com/danirus/sphinx-colorschemed-images). + * sphinx-colorschemed-images v0.1.3 (https://github.com/danirus/sphinx-colorschemed-images). * Copyright 2024 Daniela Rus Morales. * Licensed under MIT (https://github.com/danirus/sphinx-colorschemed-images/blob/main/LICENSE). */ diff --git a/dist/js/sphinx-colorschemed-images.js b/dist/js/sphinx-colorschemed-images.js index c6b3728..5537790 100644 --- a/dist/js/sphinx-colorschemed-images.js +++ b/dist/js/sphinx-colorschemed-images.js @@ -1,5 +1,5 @@ /*! - * sphinx-colorschemed-images v0.1.2 (https://github.com/danirus/sphinx-colorschemed-images). + * sphinx-colorschemed-images v0.1.3 (https://github.com/danirus/sphinx-colorschemed-images). * Copyright 2024 Daniela Rus Morales. * Licensed under MIT (https://github.com/danirus/sphinx-colorschemed-images/blob/main/LICENSE). */ diff --git a/docs/conf.py b/docs/conf.py index 3d39468..2b27a7a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,7 +3,7 @@ # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html -from importlib.metadata import version as _version +import sphinx_colorschemed_images # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information @@ -11,7 +11,13 @@ project = 'sphinx-colorschemed-images' copyright = '2024, Daniela Rus Morales' author = 'Daniela Rus Morales' -release = _version("sphinx-colorschemed-images") + +release_pattern_url = ( + "https://sphinx-colorschemed-images.readthedocs.io/en/{release}/" +) + +release = sphinx_colorschemed_images.__version__ +releases = [release,] # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -38,8 +44,8 @@ html_theme = "sphinx_nefertiti" html_theme = 'sphinx_nefertiti' -html_static_path = ['_static'] -html_favicon = "_static/diamond-half.svg" +html_static_path = ['static'] +html_favicon = "static/diamond-half.svg" html_theme_options = { "documentation_font": "Open Sans", @@ -60,6 +66,10 @@ "repository_name": "sphinx-colorschemed-images", "current_version": f"v{release}", + "versions": [ + ("v%s" % item, release_pattern_url.format(release=item)) + for item in releases + ], "footer_links": [ { diff --git a/docs/_static/diamond-half.svg b/docs/static/diamond-half.svg similarity index 100% rename from docs/_static/diamond-half.svg rename to docs/static/diamond-half.svg diff --git a/package.json b/package.json index 2b3b272..c789d4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sphinx-colorschemed-images", - "version": "0.1.2", + "version": "0.1.3", "description": "Include color-scheme aware images in Sphinx projects.", "repository": { "type": "git", diff --git a/sphinx_colorschemed_images/__init__.py b/sphinx_colorschemed_images/__init__.py index 69a1fa5..7bb02b0 100644 --- a/sphinx_colorschemed_images/__init__.py +++ b/sphinx_colorschemed_images/__init__.py @@ -2,7 +2,7 @@ from .extension import copy_colorschemed_images, extension_builder_inited -__version__ = "0.1.2" +__version__ = "0.1.3" def setup(app) -> dict: diff --git a/sphinx_colorschemed_images/extension.py b/sphinx_colorschemed_images/extension.py index 406dc7f..f32d037 100644 --- a/sphinx_colorschemed_images/extension.py +++ b/sphinx_colorschemed_images/extension.py @@ -32,7 +32,9 @@ def replace_image_node(self, node, image_paths): for color_scheme, img_path in image_paths.items(): options[f"data-alt-src-color-scheme-{color_scheme}"] = img_path - options["uri"] = image_paths.get(default_color_scheme) + parent = Path(options["uri"]).parent + filename = Path(image_paths.get(default_color_scheme)).name + options["uri"] = str(parent / filename) return colorschemed_image(node.rawsource, **options)