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: short descriptions cause word-breaks in tables #128023

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

Kijewski
Copy link
Contributor

The .item-table class is used to display name+description lists, e.g. the exported functions, as a table. If the names are long and the descriptions are short, then the width of the table does not expand to the whole size, but only uses a fraction. This causes a some names to break inside a word.

This change makes the table always use 100% of its parent width. The .width-limiter wrapper already ensures that the used width still does not become excessive.

See e.g. https://docs.rs/mathlab/0.3.0/mathlab/fun/vec_num/index.html or https://docs.rs/cw-events/0.0.9/cw_events/ (random choices out of the list of the recent releases).

The problem occurs (at least) in Firefox 130, Falkon 24, and Konqueror 22. It does not occur in Chrome 126.

The `.item-table` class is used to display name+description lists, e.g.
the exported functions, as a table. If the names are long and the
descriptions are short, then the width of the table does not expand to
the whole size, but only uses a fraction. This causes a some names to
break inside a word.

This change makes the table always use 100% of its parent width. The
`.width-limiter` wrapper already ensures that the used width still does
not become excessive.

Signed-off-by: René Kijewski <rene.kijewski@fu-berlin.de>
@rustbot
Copy link
Collaborator

rustbot commented Jul 21, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @notriddle (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@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 Jul 21, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jul 21, 2024

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha

@notriddle
Copy link
Contributor

Makes sense.

@bors r+

@bors
Copy link
Contributor

bors commented Jul 21, 2024

📌 Commit 9533544 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 Jul 21, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 21, 2024
rustdoc: short descriptions cause word-breaks in tables

The `.item-table` class is used to display name+description lists, e.g. the exported functions, as a table. If the names are long and the descriptions are short, then the width of the table does not expand to the whole size, but only uses a fraction. This causes a some names to break inside a word.

This change makes the table always use 100% of its parent width. The `.width-limiter` wrapper already ensures that the used width still does not become excessive.

See e.g. <https://docs.rs/mathlab/0.3.0/mathlab/fun/vec_num/index.html> or <https://docs.rs/cw-events/0.0.9/cw_events/> (random choices out of the list of the recent releases).

[![](https://i.imgur.com/XnH4eeT.png)](https://imgur.com/XnH4eeT) [![](https://i.imgur.com/7iQ9xE2.png)](https://imgur.com/7iQ9xE2)

The problem occurs (at least) in Firefox 130, Falkon 24, and Konqueror 22. It does not occur in Chrome 126.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 21, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#126450 (Promote Mac Catalyst targets to Tier 2, and ship with rustup)
 - rust-lang#127177 (Distribute rustc_codegen_cranelift for arm64 macOS)
 - rust-lang#127510 (Rewrite `test-float-parse` in Rust)
 - rust-lang#127977 (Update wasi-sdk in CI to latest release)
 - rust-lang#127985 (Migrate `test-benches`, `c-unwind-abi-catch-panic` and `compiler-lookup-paths-2` `run-make` tests to rmake)
 - rust-lang#128023 (rustdoc: short descriptions cause word-breaks in tables)

r? `@ghost`
`@rustbot` modify labels: rollup
tgross35 added a commit to tgross35/rust that referenced this pull request Jul 21, 2024
rustdoc: short descriptions cause word-breaks in tables

The `.item-table` class is used to display name+description lists, e.g. the exported functions, as a table. If the names are long and the descriptions are short, then the width of the table does not expand to the whole size, but only uses a fraction. This causes a some names to break inside a word.

This change makes the table always use 100% of its parent width. The `.width-limiter` wrapper already ensures that the used width still does not become excessive.

See e.g. <https://docs.rs/mathlab/0.3.0/mathlab/fun/vec_num/index.html> or <https://docs.rs/cw-events/0.0.9/cw_events/> (random choices out of the list of the recent releases).

[![](https://i.imgur.com/XnH4eeT.png)](https://imgur.com/XnH4eeT) [![](https://i.imgur.com/7iQ9xE2.png)](https://imgur.com/7iQ9xE2)

The problem occurs (at least) in Firefox 130, Falkon 24, and Konqueror 22. It does not occur in Chrome 126.
@GuillaumeGomez
Copy link
Member

Nice thanks! I'll add a regression test for it once merged.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 21, 2024
rustdoc: short descriptions cause word-breaks in tables

The `.item-table` class is used to display name+description lists, e.g. the exported functions, as a table. If the names are long and the descriptions are short, then the width of the table does not expand to the whole size, but only uses a fraction. This causes a some names to break inside a word.

This change makes the table always use 100% of its parent width. The `.width-limiter` wrapper already ensures that the used width still does not become excessive.

See e.g. <https://docs.rs/mathlab/0.3.0/mathlab/fun/vec_num/index.html> or <https://docs.rs/cw-events/0.0.9/cw_events/> (random choices out of the list of the recent releases).

[![](https://i.imgur.com/XnH4eeT.png)](https://imgur.com/XnH4eeT) [![](https://i.imgur.com/7iQ9xE2.png)](https://imgur.com/7iQ9xE2)

The problem occurs (at least) in Firefox 130, Falkon 24, and Konqueror 22. It does not occur in Chrome 126.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 21, 2024
…llaumeGomez

Rollup of 7 pull requests

Successful merges:

 - rust-lang#126450 (Promote Mac Catalyst targets to Tier 2, and ship with rustup)
 - rust-lang#127177 (Distribute rustc_codegen_cranelift for arm64 macOS)
 - rust-lang#127583 (Deal with invalid UTF-8 from `gai_strerror`)
 - rust-lang#127977 (Update wasi-sdk in CI to latest release)
 - rust-lang#127985 (Migrate `test-benches`, `c-unwind-abi-catch-panic` and `compiler-lookup-paths-2` `run-make` tests to rmake)
 - rust-lang#128014 (Fix stab display in doc blocks)
 - rust-lang#128023 (rustdoc: short descriptions cause word-breaks in tables)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 21, 2024
rustdoc: short descriptions cause word-breaks in tables

The `.item-table` class is used to display name+description lists, e.g. the exported functions, as a table. If the names are long and the descriptions are short, then the width of the table does not expand to the whole size, but only uses a fraction. This causes a some names to break inside a word.

This change makes the table always use 100% of its parent width. The `.width-limiter` wrapper already ensures that the used width still does not become excessive.

See e.g. <https://docs.rs/mathlab/0.3.0/mathlab/fun/vec_num/index.html> or <https://docs.rs/cw-events/0.0.9/cw_events/> (random choices out of the list of the recent releases).

[![](https://i.imgur.com/XnH4eeT.png)](https://imgur.com/XnH4eeT) [![](https://i.imgur.com/7iQ9xE2.png)](https://imgur.com/7iQ9xE2)

The problem occurs (at least) in Firefox 130, Falkon 24, and Konqueror 22. It does not occur in Chrome 126.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 21, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#127510 (Rewrite `test-float-parse` in Rust)
 - rust-lang#127583 (Deal with invalid UTF-8 from `gai_strerror`)
 - rust-lang#127977 (Update wasi-sdk in CI to latest release)
 - rust-lang#128014 (Fix stab display in doc blocks)
 - rust-lang#128020 (Just totally fully deny late-bound consts)
 - rust-lang#128023 (rustdoc: short descriptions cause word-breaks in tables)
 - rust-lang#128033 (Explain why we require `_` for empty patterns)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 21, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#127510 (Rewrite `test-float-parse` in Rust)
 - rust-lang#127583 (Deal with invalid UTF-8 from `gai_strerror`)
 - rust-lang#127977 (Update wasi-sdk in CI to latest release)
 - rust-lang#128014 (Fix stab display in doc blocks)
 - rust-lang#128020 (Just totally fully deny late-bound consts)
 - rust-lang#128023 (rustdoc: short descriptions cause word-breaks in tables)
 - rust-lang#128033 (Explain why we require `_` for empty patterns)

r? `@ghost`
`@rustbot` modify labels: rollup
@Kijewski
Copy link
Contributor Author

Nice thanks! I'll add a regression test for it once merged.

You're welcome! Can you Cc me when you do, please? I didn't know how to add such a test, and maybe I can learn and borrow the knowledge for the next PR or some other project. :)

@workingjubilee
Copy link
Member

@bors rollup=always

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 22, 2024
…kingjubilee

Rollup of 6 pull requests

Successful merges:

 - rust-lang#127583 (Deal with invalid UTF-8 from `gai_strerror`)
 - rust-lang#128014 (Fix stab display in doc blocks)
 - rust-lang#128020 (Just totally fully deny late-bound consts)
 - rust-lang#128023 (rustdoc: short descriptions cause word-breaks in tables)
 - rust-lang#128033 (Explain why we require `_` for empty patterns)
 - rust-lang#128038 (Don't output incremental test artifacts into working directory)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b9c9f07 into rust-lang:master Jul 22, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Jul 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 22, 2024
Rollup merge of rust-lang#128023 - Kijewski:pr-table-width, r=notriddle

rustdoc: short descriptions cause word-breaks in tables

The `.item-table` class is used to display name+description lists, e.g. the exported functions, as a table. If the names are long and the descriptions are short, then the width of the table does not expand to the whole size, but only uses a fraction. This causes a some names to break inside a word.

This change makes the table always use 100% of its parent width. The `.width-limiter` wrapper already ensures that the used width still does not become excessive.

See e.g. <https://docs.rs/mathlab/0.3.0/mathlab/fun/vec_num/index.html> or <https://docs.rs/cw-events/0.0.9/cw_events/> (random choices out of the list of the recent releases).

[![](https://i.imgur.com/XnH4eeT.png)](https://imgur.com/XnH4eeT) [![](https://i.imgur.com/7iQ9xE2.png)](https://imgur.com/7iQ9xE2)

The problem occurs (at least) in Firefox 130, Falkon 24, and Konqueror 22. It does not occur in Chrome 126.
@Kijewski Kijewski deleted the pr-table-width branch July 22, 2024 09:15
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 22, 2024
tgross35 added a commit to tgross35/rust that referenced this pull request Jul 22, 2024
…notriddle

Add regression test for items list size (rust-lang#128023)

Add missing regression test for rust-lang#128023.

cc `@Kijewski` (if you want more information about the framework used, documentation is available [here](https://github.com/GuillaumeGomez/browser-UI-test/blob/master/goml-script.md)).

r? `@notriddle`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 22, 2024
Rollup of 9 pull requests

Successful merges:

 - rust-lang#117932 (Correct rustdoc section where we talk about rustdoc emitting errors on invalid code)
 - rust-lang#125990 (Rename `deprecated_safe` lint to `deprecated_safe_2024`)
 - rust-lang#127506 (rustc_target: add known safe s390x target features)
 - rust-lang#127820 (Rewrite and rename `issue-14698`. `issue-33329` and `issue-107094` `run-make` tests to rmake or ui)
 - rust-lang#127923 (Use reuse tool 4.0)
 - rust-lang#128008 (Start using `#[diagnostic::do_not_recommend]` in the standard library)
 - rust-lang#128036 (add more tests)
 - rust-lang#128051 (rustdoc: revert spacing change in item-table)
 - rust-lang#128059 (Add regression test for items list size (rust-lang#128023))

r? `@ghost`
`@rustbot` modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 22, 2024
Rollup merge of rust-lang#128059 - GuillaumeGomez:test-for-128023, r=notriddle

Add regression test for items list size (rust-lang#128023)

Add missing regression test for rust-lang#128023.

cc `@Kijewski` (if you want more information about the framework used, documentation is available [here](https://github.com/GuillaumeGomez/browser-UI-test/blob/master/goml-script.md)).

r? `@notriddle`
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.

6 participants