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

Fix search.highlight feature when loading from file:// URL #180

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

jbms
Copy link
Owner

@jbms jbms commented Oct 30, 2022

No description provided.

@jbms jbms force-pushed the fix-search-highlight branch from 97a965e to fd63068 Compare October 30, 2022 05:30
@jbms jbms requested a review from 2bndy5 October 30, 2022 05:31
@jbms
Copy link
Owner Author

jbms commented Oct 30, 2022

I don't believe there is any easy way to hide the search highlighting, though, after navigating to a search result. Consequently, I didn't enable it by default for our docs.

@2bndy5
Copy link
Collaborator

2bndy5 commented Oct 30, 2022

I don't believe there is any easy way to hide the search highlighting, though, after navigating to a search result. Consequently, I didn't enable it by default for our docs.

This would actually matches my experience in other Sphinx themes. Typically I click the section permalink to disable search highlighting if it is too annoying (sadly this doesn't always work).

I was excited to see the feature could be disabled at build time for this theme though. However, since the selected text follows the light/dark scheme CSS, it's not a bad idea to enable the feature for our docs. For other light-only schemed themes, I tend to use the "dark reader" browser extension, which looks rather ugly when highlighting search results.

@jbms
Copy link
Owner Author

jbms commented Oct 30, 2022

Not exactly related, but for the features that are solely implemented in JavaScript and therefore don't require a rebuild to enable, it could be neat to allow them to be interactively toggled in our docs in order to allow users to experiment with them.

@2bndy5
Copy link
Collaborator

2bndy5 commented Oct 30, 2022

I think some features are excluded from the HTML in the templates if not specifically enabled. We could easily use the task-list directive (+ custom JS in our docs) to implement the toggling.

@2bndy5
Copy link
Collaborator

2bndy5 commented Oct 30, 2022

Incidentally, I was contemplating something similar to the admonition icons because there are sample snippets that provide a complete suggestion for Octicons and FontAwesome.

Copy link
Collaborator

@2bndy5 2bndy5 left a comment

Choose a reason for hiding this comment

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

I can confirm this resolves it, thanks. It only seems to highlight exact matches though.

@jbms jbms merged commit 000192d into main Nov 1, 2022
@2bndy5 2bndy5 deleted the fix-search-highlight branch November 10, 2022 03:48
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