Skip to content

Commit

Permalink
Merge branch 'master' into lh/search-optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithHafner authored Jan 22, 2024
2 parents 0f5c95d + aac2ea9 commit 901fdba
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- uses: actions/cache@v3
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- uses: actions/cache@v3
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Changed

* The search in the HTML output now prioritizes prefix matches. ([#2203], [#2375])

### Fixed

* Fix search filter toggle button styling in the HTML output. ([#2406], [#2408])

## Version [v1.2.1] - 2023-12-02

### Fixed
Expand Down Expand Up @@ -1721,6 +1731,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#2191]: https://github.com/JuliaDocs/Documenter.jl/issues/2191
[#2194]: https://github.com/JuliaDocs/Documenter.jl/issues/2194
[#2202]: https://github.com/JuliaDocs/Documenter.jl/issues/2202
[#2203]: https://github.com/JuliaDocs/Documenter.jl/issues/2203
[#2205]: https://github.com/JuliaDocs/Documenter.jl/issues/2205
[#2211]: https://github.com/JuliaDocs/Documenter.jl/issues/2211
[#2213]: https://github.com/JuliaDocs/Documenter.jl/issues/2213
Expand Down Expand Up @@ -1765,6 +1776,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#2348]: https://github.com/JuliaDocs/Documenter.jl/issues/2348
[#2364]: https://github.com/JuliaDocs/Documenter.jl/issues/2364
[#2365]: https://github.com/JuliaDocs/Documenter.jl/issues/2365
<<<<<<< HEAD
[#2406]: https://github.com/JuliaDocs/Documenter.jl/issues/2406
[#2408]: https://github.com/JuliaDocs/Documenter.jl/issues/2408
=======
[#2375]: https://github.com/JuliaDocs/Documenter.jl/issues/2375
>>>>>>> origin/master
[JuliaLang/julia#36953]: https://github.com/JuliaLang/julia/issues/36953
[JuliaLang/julia#38054]: https://github.com/JuliaLang/julia/issues/38054
[JuliaLang/julia#39841]: https://github.com/JuliaLang/julia/issues/39841
Expand Down
7 changes: 4 additions & 3 deletions assets/html/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function worker_function(documenterSearchIndex, documenterBaseURL, filters) {
tokenize: (string) => string.split(/[\s\-\.]+/),
// options which will be applied during the search
searchOptions: {
prefix: true,
boost: { title: 100 },
fuzzy: 2,
},
Expand All @@ -134,7 +135,7 @@ function worker_function(documenterSearchIndex, documenterBaseURL, filters) {
display_link += ` (${result.page})`;
}

let textindex = new RegExp(`\\b${querystring}\\b`, "i").exec(result.text);
let textindex = new RegExp(`${querystring}`, "i").exec(result.text);
let text =
textindex !== null
? result.text.slice(
Expand All @@ -149,8 +150,8 @@ function worker_function(documenterSearchIndex, documenterBaseURL, filters) {
let display_result = text.length
? "..." +
text.replace(
new RegExp(`\\b${querystring}\\b`, "i"), // For first occurrence
'<span class="search-result-highlight p-1">$&</span>'
new RegExp(`${querystring}`, "i"), // For first occurrence
'<span class="search-result-highlight py-1">$&</span>'
) +
"..."
: ""; // highlights the match
Expand Down
27 changes: 8 additions & 19 deletions assets/html/scss/documenter-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -132,52 +132,41 @@ html.theme--#{$themename} {
border-radius: 0.7em;
transition: all 300ms;
}

.search-result-link:hover, .search-result-link:focus {
background-color: rgba(0, 128, 128, 0.1);
}

.search-result-link .property-search-result-badge {
transition: all 300ms;
}

.search-result-link:hover .property-search-result-badge, .search-result-link:focus .property-search-result-badge {
color: #333 !important;
background-color: #f1f5f9 !important;
}

.property-search-result-badge {
padding: 0.15em 0.5em;
font-size: 0.8em;
font-style: italic;
text-transform: none !important;
line-height: 1.5;
color: whitesmoke;
background-color: #33415580;
border-radius: 0.6rem;
}


.search-result-title {
color: whitesmoke;
}

.search-result-highlight {
background-color: greenyellow;
color: black;
}

.search-divider {
border-bottom: 1px solid #5e6d6f50
}

.w-100 {
width: 100%;
}

.gap-2 {
gap: 0.5rem;
}

.gap-4 {
gap: 1rem;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/html/themes/documenter-dark.css

Large diffs are not rendered by default.

0 comments on commit 901fdba

Please sign in to comment.