-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Introduce latest and related packages search #2013
Comments
Hey folks. I'm just trying to evaluate how much work is involved in shipping these features. I've been asked to take a look but we have a pretty constrained time budget to get it done. I'm pretty much starting from zero, so if I can get some pointers that would be awesome. |
Hi @jimsynz! I'd start from the first bullet item, which is to improve the look and feel of our search results, making it closer to the autocomplete results and to the results in this mockup page: hexpm/hexdocs#49 (comment) WDYT? |
I wonder if perhaps it would be better to start with the third bullet point, specifically powering autocomplete with |
There is some confusion in terms here.
We don't want to load PS: we use |
Interesting. So we are not looking to do cross package auto complete, only cross package search? I'm probably mixing up multiple conversations we had in the past. |
IIRC we discussed that because autocomplete is powered by a different set of data, we can't provide cross package autocomplete. FWIW I would personally value cross package autocomplete an order of magnitude higher than cross package search in terms of utility. |
We will do cross package autocomplete, but the cross package autocomplete comes from TypeSense APIs, not from loading The goal is: see if there is a |
Understood. I think the actual functionality may be better to start with personally, making the requests to the new API and populating the data etc, as that will likely be a very unambiguous "either it works or it doesn't", and then the UI can be iterated on top of the new working functionality. Just my 2 cents though :) |
That works for me too! I can write tomorrow steps to get these variables working. |
That would be awesome thanks @josevalim |
If you run |
Hi @josevalim - I'm not seeing that file after pulling the latest version:
|
I think its the elixir lang repo that has it, not ex_doc |
Ahh. I just realised that @josevalim said |
Now that we added package search to Hexdocs, we can start exposing it in ExDoc.
This will be done as two distinct features, latest search and related packages search.
We are also adding search feature to Hexdocs landing page and you should familiarize
yourself with the new screens there before moving forward.
Overall description
We will add new features to ExDoc that allows you to perform both search and
autocompletion on the latest or related versions of a package. We will use the
existing
docs_config.js
to enable this functionality. Once enabled, a dropdownarrow will appear embedded at the end of the search allowing you to choose the
type of search you want to perform, similar to this:
The text in the search bar will indicate which mode is active:
related
- Type / to search this and related packageslatest
- Type / to search the latest versioncurrent
- Type / to search this versionYou can click the dropdown to choose the mode, these options will show up as:
:related
- Search the latest version of this package and related packages:latest
- Search the latest version of this packageTo enable these modes, a
searchNodes
variable must be injected intodocs_config.js
.This variable is an array of
{name: "package-name", version: "package-version"}
entries,and it must have at least one entry, which is the current package itself and its latest
version. The modes should be available in this order and according to these conditions:
:related
- If searchNodes is available and it contains more than one entry:latest
- If searchNodes is available and it contains more than zero entries:current
- AlwaysFurthermore, we also want to improve the search results page to be closer to the one in
HexDocs and provide a more consistent experience overall. This means support for toggling
previews too.
Implementation
Update the current search results to leverage previews and stay closer to HexDocs mockups
Change HexDocs to include the
searchNodes
in all public packages today.We should also simplify the
versionNodes
one, there is no need to include "latest" on every entry(cc @wojtekmach)
Add support for
searchNodes
in ExDoc's autocompletion and search,with the dropdown for configuration, using the new TypeSense API. We can use Elixir itself to test
this feature, as its docs_config.js is generated by hand rather than Hex.pm
Change Hex.pm to allow storing related deps and update HexDocs to emit
searchNodes
based on related deps (cc @wojtekmach)
The text was updated successfully, but these errors were encountered: