-
Notifications
You must be signed in to change notification settings - Fork 350
Search autocomplete #985
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
Search autocomplete #985
Conversation
How are we sorting results? I think it'd be good if in this case Seems we're only autocompleting a module or a function/type/callback/etc, what do you think about something like above? |
Awesome job @archdragon! I have dropped two comments and I have one last question: should clicking on the "X" clean up the autocomplete/search field? That was my expectation but I am not sure if it is rooted in reality. |
Once you find the link please open a separate issue. :) I don't want to block this one on that since the behaviour you describe was also available before (but I guess it is somewhat worse here because we limit the results to only 5).
I also spotted this but I opened a separate issue (since the code behaves like this already today): #986. |
Thank you!
👍 This is how it's supposed to work - but looks like the input was sometimes triggering the animation/state change before the |
Demo link now includes the Now cleaning up and refactoring the "old search" code. |
Beautiful! ❤️ |
</span> | ||
</p> | ||
<p> | ||
<button class="line footer-button night-mode-toggle"> |
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 "toggle night mode" is not working for me on the latest demo (autocomplete_mod_fun).
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.
Fixed!
I've added the sort we discussed in #987 to the demo. Since I was refactoring some of the "old search" code it was more or less a one-liner. :) As we discussed, the results are now sorted based on |
This is glorious! Please let us know whenever it is ready to merge, as we are pretty much looking forward to it! :D |
Thank you! Just wanted to do some manual cross-browser testing in the morning - I'm now done with that. To sum up:
I've updated the demos and uploaded some examples for ex_unit, eex etc. From my side the PR is ready for review/merge :) |
❤️ 💚 💙 💛 💜 ❤️ 💚 💙 💛 💜 ❤️ 💚 💙 💛 💜 |
author Michał Łępicki <michallepicki@users.noreply.github.com> 1546725776 +0100 committer Mat Clutter <matclutter@gmail.com> 1554419584 -0400 gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEsM4qAF+pTkg2/b7aTIOp6Pcx4e4FAlymj4AACgkQTIOp6Pcx 4e5C4RAAr+0863jpjah1JcSKz6LBAR341VnwWSccn1ndvT8kohpFaogIqBh2luP1 iDCq6ZHNHviNoD/YrZDUfFbtcShSD70gCba5l2W2+QItQ7ncm1TGPC5iXi6wi+Cx VqrYPSedHNlkUNQEphePTj0a+7S16sZWgZZo74nKQL2jpbnEHQfQBMn3LeLVY749 M8LqePTPzpctEYqqFWuWhOM3HcWhZyZqR+eqJDbJPhIY0HwvmtL0+Hh/TzIYmBV2 UhMfQ2Xl2ZMPQsQpmdP8RuqyEE5FbUkY6eyZOw4FLPFt0gGqVlvWaUscFxzG5Jd9 B1siUUTIv9ghONyO5QlUJigAsMcFqBr27tOWW+qLsPvScR0LEneC/Fc71JvZsTsY b/CopfkzVNNNlgx9RYyp4zK00+E8aPqPUxvPLjusymcOmUTP/CxoGZjJY5+xroIp AVoL9j994ujM8Qs1IZo2gw6wXgi5NXgn6Tbu/Dy8mWDbShdqQu641K5anlya5A9S MkGYUZ2EeeHAYY8nj6HuIqmOvd23K1jz8uX0oqtDcu2T4K7PH1w81T00pwBwekhC 3CdiLbq0z2aWCfNl8O4/SapMbWIoYbZC6Z8oCrRjSzqQl1qyJQiHX7BunMpQd0zu sqjN+7s6mXxG33Qwkk3shOCLgPiF2sCvEnqF82Al3gWmphjcMEs= =m5NQ -----END PGP SIGNATURE----- Unify code styling for makeup and hljs (elixir-lang#959) Fix anchor links sometimes not working by moving js to html head (elixir-lang#962) Raise error message for unknown docs chunk Add goto icon Fix sidebar margin on Firefox Allow direct external links on the sidebar * Clicking on the sidebar now consistenty expands the menu * However, on every root link, there is now an arrow to open the page directly * If shift is pressed, we keep the browser behaviour * Improve CSS classes: clicked is now currentPage and active is now currentHash Hide formatter modules Release v0.19.3 Remove broken link Always show link Add extra padding Use the goto arrow consistently on expansions Reduce hljs FOUC to colors only (elixir-lang#960) Fix typespec arg number (elixir-lang#966) Previously signature where typespecs didn't have an argument name, were named starting with 0 time_zone_period_from_utc_iso_days(arg0, arg1) time_zone_period_from_utc_iso_days(Calendar.iso_days(), Calendar.time_zone()) :: ... this commit fixes the number starting from 1 Name args in Autolink.default_text/4 helper (elixir-lang#957) Add titles to sidebar top-right icons Improve mouseover and titles on goto, related to elixir-lang#968 Add a versions dropdown to the html sidebar (elixir-lang#970) Remove overflow on content, closes elixir-lang#972 Reduce size of app-vsn annotation Keep trailing periods in summaries (elixir-lang#977) Closes elixir-lang#975 Revert "Remove overflow on content, closes elixir-lang#972" This reverts commit 43effcb. The reverted commit breaks anchors on Firefox. Fix anchors in Firefox/Chromium Closes elixir-lang#978 Added ARIA-label to the search button Signed-off-by: José Valim <jose.valim@plataformatec.com.br> Add keyboard shortcuts (elixir-lang#976) Fix issues with JS events under non-webkit browsers (elixir-lang#980) Keyboard shortcuts - improvements (elixir-lang#982) Add module to node structs to carry module name; add mfa into title attribute on links to improve seo Fix tests to include title Run formatter Remove module attribute on nodes; update templates to pass in module to reference title where needed Remove 'Link to' text except for detail chain link and screenreader info Update tests to remove Link to text from api and non-detail templates Undo unintentional format of spacing Remove link to text from title attributes Update css/js with new sha version Add title attribute with mfa on links to improve seo Add module to node structs to carry module name; add mfa into title attribute on links to improve seo Remove 'Link to' text except for detail chain link and screenreader info Undo unintentional format of spacing Add title attribute with mfa on links to improve seo Update title in detail template examples Add title to replace function for links in text Update auto link to add titles to links within page content and specs Add module_id into default_title to add full mfa to local functions Lowercase section headings in titles New dist files after running build after rebase accumulation Remove rebased-in code Update module details and search results Create seperate entry function for extras headings; change casing on summary Update templates and tests to remove tags from titles Change binary block formatting keep formatter from breaking lines Full text search (elixir-lang#974) Fix required double click on sidebar for safari Improvements to full text search * Add loading state * Only load search items on search page No longer depend on Poison Move shared dependency to HTML Do not render to markdown multiple times Make the linter happy Ignore : in search as it is not stemmed anyway, closes elixir-lang#983 Provide search help on invalid syntax Remove double var Keep structs in signature, closes elixir-lang#973 List delegation docs if delegate_to metadata is present Run the formatter in released Elixir version Update CHANGELOG Search autocomplete (elixir-lang#985) Rename config.js to ex_doc_config.js Push Earmark to v1.3 (elixir-lang#988) Add module to node structs to carry module name; add mfa into title attribute on links to improve seo Run formatter Remove module attribute on nodes; update templates to pass in module to reference title where needed Remove 'Link to' text except for detail chain link and screenreader info Undo unintentional format of spacing Update css/js with new sha version Add title attribute with mfa on links to improve seo Add module to node structs to carry module name; add mfa into title attribute on links to improve seo Remove 'Link to' text except for detail chain link and screenreader info Undo unintentional format of spacing Add title attribute with mfa on links to improve seo Add module_id into default_title to add full mfa to local functions Lowercase section headings in titles New dist files after running build after rebase accumulation Remove rebased-in code Update module details and search results Create seperate entry function for extras headings; change casing on summary Update templates and tests to remove tags from titles Change binary block formatting keep formatter from breaking lines Add link_title to new searchItems list Update earmark after deps.get Update css/js assets after mix build Update css/js assets after mix build
Add autocomplete (drop-down with suggestions) to search
Demo: [ Demo link ]
Additional demos:
Description
Adds a drop-down with search suggestions
++
or@
)Layout updates
Full text search compatibility
This feature is fully compatible with the full-text search. I've brought back the
findIn
function in thesearch.js
. While the search page no longer needs it, autocomplete still uses the basic module/function search.TODO (in scope of this PR):
Module.function
syntax worksfindIn
to cleanup and simplify the remaining 'old search' code