Skip to content

Add search bar #94

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

Merged
merged 1 commit into from
Feb 6, 2025
Merged

Add search bar #94

merged 1 commit into from
Feb 6, 2025

Conversation

kimmcintyre
Copy link
Contributor

Addresses issue #91

Turns on DocFX's search bar for the doc site. Here is an example of searching for DepthStencilState in my local doc site.

image

DocFX's search bar is powered by lunr.js and therefore is subject to the idiosyncrasies of this search engine as described in the lunr docs.

For example, lunr assumes each term in the search query is atomic. So searching for graph and graphic will yield different results.

image

Additionally, lunr assumes a logical OR when searching with multiple terms. Therefore, searching aspect ratio will return the combined results of the two separate search queries for aspect and ratio but not for the specific phrase aspect ratio. This can be partially mitigated by using the search query +aspect +ratio but this will only serve to return documents that have both of these words but not necessarily together in the phrase aspect ratio

So the search functionality that DocFX provides is not perfect, but I do believe that the additional functionality it has over the ToC filter makes it worth enabling.

@CartBlanche
Copy link
Collaborator

Hi Kim, thanks for the PR. I've asked @SimonDarksideJ to take a look.

Copy link
Collaborator

@CartBlanche CartBlanche left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@CartBlanche CartBlanche merged commit d256864 into MonoGame:main Feb 6, 2025
2 checks passed
@dellis1972
Copy link
Contributor

dellis1972 commented Feb 6, 2025

Thanks @kimmcintyre this is going to help so many people 🎉

@SimonDarksideJ
Copy link
Collaborator

A simple change, yet so powerful. It's a wonder why that feature is not advertised much.
Thanks @kimmcintyre

@kimmcintyre kimmcintyre deleted the search-bar branch February 8, 2025 13:18
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.

4 participants