Skip to content
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

frontend: change logic of when doc links are shown in search results #9475

Closed
wants to merge 1 commit into from

Conversation

LawnGnome
Copy link
Contributor

The crate version page uses a fallback to handle crates that don't define documentation keys in their manifests: if docs.rs has documentation for that crate version, that those docs are used.

The search results do not implement the same logic, so crates that don't have documentation keys don't get the handy documentation link in the crate row.

This copies the logic from the version model into the crate model, using the default crate version as the version to look for on docs.rs.

I strongly suspect there is a better way to do this than copying a bunch of code, and would welcome suggestions from those more familiar with Ember.

This would eventually fix #1484.

The crate version page uses a fallback to handle crates that don't
define `documentation` keys in their manifests: if docs.rs has
documentation for that crate version, that those docs are used.

The search results do not implement the same logic, so crates that don't
have `documentation` keys don't get the handy documentation link in the
crate row.

This copies the logic from the version model into the crate model, using
the default crate version as the version to look for on docs.rs.

I strongly suspect there is a better way to do this than copying a bunch
of code, and would welcome suggestions from those more familiar with
Ember.

This would eventually fix rust-lang#1484.
@LawnGnome LawnGnome self-assigned this Sep 19, 2024
@epage
Copy link

epage commented Sep 19, 2024

Doesn't this run into the issue of hammering docs.rs mentioned in #1484 (comment) ?

@Turbo87
Copy link
Member

Turbo87 commented Sep 20, 2024

yeah, this would create an N+1 query situation towards the docs.rs API. I'm not sure whether that's actually desirable...

slightly tangential: I'm not sure either whether we should really show these doc links in the search results at all. e.g. https://lib.rs/search?q=serde has a more concise view of search results which IMHO is better than ours

@Turbo87 Turbo87 added C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works A-frontend 🐹 labels Sep 23, 2024
@Turbo87 Turbo87 closed this Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend 🐹 C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs.rs link is missing from search results
3 participants