rustdoc: word wrap CamelCase in the item list table and sidebar#126247
rustdoc: word wrap CamelCase in the item list table and sidebar#126247bors merged 7 commits intorust-lang:masterfrom
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.
…-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 | | ------ | ----- | |  | 
|
@bors r- needs refmt |
This is an alternative to ee6459d. 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.
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
|
@bors r=GuillaumeGomez |
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,
BTreeMapshould 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>Ctxwould have an HTML overhead of 50%. Line breaking inside it makes no sense.Screenshots