-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Apidoc better search #10720
Apidoc better search #10720
Conversation
The `:target` selector is supported by all browsers.
On error search escape special characters, with only '.' matching any characters.
This way we can do the search case-sensitive after only converting the search term to lowercase.
Firefox remembers input on the same page if a normal reload is performed. In this case the results for the search term should be shown automatically.
Currently the search term is matched against the longname of members. Because of this most members are matched when searching for a class / module and also searching for 'mod' matches everything as all longnames start with 'module:'
Now also includes the class name if it is different than its module name. `ol/source/Vector` -> `ol/source/Vector~VectorSource`.
++++ Full match from start to end +++ Full match between word boundaries ++ Begin matches at word boundary, multiple matches are better + Matches somewhere Classes with (multiple) members matching at the beginning are weighted higher.
... to improve search speed. Instead of marking all items as hidden, and then marking the matched ones again, this keeps track of all matched items and only removes those that no longer match and adds those that previously did not match.
a6b0866
to
b571148
Compare
b571148
to
c2505f9
Compare
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.
Thanks for your work on this @MoonE. I like everything except for
The prettyname includes the class name if it is different from the module name ol/source/Vector~VectorSource instead of only ol/source/Vector
This is because the class name is irrelevant - the classes are the default export.
Worked fine before, but better safe than sorry.
This was part of the reason why I changed it. I now changed it to only keep the class name for non-default exports. So |
No need to sort beforehand and therefore sorting can be done at last too. Also forEach is just fine, no need for underscore. This changes the navigation default order for modules to be after classes when the name is the same.
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.
Thanks @MoonE for this great improvement!
Searching feels rather slow, and the result relevance is not always great.
I set out to fix this.
There were also a few bugs, that are fixed with this:
ol/interaction/DragBox~DragBoxEvent
is also listed asol/interaction/DragBox
Besides making searching faster and showing more relevant results I also did some small improvements (imho):
ol/source/Vector~VectorSource
instead of onlyol/source/Vector
Results are more relevant when
additionally there is a small preference to
The speed improvements are achieved by
Feel free to try it and leave a comment.