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

FIX JupyterLite button links #1115

Merged
merged 2 commits into from Mar 28, 2023

Conversation

lesteve
Copy link
Member

@lesteve lesteve commented Mar 28, 2023

Turns out #1105 was not the right fix, we need to use a relative URL. For example if I copy _build/html to a repo like https://github.com/lesteve/sphinx-gallery-jupyterlite, an example html page is
https://lesteve.github.io/sphinx-gallery-jupyterlite/auto_examples/no_output/plot_raise.html
and I want the link to go to
https://lesteve.github.io/sphinx-gallery-jupyterlite/lite so ../../lite. /lite as done in #1105 goes to https://lesteve.github.io/lite which is incorrect. If the example is one folder above you want ../lite instead. This is why I use os.path.relpath to get the root URL.

I have added more tests as well with a nested gallery folder (aka sub-gallery I think).

@lesteve
Copy link
Member Author

lesteve commented Mar 28, 2023

To make it easier to double-check I have generated the doc locally and made it available on
https://lesteve.github.io/sphinx-gallery-jupyterlite

You can see that the JupyterLite button works both for:

@larsoner larsoner merged commit 095ee88 into sphinx-gallery:master Mar 28, 2023
15 checks passed
@larsoner larsoner added the bug label Mar 28, 2023
@larsoner
Copy link
Contributor

Thanks @lesteve !

clrpackages pushed a commit to clearlinux-pkgs/pypi-sphinx_gallery that referenced this pull request Apr 18, 2023
… to version 0.13.0

v0.13.0
-------

**Implemented enhancements:**

-  ENH: Create backreferences for default roles `#1122 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1122>`__ (`StefRe <https://github.com/StefRe>`__)
-  ENH raise error in check_jupyterlite_conf with unknown key `#1119 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1119>`__ (`lesteve <https://github.com/lesteve>`__)
-  ENH Add functionality to modify Jupyterlite notebooks based on their content `#1113 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1113>`__ (`lesteve <https://github.com/lesteve>`__)
-  ENH: Add support for WebP `#1111 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1111>`__ (`StefRe <https://github.com/StefRe>`__)

**Fixed bugs:**

-  ENH Clean-up code by early initialization of sphinx_gallery_conf `#1120 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1120>`__ (`lesteve <https://github.com/lesteve>`__)
-  FIX JupyterLite button links `#1115 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1115>`__ (`lesteve <https://github.com/lesteve>`__)
-  Fix thumbnail text formatting `#1108 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1108>`__ (`StefRe <https://github.com/StefRe>`__)

(NEWS truncated at 15 lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants