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

Allow to go through clippy lints page without javascript #13539

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Oct 11, 2024

Fixes #13536.

This is the follow-up of #13269.

This PR makes it possible to expand/collapse lints (individually) without JS. To achieve this result, there are two ways:

  1. Use details and summary tags. Problem with this approach is that the web browser search may open the details tags automatically if content matching it is inside. From a previous discussion with @Alexendoo, it seems to not be a desired behaviour.
  2. Use a little trick where you use a label and a checkbox where the checkbox is in fact hidden. Then it's just a matter of CSS.

r? @Alexendoo

changelog: Allow to go through clippy lints page without JS

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 11, 2024
});
};
onEachLazy(elem.querySelectorAll("pre > code.language-rust:not(.highlighted)"), call);
onEachLazy(elem.querySelectorAll("pre > code.language-no_run:not(.highlighted)"), call);
Copy link
Member

@Alexendoo Alexendoo Oct 12, 2024

Choose a reason for hiding this comment

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

Ah this should not be happening, some changes from #13359 may need to be reapplied on top of those for #13269

edit: this meaning no_run appearing on the docs site

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I see. Gonna update then.

@GuillaumeGomez GuillaumeGomez force-pushed the allow-no-js branch 3 times, most recently from a0c56a5 to 147d2a4 Compare October 13, 2024 23:58
@GuillaumeGomez
Copy link
Member Author

Fixed the bug. I took an approach a little bit different by using the pulldown-cmark API. Maybe we should do the same in sanitize_explanation (in another PR)?

@Alexendoo
Copy link
Member

It should use sanitize_explanation to ensure they're consistent, e.g. this impl is missing the hidden line removal

@GuillaumeGomez
Copy link
Member Author

Changed the code to use sanitize_explanation. 👍

Copy link
Member

@Alexendoo Alexendoo left a comment

Choose a reason for hiding this comment

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

Looks good with the minus sign change, the configuration defaults are unaligned but if I merge with master that's fixed so looks unrelated to this change

content: "+";
}
article > input[type="checkbox"]:checked + label .label-doc-folding::before {
content: "-";
Copy link
Member

Choose a reason for hiding this comment

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

Should be

@GuillaumeGomez
Copy link
Member Author

Fixed the minus sign.

@Alexendoo
Copy link
Member

👍

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 18, 2024

📌 Commit da19d47 has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Oct 18, 2024

⌛ Testing commit da19d47 with merge 6a79588...

@bors
Copy link
Collaborator

bors commented Oct 18, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo
Pushing 6a79588 to master...

@bors bors merged commit 6a79588 into rust-lang:master Oct 18, 2024
8 checks passed
@GuillaumeGomez GuillaumeGomez deleted the allow-no-js branch October 19, 2024 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

website: dark color them renders code unreadable
4 participants