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
x/website: better HTML printing, don't page break inside code blocks #33933
Comments
@greywolve feel free to send a change. |
Change https://golang.org/cl/192418 mentions this issue: |
Why is breaking a page across a code block not desirable? For one thing, it's more environmentally friendly to fill every page. Also, I remember back in the day that it wasn't unheard of of copying multiple pages of books filled with qbasic code. A page break never bothered me really. Maybe we can only do this for small code blocks? |
It's not desirable (to me) because it makes reading large blocks of code more difficult. Perhaps I'm just not used to reading printed out code split across pages. :) It's annoying to have to shuffle back and forth to try read a block of code, especially if you have the pages bound and can't see the other page. Doing this for small blocks of code seems much more difficult, and perhaps not worth the effort then. You'd have to tag each small block of code throughout the entire website with a different class that you can target. Personally this change is much more about large blocks of code than smaller blocks anyway. For me, that's the 80/20. Would you be happy buying a technical book with code split across pages? I suspect most people wouldn't be. |
For larger blocks? Sure. Anyways, feel free to fly with it. Just wanted to bring up some points that possibly hadn't been considered yet. I'm not that strongly opinionated on it. |
Fixes golang/go#33933 Change-Id: Ia5b140f7cc452a9fd5e4eea4ab6fe2465d1444b4 Reviewed-on: https://go-review.googlesource.com/c/website/+/192418 Reviewed-by: Andrew Bonventre <andybons@golang.org>
I was trying to print out Effective Go and I noticed code blocks get split across pages.
This is easily fixed by amending the CSS a bit:
Before:
After:
The text was updated successfully, but these errors were encountered: