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: CSS: show the <details> "triangle" in all cases #82805

Closed
wants to merge 1 commit into from

Conversation

ojeda
Copy link
Contributor

@ojeda ojeda commented Mar 5, 2021

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 #82624 for an example
where we could use this functionality.

Signed-off-by: Miguel Ojeda ojeda@kernel.org

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>
@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez

@rust-highfive
Copy link
Collaborator

r? @jyn514

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 5, 2021
@GuillaumeGomez
Copy link
Member

Please add a screenshot of the result.

@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 5, 2021
@jyn514 jyn514 assigned GuillaumeGomez and unassigned jyn514 Mar 5, 2021
@jyn514 jyn514 added the A-rustdoc-ui Area: Rustdoc UI (generated HTML) label Mar 5, 2021
@ojeda
Copy link
Contributor Author

ojeda commented Mar 6, 2021

closed
open

@the8472
Copy link
Member

the8472 commented Mar 6, 2021

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.

@ojeda
Copy link
Contributor Author

ojeda commented Mar 6, 2021

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.

@GuillaumeGomez
Copy link
Member

Please do it in this PR. Also, please provide a "before" screenshot too. :)

@JohnCSimon
Copy link
Member

Ping from triage:
@ojeda - can you address the comment from GuillaumeGomez, and then switch the tag back to S-waiting-on-review?

@rustbot label: -S-waiting-on-review +S-waiting-on-author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 22, 2021
@ojeda
Copy link
Contributor Author

ojeda commented Mar 22, 2021

Yes, will do.

@crlf0710
Copy link
Member

crlf0710 commented Apr 9, 2021

@ojeda Ping from triage, any updates on this?

@crlf0710 crlf0710 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 9, 2021
@ojeda
Copy link
Contributor Author

ojeda commented Apr 9, 2021

@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.

@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 26, 2021
@Dylan-DPC-zz
Copy link

@ojeda any updates?

@bstrie bstrie added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 12, 2021
@bstrie bstrie removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 2, 2021
@bstrie bstrie added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 2, 2021
@crlf0710
Copy link
Member

@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!

@crlf0710 crlf0710 closed this Jun 19, 2021
@crlf0710 crlf0710 added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 19, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 27, 2021
@ojeda ojeda deleted the rustdoc-details-css branch June 28, 2021 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. 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.

10 participants