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: add stability and source links to the methods; w/ style tweaks #14042

Closed
wants to merge 6 commits into from

Conversation

adrientetar
Copy link
Contributor

  • Pull-in changes from rustdoc: Add stability and source links to the methods #13802, with a rebase
  • Fix again link selectors (unrelated to the original PR)
  • Show stability attributes with color pellets, add more explicit titles that will appear on hover
  • Keep using [src] for the source links, don't show them on methods until (method+description) is hovered

Example: http://adrientetar.legtux.org/cached/rust-docs/foo.htm

cc @lifthrasiir. Closes #13802, which fixes #12932.

r? @alexcrichton

@alexcrichton
Copy link
Member

It looks like some of the bullets don't have titles (such as fn frozen() and the outer struct), but it looks like you had logic to make it not an empty string. Is the preview example up to date?

@alexcrichton
Copy link
Member

The implementation is fine by me. The bullets look like they're a little small, but once you see them everywhere they may be pretty obvious. The color scheme is also helpful I think.

@adrientetar
Copy link
Contributor Author

@alexcrichton Right, updated.

@adrientetar
Copy link
Contributor Author

Repushed latest commit without changes to see if Travis triggers. Seems like it doesn't.

@alexcrichton
Copy link
Member

(needs a rebase)

lifthrasiir and others added 4 commits May 8, 2014 20:41
…ng#12932.

this change made most functions that render the methods to require
the render `Context`, so they are now made into `Context` methods.

Conflicts:
	src/librustdoc/html/markdown.rs
	src/librustdoc/html/render.rs
	src/librustdoc/html/static/main.css

Conflicts:
	src/librustdoc/html/render.rs
this makes a source link much more visible (and link-like), and
makes a stability index more consistent for the top-level headings
and the method signature. this should be better than nothing,
but further adjustments and/or redesigns are welcomed.

Conflicts:
	src/librustdoc/html/static/main.css
@adrientetar
Copy link
Contributor Author

The first commit was a pain to work with but, rebased.

@alexcrichton
Copy link
Member

After thinking a little bit about this, what would you think about removing the bullets and making the left-hand side a colored bar going up an down the page? That way it may be a little clearer and all of the stability levels will line up.

It may also be nice to have the stability levels extend to the height of the entire method block (the whole function). Does that make sense?

@huonw
Copy link
Member

huonw commented May 9, 2014

FWIW, I think the mouse-over only text for the stability attributes is hard to find, and is essentially unusable on a touchscreen.

@yuriks
Copy link
Contributor

yuriks commented May 9, 2014

I think the bullets are fine for the more stable levels, but experimental and deprecated items should have more noticeable markers, I could see myself just looking over them as "just more bullets". So the experimental and deprecated levels should get a rectangular tag instead. Given that, I think the bullets for stable and below could also be only visible when hovering. (alexchrichton's idea also sounds good.)

@adrientetar
Copy link
Contributor Author

I will work on it this week-end.

@lifthrasiir: do you know why I see cx being undefined inside the impl block? Is it something gone wrong with the rebase?

@lifthrasiir
Copy link
Contributor

@adrientetar I think some merged changes after the initial PR had inserted a reference to the context. If they are present in the impl Context block, you can safely change those to self to get it work (except for the nested functions). It seems that both problematic references are indeed in the impl Context block.

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to reopen with a rebase!

@adrientetar
Copy link
Contributor Author

I will revive this when I've got some time.

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2023
internal: Add a manual section for Flatpak

Fixes rust-lang#14042
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rustdoc should show [src] link for methods
5 participants