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

Fix ascii art text wrapping in mobile #81558

Merged
merged 2 commits into from
Jan 31, 2021
Merged

Fix ascii art text wrapping in mobile #81558

merged 2 commits into from
Jan 31, 2021

Conversation

pickfire
Copy link
Contributor

@pickfire pickfire commented Jan 30, 2021

Fix #81377

Before

image
image
image

After

image
image
image

Note the second image is scrolled to the back (right), I added some padding for the text block (not the code block) to make it more comfortable to read since the last character is stuck to the last character.

@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez

@rust-highfive
Copy link
Collaborator

r? @GuillaumeGomez

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 30, 2021
@GuillaumeGomez
Copy link
Member

Can you check it doesn't break #59973 please?

@pickfire
Copy link
Contributor Author

@GuillaumeGomez I have added screenshots for larger devices.

I am not quite sure how to test that on nom.

@GuillaumeGomez
Copy link
Member

You have the full explanations in the thread. If you're talking about testing the style, you can simply build nom documentation locally and update the css when on the page. :)

@pickfire
Copy link
Contributor Author

Ah, it did break a bit on docblock-short where whitespaces at the end is missing. I will just add it back for that part.

image

@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Jan 30, 2021

📌 Commit 6d7ef10 has been approved by GuillaumeGomez

@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 30, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 31, 2021
…as-schievink

Rollup of 18 pull requests

Successful merges:

 - rust-lang#78044 (Implement io::Seek for io::Empty)
 - rust-lang#79285 (Stabilize Arc::{increment,decrement}_strong_count)
 - rust-lang#80053 (stabilise `cargo test -- --include-ignored`)
 - rust-lang#80279 (Implement missing `AsMut<str>` for `str`)
 - rust-lang#80470 (Stabilize by-value `[T; N]` iterator `core::array::IntoIter`)
 - rust-lang#80945 (Add Box::downcast() for dyn Any + Send + Sync)
 - rust-lang#81048 (Stabilize `core::slice::fill_with`)
 - rust-lang#81198 (Remove requirement that forces symmetric and transitive PartialEq impls to exist)
 - rust-lang#81422 (Account for existing `_` field pattern when suggesting `..`)
 - rust-lang#81472 (Clone entire `TokenCursor` when collecting tokens)
 - rust-lang#81484 (Optimize decimal formatting of 128-bit integers)
 - rust-lang#81491 (Balance sidebar `Deref` cycle check with main content)
 - rust-lang#81509 (Add a regression test for ICE of bad_placeholder_type)
 - rust-lang#81547 (Edit rustc_typeck top-level docs)
 - rust-lang#81550 (Replace predecessor with range in collections documentation)
 - rust-lang#81558 (Fix ascii art text wrapping in mobile)
 - rust-lang#81562 (Clarify that InPlaceIterable guarantees extend to all advancing iterator methods.)
 - rust-lang#81563 (Improve docblock readability on small screen)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 45d24c7 into rust-lang:master Jan 31, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 31, 2021
@pickfire pickfire deleted the patch-5 branch January 31, 2021 08:15
@mgeisler
Copy link
Contributor

Hi all,

This change made whitespace collapse in all code elements on the page, including the ones generated by inline backticks. In other words, you can no longer distinguish between

foo `"   bar   "` baz

and

foo `" bar "` baz

This is a regression from older version and it makes it hard to talk about Rust strings with leading and trailing whitespace :-)

Could we put back a white-space: pre-wrap rule for the code elements? Perhaps we could override the style specifically for code inside pre to still allow proper horizontal scrolling?

@pickfire
Copy link
Contributor Author

pickfire commented Mar 26, 2021

@mgeisler Do you need the .docblock code to have white-space: pre-wrap? In this case, .docblock-short code still have it but .docblock code which affects the mobile does not have it.

Maybe we could add something like :not(pre) .docblock code (I don't think this is valid).

@GuillaumeGomez
Copy link
Member

@mgeier Could you open an issue please so it can be taken care of quickly?

@mgeisler
Copy link
Contributor

Thanks @pickfire for the potential work around, I'm not 100% sure of the best solution since I haven't looked deeply into the rustdoc stylesheet.

Thanks @GuillaumeGomez for the suggestion of a new issue. I just opened #83550 to track it.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc wrap code block
6 participants