Attempt to fix missing jquery in RTD #7799
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On the currently live docs page: https://docs.circuitpython.org/en/latest/README.html
The version dropdown in the lower left corner, and the search functionality do not seem to work.
Looking in the console for errors reveals some missing jQuery errors:
At some point some code inside of
readthedocs-doc-embed.js
seems to notice the lack of jquery and injects it into the DOM. This does seem successful because you can use$
and other jquery functions successfully from the console after everything has finished loading.However it seems "too late" for some of the functionality on the page. It appears that it tries to initialize and run some code involving jquery when the page first loads and since it's not there at this time it fails and then certain interactive controls on the page don't work.
I found some information that is potentially related to this here:
But honestly I'm having trouble following what the actual change is and whether it's expected to affect the way we use things, and if so what that effect would be (i.e. are the errors we are seeing expected behavior from this change?)
Interestingly when you load the docs page from a local
make html
it does not suffer from this problem. It appears to be successfully loading jquery. The resulting README.html contains this:Strangely this
<script>
tag is absent from the html page served at https://docs.circuitpython.org My best guess is RTD infrastructure is removing that somehow in the version being served live. Not really sure though, very strange.This PR is an attempt to resolve it by forcing it to use the sphinxcontrib.jquery package, which is noted in one of the above linked comments.
I don't really know if it's possible / how to test this locally since the local copy doesn't show the same errors, and doesn't have the version dropdown functionality at all.
I'm not certain if this solution will actually work for the live site, nor if it's the preferred one if so. But I'm open to ideas from anyone about how to get the live pages working again with their interactive controls.