-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[rustdoc] Add new setting to wrap source code lines when too long #136991
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #137001) made this pull request unmergeable. Please resolve the merge conflicts. |
6979214
to
b467e9d
Compare
This comment has been minimized.
This comment has been minimized.
b467e9d
to
38b5bfc
Compare
Fixed TS errors. :) |
Good choice... ... we need to redesign the settings popover. That list of checkboxes is a wall. It could just be adding a line between them to divide the panel into sections with an implied theme, or maybe splitting it into tabs. |
I think it should be part of a UI discussion first. I think I prefer the second approach though. Please open an issue so it can be discussed separately. |
Thanks! Anything else to be done here? |
The setting should probably be called "Word wrap source code". Why "word wrap"?The phrase "word wrap" is what almost everybody calls the feature:
Almost, because here's a few that call it something else, but no usage seems dominant other than "word wrap."
I also checked Apple TextEdit, but couldn't find a way to turn word wrapping off. Why "source code?"Wiktionary describes source code as uncountable, and the Jargon File also describes code as a mass noun (these are synonyms). I checked several other dictionaries, but Collaborative International Dictionary of English butter and Merriam-Webster butter don't mention that it's a mass noun anywhere, even though I know it is. I considered calling it "code examples," but this setting also changes how crate code pages are typeset, so probably not. |
Sounds good to me, updating the name. |
Done! |
This comment has been minimized.
This comment has been minimized.
@rfcbot poll |
Team member @notriddle has asked teams: T-rustdoc-frontend, for consensus on: |
b475f53
to
a1471f3
Compare
Sorry, I missed this poll. Seems reasonable to me. A little unfortunate how much CSS needs to be changed for this, but that's just an implementation concern. |
Poll now has majority so let's r+ it. @bors r=notriddle rollup |
…triddle [rustdoc] Add new setting to wrap source code lines when too long Fixes rust-lang#127334. Wrapped lines look like this:  It works in both source code pages and doc pages. You can test it [here](https://rustdoc.crud.net/imperio/code-wrapping/bar/index.html). r? `@notriddle`
Rollup of 9 pull requests Successful merges: - rust-lang#131282 (std: detect stack overflows in TLS destructors on UNIX) - rust-lang#136610 (Allow `IndexSlice` to be indexed by ranges.) - rust-lang#136991 ([rustdoc] Add new setting to wrap source code lines when too long) - rust-lang#137393 (Stabilize `unbounded_shifts`) - rust-lang#137482 (Windows: use existing wrappers in `File::open_native`) - rust-lang#137484 (Fix documentation for unstable sort on slice) - rust-lang#137491 (Tighten `str-to-string-128690.rs``CHECK{,-NOT}`s to make it less likely to incorrectly fail with symbol name mangling) - rust-lang#137495 (Added into_value function to ControlFlow<T, T>) - rust-lang#137501 (Move `impl` blocks out of `rustc_middle/src/mir/syntax.rs`) Failed merges: - rust-lang#137489 (remove `#[rustc_intrinsic_must_be_overridde]`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 10 pull requests Successful merges: - rust-lang#136610 (Allow `IndexSlice` to be indexed by ranges.) - rust-lang#136991 ([rustdoc] Add new setting to wrap source code lines when too long) - rust-lang#137061 (Unstable `gen_future` Feature Tracking ) - rust-lang#137393 (Stabilize `unbounded_shifts`) - rust-lang#137482 (Windows: use existing wrappers in `File::open_native`) - rust-lang#137484 (Fix documentation for unstable sort on slice) - rust-lang#137491 (Tighten `str-to-string-128690.rs``CHECK{,-NOT}`s to make it less likely to incorrectly fail with symbol name mangling) - rust-lang#137495 (Added into_value function to ControlFlow<T, T>) - rust-lang#137501 (Move `impl` blocks out of `rustc_middle/src/mir/syntax.rs`) - rust-lang#137505 (Add a span to `CompilerBuiltinsCannotCall`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136991 - GuillaumeGomez:code-wrapping, r=notriddle [rustdoc] Add new setting to wrap source code lines when too long Fixes rust-lang#127334. Wrapped lines look like this:  It works in both source code pages and doc pages. You can test it [here](https://rustdoc.crud.net/imperio/code-wrapping/bar/index.html). r? ``@notriddle``
Fixes #127334.
Wrapped lines look like this:
It works in both source code pages and doc pages.
You can test it here.
r? @notriddle