-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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: indicate deprecated items on the sidebar #107568
Comments
I think sorting to the bottom would be a bad idea because it violates the typical behavior that the list of methods is sorted alphabetically, and is hard to explain concisely. When people read documentation, it's not only to discover new methods that they might use. It's also to discover the meaning of a method that they saw used in existing code. We shouldn't make a method harder to find just because it's deprecated. Given the restricted space in the sidebar, I think it's reasonable to require clicking on the item before seeing that it's deprecated. After all, there's no risk that someone will see |
Good point about the alphabetical sorting, I guess moving them to the bottom isn't needed. I still think a Having a flag just allows a bit of visual filtering that isn't otherwise available when you're searching for a method. You can kind of guess what a function signature looks like from the name ( |
I agree with @jsha: the space in the sidebar is very limited so adding new information would need to be very space efficient. |
Just for a rough idea, this is about what I had in mind: I kind of also like the single letter option. It's better with space and could be used to indicate nightly as well - not that I think this is needed as much as something to indicate deprecation. Just a .sb-flag {
padding: 2.5px;
margin-bottom: 3px;
font-size: 0.82rem;
margin-left: 5px;
} |
As soon as the item is too long (where the "..." appears), this wouldn't work anymore. What I had in mind was actually to use the space on the left. But I'm really not sure it's a good idea. |
I still don't think this is a good idea. The purpose of the sidebar is skimming for an item name and jumping to it. Any decoration other than the item name slows down that process, and actually draws more attention to the decorated items. It's okay to discover that an item is deprecated by clicking on it. |
Another option is to have deprecated items use a different text color in the sidebar ("grayed out"). That way the space used doesn't increase. |
Consensus in the recent meeting seemed to reject this PR. Thanks for the time, and sorry it didn't work out. |
For example, at this link: https://doc.rust-lang.org/std/macro.try.html
try
is deprecated but there's no way to easily identify that from the sidebar. Adding adeprecated
label there (or the thumbs down emoji if space is a concern) would be quite helpful.Sorting deprecated items to the bottom would also be quite reasonable imho, to avoid noise for anyone looking for only non-deprecated methods. (This probably wouldn't be bad to do for deprecated methods as well on the main page, since the ordering is a bit random. But that's a separate discussion.)
@rustbot label A-rustdoc-ui C-enhancement T-rustdoc
The text was updated successfully, but these errors were encountered: