-
Notifications
You must be signed in to change notification settings - Fork 321
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
Outputs now being wrapped to the page width / Allow horizontal scrolling #1940
Comments
Another drawback I've just noticed: the 1.6.1 output is responsive, while the 2.0 output is not (or at least is responsive in a different way). See new vs old behaviour to narrower pages here. these are both rendered with the default console width of 80 The old behaviour preserves the console output width even if the page is narrowed by allowing horizontal scrolling, the new behaviour does not and hard wraps it. If the justification for this change is to reproduce the RStudio console output the old behaviour does a much better job at different browser sizes. |
This was a deliberate choice. I'll leave this issue open to see if other people also prefer the old design. |
I understand the difference between the old and new appearance. I made the change because a number of people complained about the scrolling, so what I need to figure out is whether the majority of people prefer scrolling or wrapping. |
Apologies. I included a lengthy description of the implications because I could find no discussion of it at all, except for here where it seemed more of a philosophical decision. Hopefully those who disliked the scrolling can now understand why others might prefer it. Maybe it could be made a global yaml option under |
@nicholascarey and others, if you'd like to enable horizontal scrolling of the code boxes, you can add the following CSS rule to pre, pre code {
white-space: pre;
padding-right: 1rem;
} If you want to limit horizontal scrolling to small screens only, you can put the above rule inside a media query, as in: @media (max-width: 575.98px) {
pre, pre code {
white-space: pre;
padding-right: 1rem;
}
} FWIW, I also prefer horizontal scrolling in code boxes. I end up reading a lot of code and documentation on my phone and find it's easier to parse the code and output when the lines aren't wrapped. |
Thanks @gadenbuie. I did play with using custom css I found elsewhere online but was not able to get it to work, I guess because it was a general However, this didn't work for me (it was still wrapping) until i combined it with some other options:
And now it's back to a scrollable box. |
After living this for a while, I now agree that the wrapping is a regression and we should go back to scrolling. |
See also tidyverse/tidytemplate#71 |
Hi.
I just updated to 2.0.
Previously if the output was wider than the page, it rendered as a horizontally scrollable box. As here:
https://imgur.com/a/pk64h1v
In v2.0 this is no longer the case and the output is wrapped at the width of the page:
I have R.options
width = 10000
in my setup chunk which previously allowed for this scrollable output, but this no longer works. Setting chunk-specificwidth
options doesn't seem to work, and I haven't been able to find any otherknitr
chunk options that might return this behaviour. Is it a bug or a deliberate change?The default console width of 80 doesn't look terrible:
But this is only one example of many and for the purposes of my vignettes i'd really prefer this behaviour instead. Would be nice to have back if possible.
The text was updated successfully, but these errors were encountered: