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

Provide a simple way to hide the highlighting of search results #81

Closed
dbitouze opened this issue Feb 9, 2021 · 4 comments
Closed

Provide a simple way to hide the highlighting of search results #81

dbitouze opened this issue Feb 9, 2021 · 4 comments
Labels
enhancement New feature or request needs discussion The approach to resolve this isn't immediately clear, and needs discussion

Comments

@dbitouze
Copy link
Contributor

dbitouze commented Feb 9, 2021

Is your feature request related to a problem? Please describe.
I'm always frustrated when, after a search, the text is cluttered by the highlighting of search results (this is notably the case when what I'm looking for is a given document that I search with some words of its title).

Describe the solution you'd like
I'd like Furo to provide a simple way to hide the highlighting of search results as it is the case in the Sphinx-docdocumentation (see for instance at the bottom right of this page).

Describe alternatives you've considered
Some themes support this feature, for instance the Insipid Sphinx Theme as one can see at the top of this page (click on "Hide Search Matches").

@dbitouze dbitouze added the enhancement New feature or request label Feb 9, 2021
@pradyunsg
Copy link
Owner

Ah interesting! It looks like a simple:

<a href="javascript:Documentation.hideSearchWords()">Hide Search Matches</a>

The big question is, where should this go on the page layout. :)

@pradyunsg pradyunsg added the needs discussion The approach to resolve this isn't immediately clear, and needs discussion label Feb 9, 2021
@dbitouze
Copy link
Contributor Author

The big question is, where should this go on the page layout. :)

I like it at the top of the page (as with the Insipid Sphinx Theme) since you may want to look for a given document (searched with some words of its title) and not individual words. In such cases, you want to hide the searched words as soon as you reach the expected page.

Moreover, when it isn't at the top of the page, as it is the case in the Sphinx-doc documentation, the link that hides the searched words may be visible only if you scroll down, as in this page.

@pradyunsg
Copy link
Owner

Done in dfe43e8. Will cut a release next weekend.

@pradyunsg
Copy link
Owner

You can try it out here: https://pradyunsg.me/furo/reference/tables/?highlight=table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs discussion The approach to resolve this isn't immediately clear, and needs discussion
Projects
None yet
Development

No branches or pull requests

2 participants