Skip to content

Rustdoc search for "slice" should have primitive as top result #25167

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

Closed
ucarion opened this issue May 7, 2015 · 4 comments
Closed

Rustdoc search for "slice" should have primitive as top result #25167

ucarion opened this issue May 7, 2015 · 4 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ucarion
Copy link
Contributor

ucarion commented May 7, 2015

When browsing documentation and searching for "slice", the top three results are:

  1. std::slice the module
  2. std::raw::Slice the struct representation
  3. std::slice the primitive

I think std::slice-the-primitive should be the top result (it is currently the third result), because it tells me what I can do to a slice, which is usually what I'm wondering about when I search for "slice". std::slice-the-module gives meager documentation, and links to structs, which I'm comparatively rarely interested in.

/cc @steveklabnik since you're the documentation guy?

@sanxiyn sanxiyn added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label May 7, 2015
@emberian
Copy link
Member

emberian commented May 7, 2015

@alexcrichton do you know if the search indexing could have 'prioritizing' like this?

@killercup
Copy link
Member

@cmr From a quick glance at rustdoc's main.js: This sort function seems to be responsible for setting the priority of results. The 'type' of result is currently only the second last criteria and orders by index of this types array.

So, making types more important, moving 'primitive' up in the types array (or adding a special case for primitives) are good options.

@emberian
Copy link
Member

emberian commented May 7, 2015

@killercup Sounds like you should make a PR!

@killercup
Copy link
Member

Maybe over the weekend!

On Thu, May 7, 2015 at 8:42 PM, Corey Richardson notifications@github.com
wrote:

@killercup Sounds like you should make a PR!

Reply to this email directly or view it on GitHub:
#25167 (comment)

oli-obk pushed a commit to oli-obk/rust that referenced this issue May 23, 2015
…, r=Gankro

This minimally changes rustdoc's search as described in rust-lang#25167.

Additionally, I also cleaned up some parts of the JS code.

There is one more change I made: After each result for a primitive type, I added "(Overview of primitive type)". This further differentiates the result from the module (previously, the only difference was that the module's link was blue). I'm not this is the way to go (this seems to be the only place where we do this) and it's no problem for me to remove that commit.

![std__str_-_rust](https://cloud.githubusercontent.com/assets/20063/7770589/67e8cb26-0090-11e5-8f99-c2a3af9fa37f.png)

cc @steveklabnik (it concerns docs) and @alexcrichton (who made changes to rustdoc previously)
oli-obk pushed a commit to oli-obk/rust that referenced this issue May 23, 2015
oli-obk pushed a commit to oli-obk/rust that referenced this issue May 23, 2015
oli-obk pushed a commit to oli-obk/rust that referenced this issue May 23, 2015
…, r=Gankro

This minimally changes rustdoc's search as described in rust-lang#25167.

Additionally, I also cleaned up some parts of the JS code.

There is one more change I made: After each result for a primitive type, I added "(Overview of primitive type)". This further differentiates the result from the module (previously, the only difference was that the module's link was blue). I'm not this is the way to go (this seems to be the only place where we do this) and it's no problem for me to remove that commit.

![std__str_-_rust](https://cloud.githubusercontent.com/assets/20063/7770589/67e8cb26-0090-11e5-8f99-c2a3af9fa37f.png)

cc @steveklabnik (it concerns docs) and @alexcrichton (who made changes to rustdoc previously)
oli-obk pushed a commit to oli-obk/rust that referenced this issue May 23, 2015
…, r=Gankro

This minimally changes rustdoc's search as described in rust-lang#25167.

Additionally, I also cleaned up some parts of the JS code.

There is one more change I made: After each result for a primitive type, I added "(Overview of primitive type)". This further differentiates the result from the module (previously, the only difference was that the module's link was blue). I'm not this is the way to go (this seems to be the only place where we do this) and it's no problem for me to remove that commit.

![std__str_-_rust](https://cloud.githubusercontent.com/assets/20063/7770589/67e8cb26-0090-11e5-8f99-c2a3af9fa37f.png)

cc @steveklabnik (it concerns docs) and @alexcrichton (who made changes to rustdoc previously)
oli-obk pushed a commit to oli-obk/rust that referenced this issue May 23, 2015
…, r=Gankro

This minimally changes rustdoc's search as described in rust-lang#25167.

Additionally, I also cleaned up some parts of the JS code.

There is one more change I made: After each result for a primitive type, I added "(Overview of primitive type)". This further differentiates the result from the module (previously, the only difference was that the module's link was blue). I'm not this is the way to go (this seems to be the only place where we do this) and it's no problem for me to remove that commit.

![std__str_-_rust](https://cloud.githubusercontent.com/assets/20063/7770589/67e8cb26-0090-11e5-8f99-c2a3af9fa37f.png)

cc @steveklabnik (it concerns docs) and @alexcrichton (who made changes to rustdoc previously)
@bors bors closed this as completed in ec60d9f May 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants