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

Highlight text in search results #665

Closed
d0ugal opened this issue Jun 27, 2015 · 4 comments
Closed

Highlight text in search results #665

d0ugal opened this issue Jun 27, 2015 · 4 comments
Labels
Enhancement Plugins Theme-general Issues involving the theme related code within MkDocs
Milestone

Comments

@d0ugal
Copy link
Member

d0ugal commented Jun 27, 2015

This was suggested in #624 - we should highlight the search term in the results if we can.

@styfle
Copy link
Contributor

styfle commented Mar 1, 2016

This would be great feature to add and follow similar behavior of readthedocs.org that we expect 👍

@waylan waylan added this to the Post 1.0 milestone Dec 2, 2016
@waylan waylan added Theme-general Issues involving the theme related code within MkDocs Plugins labels Nov 1, 2017
@cassiourugit
Copy link

cassiourugit commented Mar 8, 2021

Any news on this?
Anyone know if there is a way of doing this today, with some plugin maybe?

@waylan
Copy link
Member

waylan commented Mar 8, 2021

Search uses lunr.js which apparently added the ability to support this feature as of version 2.3.8. However, it is not documented yet and enabling it allegedly increases the size of the index substantially. See olivernn/lunr.js#25 for details.

Presumably, the existing built-in plugin would need to be updated to enable the feature. However, I think it should not be enabled by default. A plugin setting would need to be created which would then enable the lunr.js feature. A PR would be welcome.

@pawamoy
Copy link
Sponsor Contributor

pawamoy commented Apr 15, 2024

Nowadays (2024) lunr.js is unmaintained (last commit 2020). While we welcome enhancements to existing themes, we're also discussing creating a new, better default theme, which would probably use something else than lunr.js. @squidfunk also stated that he and his team are working on a standalone search plugin that is theme-agnostic and will bring such functionality, see the discussion starting here #3560 (comment).

For these reasons, we'll close this as not planned! If someone wants to work on this anyway, we can re-open the issue.

@pawamoy pawamoy closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Plugins Theme-general Issues involving the theme related code within MkDocs
Projects
None yet
Development

No branches or pull requests

5 participants