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

Remove extra whitespace from rustdoc breadcrumbs for copypasting #135946

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

kornelski
Copy link
Contributor

@kornelski kornelski commented Jan 23, 2025

The docs header used to display item names with their full path, but a recent design change has split the path and added extra styling to it.

The problem is the new styling affects how this text is copied to clipboard. I used to copy and paste the paths into use statements in the code, but the new styling has extra formatting and whitespace that makes copied text unusable in Rust source code.

Instead of:

std::os::unix::ffi::OsStrExt

I now get:

std
::
os
::
unix
::
ffi
Trait OsStrExt

This change removes extra whitespace from the markup, and removes display: flex. Paths (now in small text) are unlikely to be that long to wrap, and even then regular text wrapping should be sufficient.

@rustbot
Copy link
Collaborator

rustbot commented Jan 23, 2025

r? @notriddle

rustbot has assigned @notriddle.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 23, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 23, 2025

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha

@GuillaumeGomez
Copy link
Member

cc @notriddle

@kornelski kornelski force-pushed the rustdoc-path-space branch 2 times, most recently from a276a41 to cd324ec Compare January 25, 2025 02:53
@notriddle
Copy link
Contributor

Yep, that works.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 26, 2025

📌 Commit 1d97a3e has been approved by notriddle

It is now in the queue for this repository.

@bors bors 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 Jan 26, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Jan 26, 2025
…triddle

Remove extra whitespace from rustdoc breadcrumbs for copypasting

The docs header used to display [item names with their full path](https://doc.rust-lang.org/1.82.0/std/os/unix/ffi/trait.OsStrExt.html), but a [recent design change](https://doc.rust-lang.org/1.83.0/std/os/unix/ffi/trait.OsStrExt.html) has split the path and added extra styling to it.

The problem is the new styling affects how this text is copied to clipboard. I used to copy and paste the paths into `use` statements in the code, but the new styling has extra formatting and whitespace that makes copied text unusable in Rust source code.

Instead of:

>  std::os::unix::ffi::OsStrExt

I now get:

> std
> ::
> os
> ::
> unix
> ::
> ffi
> Trait OsStrExt

This change removes extra whitespace from the markup, and removes `display: flex`. Paths (now in small text) are unlikely to be that long to wrap, and even then regular text wrapping should be sufficient.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 26, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#133631 (Support QNX 7.1 with `io-sock`+libstd and QNX 8.0 (`no_std` only))
 - rust-lang#134358 (compiler: Set `target_abi = "ilp32e"` on all riscv32e targets)
 - rust-lang#135764 (Fix tests on LLVM 20)
 - rust-lang#135812 (Fix GDB `OsString` provider on Windows )
 - rust-lang#135842 (TRPL: more backward-compatible Edition changes)
 - rust-lang#135946 (Remove extra whitespace from rustdoc breadcrumbs for copypasting)
 - rust-lang#135953 (ci.py: check the return code in `run-local`)
 - rust-lang#136019 (Add an `unchecked_div` alias to the `Div<NonZero<_>>` impls)

Failed merges:

 - rust-lang#136037 (Mark all NuttX targets as tier 3 target and support the standard library)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 26, 2025
Rollup of 7 pull requests

Successful merges:

 - rust-lang#133631 (Support QNX 7.1 with `io-sock`+libstd and QNX 8.0 (`no_std` only))
 - rust-lang#134358 (compiler: Set `target_abi = "ilp32e"` on all riscv32e targets)
 - rust-lang#135812 (Fix GDB `OsString` provider on Windows )
 - rust-lang#135842 (TRPL: more backward-compatible Edition changes)
 - rust-lang#135946 (Remove extra whitespace from rustdoc breadcrumbs for copypasting)
 - rust-lang#135953 (ci.py: check the return code in `run-local`)
 - rust-lang#136019 (Add an `unchecked_div` alias to the `Div<NonZero<_>>` impls)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a70b0d5 into rust-lang:master Jan 26, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 26, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 26, 2025
Rollup merge of rust-lang#135946 - kornelski:rustdoc-path-space, r=notriddle

Remove extra whitespace from rustdoc breadcrumbs for copypasting

The docs header used to display [item names with their full path](https://doc.rust-lang.org/1.82.0/std/os/unix/ffi/trait.OsStrExt.html), but a [recent design change](https://doc.rust-lang.org/1.83.0/std/os/unix/ffi/trait.OsStrExt.html) has split the path and added extra styling to it.

The problem is the new styling affects how this text is copied to clipboard. I used to copy and paste the paths into `use` statements in the code, but the new styling has extra formatting and whitespace that makes copied text unusable in Rust source code.

Instead of:

>  std::os::unix::ffi::OsStrExt

I now get:

> std
> ::
> os
> ::
> unix
> ::
> ffi
> Trait OsStrExt

This change removes extra whitespace from the markup, and removes `display: flex`. Paths (now in small text) are unlikely to be that long to wrap, and even then regular text wrapping should be sufficient.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants