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 discussion: collapsing sections by default #52520

Open
nrc opened this issue Jul 19, 2018 · 2 comments
Open

rustdoc discussion: collapsing sections by default #52520

nrc opened this issue Jul 19, 2018 · 2 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@nrc
Copy link
Member

nrc commented Jul 19, 2018

IIUC, Rustdoc collapses all trait impls and the type declaration (cc #49412) by default. But leaves other sections expanded.

This seems good in many cases, but in others. We might want to adjust exactly how things are collapsed.

Some thoughts:

  • When collapsing the type decl, it would be nice to still see a minimal part of the signature, e.g., for Iterator there is good reason to not show all the methods, but it would be nice to show pub trait Iterator { ... } and maybe the Item assoc type. I realise all the information is there on the page, but it just looks incomplete without something there.
  • It is often useful to have type decl as a 'contents' page for the docs, especially if the intro text is very long. OTOH, it might be nice to actually have a contents (e.g., just the names of fields/methods) so that impl methods are included.
  • For trait impls, it would be nice to include the signatures of methods, but not the text descriptions (i.e., the trait impl is expanded, but each method is collapsed). The reasoning here is that often wants to know the names or signatures of methods in an impl, but not the descriptions (where I agree with the reasoning that it is not the most useful).
  • For traits, it would be good to further collapse the list of impls, see for example IntoIterator, it might be nice to have just a list of the types (rather than the signatures) with a click through to see the sig, or to keep the current style but collapse the whole list by default.
@nrc nrc added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jul 19, 2018
@GuillaumeGomez
Copy link
Member

The current way to fix those issues is generally to add a setting for each one. After that, the discussion is generally on: "should it be on or off by default?". Does it sound ok to you?

@nrc
Copy link
Member Author

nrc commented Jul 29, 2018

Does it sound ok to you?

Mostly, yes. It seems a few of my points are about how we collapse not whether it should be collapsed or not (e.g., the first point).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

2 participants