-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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: word wrap CamelCase in the item list table and sidebar #126247
rustdoc: word wrap CamelCase in the item list table and sidebar #126247
Conversation
Some changes occurred in src/tools/compiletest cc @jieyouxu These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
I'm not a big fan to this approach. Limiting the width of the item name seems better don't you think? |
I remember awhile back that @fmease proposed experimenting with wbr to produce “more legible output” The legibility comes from not having line breaks in the middle of words. For example, if the width limit were ten characters, it’s the difference between:
vs
I suppose that adding a hard width limit doesn’t preclude doing this, so it might be worth doing this experiment anyway. |
Fair enough. 👍 |
Wouldn't the |
That's correct, @BradMarr. |
06ce2e0
to
b7f202a
Compare
Some changes occurred in GUI tests. |
b7f202a
to
a32cb15
Compare
This comment has been minimized.
This comment has been minimized.
e277d8e
to
25d4152
Compare
@bors r=GuillaumeGomez |
This comment has been minimized.
This comment has been minimized.
25d4152
to
85b1ddb
Compare
This comment has been minimized.
This comment has been minimized.
This also improves sidebar layout, so instead of BTreeM ap you get this BTree Map
85b1ddb
to
ac303df
Compare
@bors r=GuillaumeGomez |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#126247 (rustdoc: word wrap CamelCase in the item list table and sidebar) - rust-lang#128104 (Not lint pub structs without pub constructors intentionally) - rust-lang#128153 (Stop using `MoveDataParamEnv` for places that don't need a param-env) - rust-lang#128284 (Stabilize offset_of_nested) - rust-lang#128342 (simplify the use of `CiEnv`) - rust-lang#128355 (triagebot: make sure Nora is called Nora) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#126247 - notriddle:notriddle/word-wrap-item-table, r=GuillaumeGomez rustdoc: word wrap CamelCase in the item list table and sidebar This is an alternative to rust-lang#126209. That is, it fixes the issue that affects the very long type names in https://docs.rs/async-stripe/0.31.0/stripe/index.html#structs. This is, necessarily, a pile of nasty heuristics. We need to balance a few issues: - Sometimes, there's no real word break. For example, `BTreeMap` should be `BTree<wbr>Map`, not `B<wbr>Tree<wbr>Map`. - Sometimes, there's a legit word break, but the name is tiny and the HTML overhead isn't worth it. For example, if we're typesetting `TyCtx`, writing `Ty<wbr>Ctx` would have an HTML overhead of 50%. Line breaking inside it makes no sense. # Screenshots | Before | After | | ------ | ----- | | ![image](https://github.com/rust-lang/rust/assets/1593513/d51201fd-46c0-4f48-aee6-a477eadba288) | ![image](https://github.com/rust-lang/rust/assets/1593513/d8e77582-adcf-4966-bbfd-19dfdad7336a)
This is an alternative to #126209. That is, it fixes the issue that affects the very long type names in https://docs.rs/async-stripe/0.31.0/stripe/index.html#structs.
This is, necessarily, a pile of nasty heuristics. We need to balance a few issues:
Sometimes, there's no real word break. For example,
BTreeMap
should beBTree<wbr>Map
, notB<wbr>Tree<wbr>Map
.Sometimes, there's a legit word break, but the name is tiny and the HTML overhead isn't worth it. For example, if we're typesetting
TyCtx
, writingTy<wbr>Ctx
would have an HTML overhead of 50%. Line breaking inside it makes no sense.Screenshots