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

rustdoc: include item type in search results #93496

Closed
jsha opened this issue Jan 31, 2022 · 6 comments
Closed

rustdoc: include item type in search results #93496

jsha opened this issue Jan 31, 2022 · 6 comments
Labels
A-rustdoc-search Area: Rustdoc's search feature A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jsha
Copy link
Contributor

jsha commented Jan 31, 2022

There are a fair number of items that have the same name but different types. For instance, std::panic (the macro) and std::panic (the module). Right now we distinguish these with colors. But that's not accessible for colorblind people. Also some of the colors are not often seen in a context where someone is likely to learn what they mean - for instance green for macros.

We should additionally distinguish search results by writing the actually type of the item. This should probably be its own column, between the item name and the description.

@jsha jsha added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) A-rustdoc-search Area: Rustdoc's search feature labels Jan 31, 2022
@GuillaumeGomez
Copy link
Member

Why not putting it before the name every time instead of putting it in its own column?

@jsha
Copy link
Contributor Author

jsha commented Jan 31, 2022 via email

@GuillaumeGomez
Copy link
Member

Then name (type)?

@jaskij
Copy link

jaskij commented Mar 25, 2022

Maybe just the first letter even? Stylized differently, or as an icon, so that it stands out more.

Edit to add: My point is, to have the type stand out visually as not a part of the result name and path. Different color, different font, something.

@fmease
Copy link
Member

fmease commented Aug 12, 2022

For prior art, take a look at the doc pages of Scala 2 and 3. They use circles containing the initial letter of the item type.

@fmease fmease added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Sep 6, 2023
@fmease
Copy link
Member

fmease commented Sep 7, 2023

Fixed by #110688.

@fmease fmease closed this as completed Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-search Area: Rustdoc's search feature A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-enhancement Category: An issue proposing an enhancement or a PR with one. 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