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
Thebe assets added to html head but not added to _static #163
Comments
This is timely, given the comment I just made in executablebooks/meta#119 (comment). You should probably use the mathjax approach to only add JS (but CSS in this case) given an env value you set when you copy the CSS: https://github.com/sphinx-doc/sphinx/blob/a16cca27ef1415ff271084f156e0fb33ccfbefae/sphinx/ext/mathjax.py#L84 |
Tricky: injecting css during build prevents users from overriding it since it is then inserted after the user-provided css. This change is due to fixing #149 |
The original issue report was about jupyter-sphinx.css, which could still be kept in the app setup. Of course the same issue applies to thebelab.css, but that is maybe less common to want to override? |
This comment sphinx-doc/sphinx#6241 (comment) contains an implementation of conditional js/css inclusion, however I believe the proper way to address this issue is to switch to sphinx-thebe #137 Still, we may want to use the same logic for widgets code. |
Using jupyter-sphinx pydata-sphinx-theme docs (https://pydata-sphinx-theme.readthedocs.io/en/latest/), I noticed that it gives errors in the browser console related to thebe css/js:
This seems to be caused because it is added to the html output of sphinx. From the source of the html of the url linked above:
But this
thebelab.css
is not actually to the_static
dir of the build html. And thus giving a 404 error.Based on a quick look, I think this is because here the thebelab css is only copied if there is a configuration active:
jupyter-sphinx/jupyter_sphinx/__init__.py
Lines 122 to 132 in 43280f8
but it gets always registered to sphinx regardless of that configuration option:
jupyter-sphinx/jupyter_sphinx/__init__.py
Lines 284 to 287 in 43280f8
The text was updated successfully, but these errors were encountered: