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: stop treating everything in a trait item as a method #105629

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

notriddle
Copy link
Contributor

This was added in 0b9b4b7 to fix the spacing on trait pages, but stopped being needed because 791f04e stopped styling method-toggle. By only putting the method-toggle class on actual methods, the JS setting does the right thing.

This was added in 0b9b4b7 to fix the
spacing on trait pages, but stopped being needed because
791f04e stopped styling method-toggle.
By only putting the method-toggle class on actual methods, the JS setting
does the right thing.
@rustbot
Copy link
Collaborator

rustbot commented Dec 12, 2022

r? @GuillaumeGomez

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 12, 2022
@@ -732,7 +732,8 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
document(&mut content, cx, m, Some(t), HeadingOffset::H5);
let toggled = !content.is_empty();
if toggled {
write!(w, "<details class=\"rustdoc-toggle method-toggle\" open><summary>");
let method_toggle_class = if item_type.is_method() { " method-toggle" } else { "" };
write!(w, "<details class=\"rustdoc-toggle{method_toggle_class}\" open><summary>");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually: why do we have both rustdoc-toggle and method-toggle?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setting "Auto-hide item methods' documentation" treats it special:

if (hideMethodDocs && hasClass(e, "method-toggle")) {
e.open = false;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. Maybe we should extend this setting to all items which have docs. To be discussed later on I suppose.

@GuillaumeGomez
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 12, 2022

📌 Commit 7e64ceb has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 12, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 13, 2022
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#104864 (Account for item-local in inner scope for E0425)
 - rust-lang#105332 (Point out the type of associated types in every method call of iterator chains)
 - rust-lang#105620 (Remove unnecessary uses of `clone`)
 - rust-lang#105625 (minor code cleanups)
 - rust-lang#105629 (rustdoc: stop treating everything in a trait item as a method)
 - rust-lang#105636 (Add check for local-storage value when changing "display line numbers" settings)
 - rust-lang#105639 (rustdoc: remove `type="text/css" from stylesheet links)
 - rust-lang#105640 (Adjust miri to still be optional)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 105e398 into rust-lang:master Dec 13, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 13, 2022
@notriddle notriddle deleted the notriddle/method-toggle-trait branch December 13, 2022 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants