-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Proof of Concept: Hide search matches #876
base: master
Are you sure you want to change the base?
Conversation
Any reason to continue with this PR with search highlighting back on RTD? |
Well yes. Highlighting is back (which is great!), but there is still no button or whatever to hide the current highlighting in the RTD theme, right? But this PR is just a proof of concept, feel free to create a nicer styling. |
I am not sure how up to date the current PR is, but I would be very interested in the highlighting being fixed indeed. In particular, @cpitclaudel mentioned on Zulip that it could be easily disabled by editing the following CSS:
|
I would like to support the pull request. |
I've just suggested such a change in sphinx-doc/sphinx#9551. |
I would also like to support this PR. The highlighting is extremely annoying for me. |
In the meantime, this has been implemented in Sphinx: sphinx-doc/sphinx#9337 |
Unfortunately, the highlighting of search results has been removed in readthedocs/readthedocs.org#6087.
I don't like this, and I think the real problem is that the RTD theme doesn't have a simple way to remove those highlights, like other Sphinx themes have, see #816.
This PR shows a really simple way to add this feature back to the theme.
Once we have this, we can revert the removal of the highlighting, see readthedocs/readthedocs.org#6305.
I'm not interested in the styling (can somebody else please do that?), I just want to demonstrate a very simple way to get this functionality.
The relevant CSS selectors would probably be
#searchbox .highlight-link
for the<p>
and#searchbox a
(or#searchbox p a
?) for the link itself.I think it makes sense to add the "Hide Search Matches" link close to the search text field, but if desired, it could be placed anywhere be simply adding a
<div id="searchbox"></div>
. That's all there's to it.Please note that this does not remove
?highlight=...
from the URL. Such a feature, if desired, should be implemented in Sphinx itself.What do y'all think about this?