-
-
Notifications
You must be signed in to change notification settings - Fork 17
Adds enhanced search #287
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
Open
slowe
wants to merge
20
commits into
sunpy:main
Choose a base branch
from
slowe:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Adds enhanced search #287
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0e4f98a
Add enhanced search
slowe ca20a4f
Include search js in sphinx build
Cadair 2cf5674
Use /_/ proxy on RTD
Cadair ad1d0d4
Use /_/ proxy on RTD
Cadair eee8538
Second attempt at using _ RTD api
Cadair fbae5cd
Fix bug with keyboard navigation on project tabs
slowe 7379115
Add some default classes
slowe 8c4d6f1
Tidy up code
slowe 55c4ce8
Change button style
slowe 3882c00
Add filter icon
slowe 54887fd
Merge branch 'main' into main
Cadair 015ad25
Add Python side config
Cadair 6d72876
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9c3452f
Extract search CSS and re-org some files
Cadair 33d2bd6
Fix some search css
Cadair 163fb45
Add an editorconfig file because indentation
Cadair 94a7832
More dark theme fixes
Cadair 676ec99
Merge remote-tracking branch 'slowe/main' into better-search
Cadair cde6c9e
Keep the linter happy
Cadair f5eed7f
Merge branch 'main' into main
nabobalis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
168 changes: 168 additions & 0 deletions
168
src/sunpy_sphinx_theme/theme/sunpy/static/css/rtd_enhanced_search.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
#pst-search-dialog[open] { | ||
left: revert; | ||
top: 2rem; | ||
margin-top: 0; | ||
transform: revert; | ||
max-height: calc(100vh - 4rem); | ||
} | ||
|
||
#pst-search-dialog[open] form.bd-search { | ||
flex-grow: 0; | ||
} | ||
|
||
.readthedocs-search { | ||
background: var(--pst-color-background); | ||
border-radius: 0.25rem; | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
overflow: hidden; | ||
} | ||
|
||
.readthedocs-search form { | ||
margin: 0.5rem; | ||
border: 0; | ||
} | ||
|
||
.readthedocs-search form:focus-within { | ||
outline: 2px solid var(--pst-color-accent); | ||
border: 0; | ||
} | ||
|
||
/* .readthedocs-search form.loading input { */ | ||
/* } */ | ||
|
||
.readthedocs-search form.loading .fa-magnifying-glass { | ||
background-image: url("data:image/svg+xml,<svg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_6kVp%7Btransform-origin:center;animation:spinner_irSm .75s infinite linear%7D@keyframes spinner_irSm%7B100%25%7Btransform:rotate(360deg)%7D%7D%3C/style%3E%3Cpath d='M10.72,19.9a8,8,0,0,1-6.5-9.79A7.77,7.77,0,0,1,10.4,4.16a8,8,0,0,1,9.49,6.52A1.54,1.54,0,0,0,21.38,12h.13a1.37,1.37,0,0,0,1.38-1.54,11,11,0,1,0-12.7,12.39A1.54,1.54,0,0,0,12,21.34h0A1.47,1.47,0,0,0,10.72,19.9Z' class='spinner_6kVp'/%3E%3C/svg>"); | ||
background-position: left center; | ||
background-repeat: no-repeat; | ||
background-size: contain; | ||
} | ||
|
||
html[data-theme="dark"] .readthedocs-search form.loading .fa-magnifying-glass { | ||
background-image: url("data:image/svg+xml,<svg fill='white' width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_6kVp%7Btransform-origin:center;animation:spinner_irSm .75s infinite linear%7D@keyframes spinner_irSm%7B100%25%7Btransform:rotate(360deg)%7D%7D%3C/style%3E%3Cpath d='M10.72,19.9a8,8,0,0,1-6.5-9.79A7.77,7.77,0,0,1,10.4,4.16a8,8,0,0,1,9.49,6.52A1.54,1.54,0,0,0,21.38,12h.13a1.37,1.37,0,0,0,1.38-1.54,11,11,0,1,0-12.7,12.39A1.54,1.54,0,0,0,12,21.34h0A1.47,1.47,0,0,0,10.72,19.9Z' class='spinner_6kVp'/%3E%3C/svg>"); | ||
} | ||
|
||
.readthedocs-search form.loading .fa-magnifying-glass path { | ||
display: none; | ||
} | ||
|
||
.readthedocs-search .content { | ||
max-height: calc(100% - 110px); | ||
overflow-y: auto; | ||
} | ||
|
||
.readthedocs-search .tablist { | ||
position: sticky; | ||
display: flex; | ||
overflow-x: auto; | ||
top: 0; | ||
outline: 0; | ||
background: var(--pst-color-background); | ||
} | ||
|
||
.readthedocs-search .tablist button { | ||
display: flex; | ||
border: 0; | ||
border-bottom: max(3px, 0.1875rem, 0.12em) solid transparent; | ||
color: var(--pst-color-text-base); | ||
background-color: var(--pst-color-surface); | ||
padding: 0.5rem 1rem; | ||
align-items: center; | ||
white-space: nowrap; | ||
} | ||
|
||
.readthedocs-search .tablist button:focus { | ||
color: var(--sst-lightest-color); | ||
background-color: var(--sst-dark-color); | ||
} | ||
|
||
.readthedocs-search .tablist button:focus, | ||
.readthedocs-search .tablist button[aria-selected="true"] { | ||
outline: 0; | ||
border-bottom: max(3px, 0.1875rem, 0.12em) solid var(--pst-color-secondary); | ||
} | ||
|
||
.readthedocs-search .tablist button svg { | ||
padding-right: 0.25rem; | ||
} | ||
|
||
.readthedocs-search .tablist button .n { | ||
padding-left: 0.25rem; | ||
} | ||
|
||
.readthedocs-search .results .results-message > * { | ||
margin: 1rem; | ||
} | ||
|
||
.readthedocs-search .results ul { | ||
list-style: none; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
.readthedocs-search .results ul li { | ||
margin: 0; | ||
padding: 1rem; | ||
} | ||
|
||
.readthedocs-search .results ul li:focus { | ||
background: var(--pst-color-attention-bg); | ||
outline: 0; | ||
} | ||
|
||
.readthedocs-search .results ul li:first-child { | ||
border: 0; | ||
} | ||
|
||
/* .readthedocs-search .results ul li > *:last-child { */ | ||
/* } */ | ||
|
||
.readthedocs-search .results ul li a:hover, | ||
.readthedocs-search .results ul li a:focus, | ||
.readthedocs-search .results ul li.selected a { | ||
color: var(--pst-color-text-base); | ||
background-color: var(--sst-footer-background-color); | ||
} | ||
|
||
.readthedocs-search .footer { | ||
padding: 10px; | ||
border-top: 1px solid #e1e4e5; | ||
display: flex; | ||
gap: 1em; | ||
justify-content: space-between; | ||
align-items: center; | ||
font-size: 12px; | ||
color: var(--pst-color-text-base); | ||
background-color: var(--sst-footer-background-color); | ||
} | ||
|
||
.readthedocs-search .help { | ||
display: flex; | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
gap: 20px; | ||
} | ||
|
||
.readthedocs-search .credits { | ||
display: flex; | ||
align-items: center; | ||
gap: 5px; | ||
margin-left: auto; | ||
text-align: right; | ||
} | ||
.readthedocs-search .credits a { | ||
color: inherit; | ||
} | ||
|
||
.readthedocs-search .credits svg { | ||
height: 20px; | ||
} | ||
|
||
@media only screen and (max-width: 70rem) { | ||
.readthedocs-search .footer, | ||
.readthedocs-search .help { | ||
display: block; | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable
projects
is used but only defined inside the conditional block whensearch_projects
is None. Ifsearch_projects
is not None,projects
will be undefined, causing a NameError when used in the JSON serialization on line 194.Copilot uses AI. Check for mistakes.