Skip to content

Commit

Permalink
Prepare release 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
danirus committed Nov 15, 2024
1 parent fa77c32 commit a1f10fc
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 11 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [0.1.2] - 2024-11-15

- Fix: Add sphinx_colorschemed_images/static directory to Python distribution.

## [0.1.1] - 2024-11-15

- Enhancement: When switching images for directive `cs_figure`, change as well the `href` attribute of the anchor used inside the `<figure>` element that wraps the image.
Expand Down
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include README.md
include LICENSE

recursive-include sphinx_colorschemed_images/static/ *.*

recursive-exclude tests/ *.*
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ build-ext: clean ## Build Sphinx extension.
rm -f sphinx_colorschemed_images/static/*
npm run build-script
npm run build-module
mkdir sphinx_colorschemed_images/static/
mkdir -p sphinx_colorschemed_images/static/
cp dist/js/sphinx-colorschemed-images.js sphinx_colorschemed_images/static/
python -m build

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Build your Sphinx project and serve it. You should see either the image for the

When using the extension Sphinx adds a script to your HTML output, `sphinx-colorschemed-images.js`, that listens for changes on the user's preferred color-scheme and switches between the images accordingly. It works in all Sphinx themes regardless of whether they have support for light/dark color schemes.

If you have your own theme and it offers the user control over the color-scheme, you can use the NPM package [sphinx-colorschemed-images](https://www.npmjs.com/package/sphinx-colorschemed-images) and its class `SphinxColorschemeImageHandler` when building your own plugig.
If you have your own theme and it offers the user control over the color-scheme, you can use the NPM package [sphinx-colorschemed-images](https://www.npmjs.com/package/sphinx-colorschemed-images) and its class `SphinxColorschemeImageHandler` when building your own plugin.

The source code is rather small, so it is better to look into [it](https://raw.githubusercontent.com/danirus/sphinx-colorschemed-images/refs/heads/main/js/src/main.js) than to explain it here. If your theme already listens for changes in `prefers-color-scheme`, pass `{auto: false}` to the constructor, to avoid adding the listeners again. To switch between *light* and *dark* images, call the `activate` method with either `light` or `dark`.

Expand Down
3 changes: 2 additions & 1 deletion dist/js/sphinx-colorschemed-images.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/sphinx-colorschemed-images.esm.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dist/js/sphinx-colorschemed-images.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a1f10fc

Please sign in to comment.