Skip to content

rustdoc: simplify the codeblock tooltip - #101600

Merged
bors merged 1 commit into
rust-lang:masterfrom
notriddle:notriddle/li
Sep 9, 2022
Merged

rustdoc: simplify the codeblock tooltip#101600
bors merged 1 commit into
rust-lang:masterfrom
notriddle:notriddle/li

Conversation

@notriddle

@notriddlenotriddle commented Sep 9, 2022

Copy link
Copy Markdown
Contributor

This PR moves the tooltip into example-wrap, simplifying several overly-complex aspects of how these tooltips work:

  • The mousover javascript can be removed, because hovering example-wrap can style the tooltip inside.
  • The sibling selecor can be removed, because hovering the tooltip also hovers the wrapper, which can hover the codeblock itself.
  • The relative positioning of the <li> tag, which was added in e861efd to fix the positioning of the code tooltip, can now be removed, because example-wrap itself already has relative positioning.

@rustbotrustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Sep 9, 2022
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @jsha

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 9, 2022
@rust-log-analyzer

This comment has been minimized.

@notriddle
notriddleforce-pushed the notriddle/li branch 2 times, most recently from 24e1a38 to d734633CompareSeptember 9, 2022 03:12
@rust-log-analyzer

This comment has been minimized.

@notriddle

Copy link
Copy Markdown
ContributorAuthor

r? @GuillaumeGomez

@notriddle
notriddle marked this pull request as ready for review September 9, 2022 12:50
@rustbot

Copy link
Copy Markdown
Collaborator

A change occurred in the Ayu theme.

cc @Cldfire

Some changes occurred in HTML/CSS themes.

cc @GuillaumeGomez

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

@GuillaumeGomez

Copy link
Copy Markdown
Member

Please rebase. Also I was about to work on simplifying the tooltips but differently. I think this PR and mine will be complementary. Interesting how things turn up.

This commit moves the tooltip into example-wrap, simplifying allowing several
overly-complex things to be fixed:
* The mousover javascript can be removed, because hovering example-wrap can
style the tooltip inside.
* The sibling selecor can be removed, because hovering the tooltip also
hovers the wrapper, which can hover the codeblock itself.
* The relative positioning of the `<li>` tag, which was added in
e861efd to fix the positioning of the code
tooltip, can now be removed, because example-wrap itself already has
relative positioning.
@notriddle

Copy link
Copy Markdown
ContributorAuthor

@GuillaumeGomez okay, it’s rebased

@GuillaumeGomez

Copy link
Copy Markdown
Member

Looks good to me, thanks! r=me once CI pass

@GuillaumeGomez

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Sep 9, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit cbcb74e has been approved by GuillaumeGomez

It is now in the queue for this repository.

@borsbors 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 Sep 9, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 9, 2022
…llaumeGomez
Rollup of 5 pull requests
Successful merges:
- rust-lang#101475 (Use futex-based locks and thread parker on Hermit)
- rust-lang#101492 (Suggest adding array lengths to references to arrays if possible)
- rust-lang#101495 (Compile spin_loop_hint as pause on x86 even without sse2 enabled)
- rust-lang#101529 (Fix the example code and doctest for Formatter::sign_plus)
- rust-lang#101600 (rustdoc: simplify the codeblock tooltip)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 2e258ce into rust-lang:masterSep 9, 2022
@rustbotrustbot added this to the 1.65.0 milestone Sep 9, 2022
@notriddle
notriddle deleted the notriddle/li branch September 9, 2022 23:07
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Sep 10, 2022
…r=notriddle
Simplify codeblock and their associated tooltip
It is based on rust-lang#101600 so it needs to wait for this one to be merged first.
This PR does two things:
* Remove CSS class duplication by setting CSS classes such as `compile_fail` directly on the `div` wrapping both the codeblock and the tooltip.
* Simplify DOM: no need to wrap the tooltip into a `<div>`, it can work just as well without it.
You can test it [here](https://rustdoc.crud.net/imperio/codeblock-tooltip/std/string/struct.String.html#deref).
r? `@notriddle`
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 10, 2022
…notriddle
Simplify codeblock and their associated tooltip
It is based on rust-lang#101600 so it needs to wait for this one to be merged first.
This PR does two things:
* Remove CSS class duplication by setting CSS classes such as `compile_fail` directly on the `div` wrapping both the codeblock and the tooltip.
* Simplify DOM: no need to wrap the tooltip into a `<div>`, it can work just as well without it.
You can test it [here](https://rustdoc.crud.net/imperio/codeblock-tooltip/std/string/struct.String.html#deref).
r? `@notriddle`
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-rustdocRelevant 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.

7 participants

@notriddle@rust-highfive@rust-log-analyzer@rustbot@GuillaumeGomez@bors@jsha