-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustdoc: move some search code into search.js #84150
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
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
276ee6f
Move search JS into search-index.js
jsha 95d652e
Consolidate search-related vars and functions.
jsha 11f854d
Further consolidate search-related vars and funcs
jsha 5278949
Split search.js from search-index.js.
jsha d44c6ed
Updated tester.js for separate search.js
jsha a245642
Change root_path to static_root_path
jsha 6f1f3eb
Update comment on search.js static file.
jsha 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
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.
Please don't make this change!
search-index.js
is only supposed to contain the search "content", nothing else. Create a new JS file or insert the content intomain.js
but don't change how we handlesearch-index.js
.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.
Ok! Happy to split this out into
search.js
. Why issearch-index.js
supposed to only contain the search content and nothing else?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.
Multiple reason: this is a file different for every crate, meaning that docs.rs cannot store it once and for all. Also it's faster to parse a smaller file (even if here, the part you add might not be that big compared to the search index itself).
So here, it's mostly for docs.rs reason.
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.
And for docs.rs it would be nice to convert it to
.json
at some point 😁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.
Not possible as is unfortunately, you can load json files for local docs. :3