-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustdoc: CSS: show the <details>
"triangle" in all cases
#82805
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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>   </details> <details><summary>After</summary>   </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