Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRustdoc - display `since` version for stable items #30686
Conversation
rust-highfive
assigned
steveklabnik
Jan 3, 2016
This comment has been minimized.
This comment has been minimized.
|
Yay! |
This comment has been minimized.
This comment has been minimized.
|
I would prefer if the text was less prominent: either greyed or with smaller font. It is too distracting at the moment for something that's so meta. |
This comment has been minimized.
This comment has been minimized.
|
@tshepang What do you think of this? |
This comment has been minimized.
This comment has been minimized.
|
@wesleywiser that's better, thanks |
This comment has been minimized.
This comment has been minimized.
|
I also have the sense that this is giving a great deal of prominence to a rather unimportant piece of information. One thing we could do is remove 'since' - this word doesn't convey any information every time it's repeated. This is also a new way to style stability information, and I already count two - See for example where stability of the element on the page is indicated by a colored box while stability of its methods is indicated by the word '[Unstable]' while fading out the text. It would be easier to understand that this and that are both types of stability information if they were styled similarly. |
This comment has been minimized.
This comment has been minimized.
|
@brson re 'since': I agree. Here's what it looks like without 'since': I think agree that adding yet another way to show stability information is bad. I'm having some trouble imagining what a common style might look like. One idea I had that might further minimize the visual noise would be to only show the version number when it is different than the containing object's version number. For example, the previous screenshot would look like this because |
This comment has been minimized.
This comment has been minimized.
|
I like the second option:
|
wesleywiser
force-pushed the
wesleywiser:rustdoc_display_since
branch
from
d2a35e5
to
5c5dab2
Jan 6, 2016
This comment has been minimized.
This comment has been minimized.
|
@wesleywiser I do like that idea of not displaying them when they are the same. With that I think I'm ok with trying this. |
This comment has been minimized.
This comment has been minimized.
|
I basically feel the same as @brson on this thread. Let's give it a try. Let me know when this PR implements that, and we'll merge after the release thursday, assuming you can update it before then. |
This comment has been minimized.
This comment has been minimized.
|
@brson @steveklabnik Will do. Sorry, I've been pretty busy lately but hopefully I'll have some time to work on it later this week. I'll post new screenshots when when I update the PR. |
This comment has been minimized.
This comment has been minimized.
|
No worries at all :) |
This comment has been minimized.
This comment has been minimized.
|
@wesleywiser ping! Any chance you've had the time to work on this? |
bluss
reviewed
Feb 9, 2016
| @@ -339,6 +339,14 @@ impl Item { | |||
| _ => String::new(), | |||
| } | |||
| } | |||
|
|
|||
| pub fn stable_since(&self) -> Option<String> { | |||
This comment has been minimized.
This comment has been minimized.
bluss
Feb 9, 2016
Contributor
Can you use -> Option<&str> here instead? It should be enough since the string is only ever passed down. Change s.since.clone() to &s.since[..] too and update the other impacted code.
I think this change looks great otherwise.
wesleywiser
force-pushed the
wesleywiser:rustdoc_display_since
branch
from
5c5dab2
to
75acee2
Feb 10, 2016
This comment has been minimized.
This comment has been minimized.
|
@steveklabnik Great timing Steve! I think it's mostly working at this point (I looked over the generated docs and didn't see any glaring issues). I've updated this PR with the new code (and also implemented @bluss's suggestion). |
This comment has been minimized.
This comment has been minimized.
|
@bors: r+ okay, let's give it a try! |
This comment has been minimized.
This comment has been minimized.
|
|



wesleywiser commentedJan 3, 2016
Here's some screenshots after this change:
I tried to click through the
stddocs and make sure everything that can have stability attributes has it rendered but I'm probably missing some. I'd also appreciate any feedback on the css changes. I had difficulty getting thesincelabels aligning correctly for enum variants. If anyone has a better idea for that, I'd be glad to implement it.Fixes #27607