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

Include sphinxcontrib.jquery in the project dependencies & fix other JavaScript issues (Cherry-pick of #277) #278

Merged
merged 1 commit into from
Apr 21, 2023

Conversation

Eric-Arellano
Copy link
Collaborator

@Eric-Arellano Eric-Arellano commented Apr 21, 2023

Sphinx 6 stopped including jQuery by default, but we're still using it in some places. As a result, the docs' functionality is broken in some places like the language selection not being clickable: #272

I wanted to remove jQuery via
#275, but it is too hard to safely due with Pytorch because we have 105 usages. We will need to wait for the switch to Furo.

So, for now, we will include jQuery by default. We also try to activate the extension by default with the line
app.setup_extension("sphinxcontrib.jquery"), but I'm having issues with that actually working. So, projects may need to still add "sphinxcontrib.jquery" explicitly in their extensions in conf.py - but they at least won't have to explicitly include sphinxcontrib-jquery in their requirements.

--

This PR also fixes other issues with our JavaScript, as reported by the developer console:

  1. languages.html was not recognizing jQuery. So, rewrite it to modern JavaScript
  2. pytorchAnchors.bind(); was not defined so caused some of our setup to fail
  3. handleLeftMenu: function was failing because document.getElementById("docs-tutorials-resources") does not exist. Since that function failed, it looks like it wasn't actually necessary anymore.

…r JavaScript issues (Qiskit#277)

Sphinx 6 stopped including jQuery by default, but we're still using it
in some places. As a result, the docs' functionality is broken in some
places like the language selection not being clickable:
Qiskit#272

I wanted to remove jQuery via
Qiskit#275, but it is too
hard to safely due with Pytorch because we have 105 usages. We will need
to wait for the switch to Furo.

So, for now, we will include jQuery by default. We also try to activate
the extension by default with the line
`app.setup_extension("sphinxcontrib.jquery"),` but I'm having issues
with that actually working. So, projects may need to still add
`"sphinxcontrib.jquery"` explicitly in their extensions in `conf.py` -
but they at least won't have to explicitly include
`sphinxcontrib-jquery` in their requirements.

--

This PR also fixes other issues with our JavaScript, as reported by the
developer console:

1. `languages.html` was not recognizing jQuery. So, rewrite it to modern
JavaScript
2. `pytorchAnchors.bind();` was not defined so caused some of our setup
to fail
3. `handleLeftMenu:` function was failing because
`document.getElementById("docs-tutorials-resources")` does not exist.
Since that function failed, it looks like it wasn't actually necessary
anymore.
Copy link
Collaborator

@javabster javabster left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 thanks for jumping on this so quickly!

@Eric-Arellano Eric-Arellano merged commit a5ffad4 into Qiskit:1.11 Apr 21, 2023
@Eric-Arellano Eric-Arellano deleted the 1.11 branch April 21, 2023 17:12
@Eric-Arellano Eric-Arellano mentioned this pull request Apr 21, 2023
Eric-Arellano added a commit that referenced this pull request Apr 21, 2023
Major change is #278.
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.

None yet

2 participants