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

Add Search Page and tweak Result Ordering #2474

Merged
merged 5 commits into from Dec 11, 2022
Merged

Add Search Page and tweak Result Ordering #2474

merged 5 commits into from Dec 11, 2022

Conversation

bluzukk
Copy link
Contributor

@bluzukk bluzukk commented Dec 7, 2022

Description

Fixes #2448

Result Ordering
This request tweaks the stork configuration such that the result order is optimized. This is done by using the title_boost option, which determines how much a result will be boosted if the search query matches the title.

Search Page
This pull request adds a search-page with more space for displaying the results, which can be accessed by pressing enter in the search-box.

Additional Stork Configuration File
This request adds an additional config file for stork such that the results displayed on the search-page and the results displayed in the search-box can be configured independently. This makes it possible to have a more verbose search result being displayed on the search-page.
The search-box now shows 3 (instead of 5) occurrences of the search query, while the search-page shows 7.
Please share your thoughts about how many occurrences should be displayed in the respective areas.

Navbar Update
I adjusted the Navbar CSS slightly to improve visibility of search-box results (see screenshots).
This prevents the "cut off" the search results and also prevents a "double scrollbar" within the search results.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • Added an entry in NEWS.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation

Screenshots

Result Ordering

The old version (left) and the new version (right).
Note that the search-box now adjusts its size depending on the view height.

Search Page

search-page

@bluzukk bluzukk marked this pull request as draft December 7, 2022 00:40
@bluzukk bluzukk marked this pull request as ready for review December 7, 2022 08:23
Copy link
Collaborator

@jkrumbiegel jkrumbiegel left a comment

Choose a reason for hiding this comment

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

Very cool, thanks for the PR! While trying it out locally it mostly seemed to work well, the title boosting is nice and the search page as well. The amount of text in search box and search page seems reasonable to me. The jumping to the closest id in the document doesn't seem to be that exact, but that's probably a browser / css / html issue that doesn't need to be solved here.

One issue I noticed, though, is that searching on a page in a subdirectory appends the path of that page to the search result, leading to a 404. The live page doesn't do that so something must have changed in that regard.

docs/makedocs.jl Outdated Show resolved Hide resolved
@bluzukk
Copy link
Contributor Author

bluzukk commented Dec 9, 2022

Thanks for your reply and the review!

One issue I noticed, though, is that searching on a page in a subdirectory appends the path of that page to the search result, leading to a 404. The live page doesn't do that so something must have changed in that regard.

Yes, this issue also occurs if I try it out locally.
However, if I build the docs using the Makie master branch this happens too!
I assume that the problem is resolved if the docs are deployed to the live page.

I did dig a little deeper into this:
The problem is the "url_prefix" which gets added to config_filled.toml :

    toml["input"]["url_prefix"] = isempty(subf) ? "" : "/" * subf * "/" # then url without / prefix

since subf is always empty when deploying locally the "url_prefix" is empty but it should be "/" to make all linking from subdirectories work. The following solves this problem :) (Tested it on Makie:Master and this Version)

    toml["input"]["url_prefix"] = isempty(subf) ? "/" : "/" * subf * "/" # then url without / prefix

I fixed it in 5e696b3

@jkrumbiegel jkrumbiegel merged commit 5f78379 into MakieOrg:master Dec 11, 2022
@KronosTheLate
Copy link
Contributor

Awesome, thanks for this ^_^

@jkrumbiegel jkrumbiegel mentioned this pull request Dec 27, 2022
t-bltg pushed a commit to t-bltg/Makie.jl that referenced this pull request Dec 31, 2022
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.

Improve search result ordering, make results more concise.
4 participants