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

Attempt to fix missing jquery in RTD #7799

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

FoamyGuy
Copy link
Collaborator

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:
image

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:
image

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.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try this. We can always back it out if it breaks.

@dhalbert dhalbert merged commit 7e91f07 into adafruit:main Mar 28, 2023
@dhalbert
Copy link
Collaborator

This fix worked! The version button now works again, and so does the dynamic search in the Support Matrix. Thanks @FoamyGuy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants