-
Notifications
You must be signed in to change notification settings - Fork 13k
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: Another round of improvements #24396
Conversation
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
r? @aturon cc @sfackler, @wycats, @steveklabnik, @bstrie, @tomjakubowski |
Yay! It'd be nice to identify deprecated stuff in search results as well. |
r+ x 1000. It would be useful to get before and after screenshots for rustdoc changes 😄 |
Wow, fantastic work as always Alex! I love the changes to stability and of course the "Methods from |
I agree that overall this is an improvement, but agree with @killercup that it's a bit big. |
Another great feature's screenshot, thanks to @alexcrichton ! |
This is really awesome work, @alexcrichton! The docs are feeling much more polished, and I really like the I do agree with others that the unstable/deprecation warnings are a bit too attention-getting. I suspect that some fairly simple changes to the styling could de-emphasize them, and that seems worth doing in this PR. |
Ok I've pushed a few tweaks to the style (and re-uploaded the docs). I incorporated @killercup's suggestions (thanks!) and also made the font size a little smaller. I do think that it's still a little jarring but much less so than before! |
👍 |
👍 (The padding on the bottom looks a bit off to me, but that's nothing major. I'd probably set it to |
Thanks @alexcrichton! The code looks good to me as well, so: @bors: r+ |
📌 Commit cdb1d95 has been approved by |
A few final improvements to rustdoc for 1.0: * Improve how rustdoc handles stability * Fix cross-crate macro source links * Improve experience of types inheriting methods through `Deref` Some more details can be found in the commits. [Preview](http://people.mozilla.org/~acrichton/doc/std/)
💔 Test failed - auto-linux-64-nopt-t |
@bors: retry On Wed, Apr 15, 2015 at 2:05 PM, bors notifications@github.com wrote:
|
☔ The latest upstream changes (presumably #23682) made this pull request unmergeable. Please resolve the merge conflicts. |
attr::Unstable => "unstable".to_string(), | ||
attr::Stable => String::new(), | ||
}; | ||
if s.deprecated_since.len() > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcrichton if !s.deprecated_since.is_empty() {
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disregard! i hadn't noticed that the conflict is not yet resolved here
This commit is an overhaul to how rustdoc deals with stability of the standard library. The handling has all been revisited with respect to Rust's current approach to stability in terms of implementation as well as the state of the standard library today. The high level changes made were: * Stable items now have no marker by default * Color-based small stability markers have been removed * Module listings now fade out unstable/deprecated items slightly * Trait methods have a separate background color based on stability and also list the reason that they are unstable. * `impl` blocks with stability no longer render at all. This may be re-added once the compiler recognizes stability on `impl` blocks. * `impl` blocks no longer have stability of the methods implemente indicated * The stability summary has been removed Closes rust-lang#15468 Closes rust-lang#21674 Closes rust-lang#24201
The source filename for cross crate macros isn't quite right so the normal generated links are invalid. Closes rust-lang#21311
⌛ Testing commit a1378ff with merge 3eef83e... |
💔 Test failed - auto-linux-64-x-android-t |
Whenever a type implements Deref, rustdoc will now add a section to the "methods available" sections for "Methods from Deref<Target=Foo>", listing all the inherent methods of the type `Foo`. Closes rust-lang#19190
A few final improvements to rustdoc for 1.0: * Improve how rustdoc handles stability * Fix cross-crate macro source links * Improve experience of types inheriting methods through `Deref` Some more details can be found in the commits. [Preview](http://people.mozilla.org/~acrichton/doc/std/)
Nice. However, IMHO, the Deref docs shouldn't include static methods. |
Probably worth filing an issue for that |
Good point. Done. |
This is great! Thanks Alex.
The commit message says this is only inherent methods through Deref. Would it make sense to also show methods available through trait implementations on the Deref target? |
@SimonSapin my thinking was that the target of the I chose to only inline inherent methods because that's the real benefit of |
Fair enough, especially now that primitive types can have inherent methods and |
A few final improvements to rustdoc for 1.0:
Deref
Some more details can be found in the commits.
Preview