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: Remove the brief of structs and traits #39952

Closed
ishitatsuyuki opened this issue Feb 19, 2017 · 8 comments
Closed

rustdoc: Remove the brief of structs and traits #39952

ishitatsuyuki opened this issue Feb 19, 2017 · 8 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ishitatsuyuki
Copy link
Contributor

ishitatsuyuki commented Feb 19, 2017

Traits and structs brief should be removed: its functionality can be achieved through pressing the [-] button.

Things that are not expressed through the "methods/fields" doucment:

  • indication of default implementation on traits: once the brief is removed, we should add an indicator instead to the function line.
  • indication of private fields in a struct: we can add a note instead.
Original proposal (superseded)

Current:

pub struct Vec<T> { /* fields omitted */ }

Desired:

pub struct Vec<T> { /* fields omitted */ }

impl<T> Vec<T> {
    fn new() -> Vec<T>;
}

impl<T> IntoIterator for Vec<T>;
impl<T> Index<usize> for Vec<T>;

EDIT: as @sinkuu mentioned below, we have a way to display a well formatted brief by minimizing the descriptions.
We have another option, by removing the brief for traits and advertise the use of [-].

@frewsxcv
Copy link
Member

Do you want it to show all available methods and implementations in the code block at the top?

@frewsxcv frewsxcv added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 19, 2017
@ishitatsuyuki
Copy link
Contributor Author

Yeah, scrolling and finding a method is a huge pain for large pages like Vec.

@sinkuu
Copy link
Contributor

sinkuu commented Feb 19, 2017

So you are ok with all methods listed, then doesn't pushing [-] on top-right of the page give you almost what you want?

@ishitatsuyuki
Copy link
Contributor Author

@sinkuu didn't noticed that, it's looking quite good. I originally intended to have a similar outlook like the traits; they have methods listed in the block.

I would change the topic to uniforming the two; thanks anyway.

@ishitatsuyuki ishitatsuyuki changed the title rustdoc: Show a brief of functions for struct rustdoc: Uniform the brief of structs and traits Feb 19, 2017
@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Jul 27, 2017
@ishitatsuyuki
Copy link
Contributor Author

@rust-lang/docs any interest in this?

@ishitatsuyuki ishitatsuyuki changed the title rustdoc: Uniform the brief of structs and traits rustdoc: Remove the brief of structs and traits Sep 5, 2018
@GuillaumeGomez
Copy link
Member

I have to admit that I don't like the idea... Let's see what others think.

@jsha
Copy link
Contributor

jsha commented Jun 3, 2021

In #83337, we went the other direction: making the decl visible by default in more cases, but hiding its contents when it is very long. I think we should close this, since the consensus in #83337 seemed to go in the other direction.

@GuillaumeGomez
Copy link
Member

Agreed. Just for the record: cc @Manishearth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. 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

7 participants