-
Notifications
You must be signed in to change notification settings - Fork 339
Highlight correct TOC entry on page load #2185
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
base: main
Are you sure you want to change the base?
Highlight correct TOC entry on page load #2185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review
@@ -1127,7 +1161,7 @@ function setupArticleTocSyncing() { | |||
} | |||
|
|||
observer = new IntersectionObserver(callback, options); | |||
headingsToTocLinks.keys().forEach((heading) => { | |||
Array.from(headingsToTocLinks.keys()).forEach((heading) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was actually causing a runtime error in Safari for me. Only the latest versions of Safari support forEach on the map iterator.
Not exactly sure why tests are failing |
Fails for me locally too, but also fails locally on |
The tests are failing on CI for the A patch will be needed for this as the tests will keep failing in |
xref to sphinx-doc/sphinx#13462 The problem with linkcheck appears to be an upstream bug |
Labeled this PR as |
Compare
Preview URL - Kitchen Sink - Admonitions - with #topic in the hash portion of the URL:
https://pydata-sphinx-theme--2185.org.readthedocs.build/en/2185/examples/kitchen-sink/admonitions.html#topic
The entry for
topic
in the right sidebar table of contents is highlighted, as shown in the following screenshot:This pull request fixes the following bug, which is currently in the dev version of the theme / latest version of the docs.
Production URL - same page - #topic in hash:
https://pydata-sphinx-theme.readthedocs.io/en/latest/examples/kitchen-sink/admonitions.html#topic
The TOC entry for
admonition
(just belowtopic
) is incorrectly highlighted, as shown in the following screenshot:Caution