-
Notifications
You must be signed in to change notification settings - Fork 13k
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: CSS: show the <details>
"triangle" in all cases
#82805
Conversation
Currently we use `<details>` and `<summary>` for the unstable info box, under class `.stab`. However, they can also be useful to add detailed documentation like lengthy detailed examples that would be too much to show by default, e.g.: /// <details><summary>Time-threads diagram</summary> /// /// ```text /// // Thread 1 | // Thread 2 /// let _rg = lock.read(); | /// | // will block /// | let _wg = lock.write(); /// // may deadlock | /// let _rg = lock.read(); | /// ``` /// </details> See rust-lang#82624 for an example where we could use this functionality. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Some changes occurred in HTML/CSS/JS. |
r? @jyn514 (rust-highfive has picked a reviewer for you, use r? to override) |
Please add a screenshot of the result. |
The line spacing/margins don't seem quite right. It looks like the summary is more closely related to the next paragraph rather than the previous one that ends in "e.g.:", referring to the collapsed text. |
Indeed, the style can be improved quite a bit. I intentionally put the minimal change required to "enable" the feature. I can add style changes in another PR or another commit here if preferred. |
Please do it in this PR. Also, please provide a "before" screenshot too. :) |
Yes, will do. |
@ojeda Ping from triage, any updates on this? |
I planned to do it early next week, but let me try to move it forward to this weekend. |
@ojeda any updates? |
@ojeda I'm gonna close this pr due to inactivity. Feel free to reopen or create a new pr when you've got time to work on this again. Thanks! |
…jsha Show triangle on the "Details" disclosure element in all cases Re-submission of rust-lang#82805, fixes the style issue by applying the same margin as `<p>`. <details><summary>Before</summary> ![before 1](https://user-images.githubusercontent.com/25030997/123215032-e4c99880-d502-11eb-9ccc-6df58f3a6b0b.png) ![before 2](https://user-images.githubusercontent.com/25030997/123215035-e5622f00-d502-11eb-9275-6c6dfcfdf72e.png) </details> <details><summary>After</summary> ![after 1](https://user-images.githubusercontent.com/25030997/123215037-e5fac580-d502-11eb-9b49-c99d1eafb1b4.png) ![after 2](https://user-images.githubusercontent.com/25030997/123215040-e5fac580-d502-11eb-8afc-ab713d3dc658.png) </details> r? `@GuillaumeGomez`
Currently we use
<details>
and<summary>
for the unstableinfo box, under class
.stab
. However, they can also be usefulto add detailed documentation like lengthy detailed examples
that would be too much to show by default, e.g.:
See #82624 for an example
where we could use this functionality.
Signed-off-by: Miguel Ojeda ojeda@kernel.org