-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Fix code block line length #36773
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
Conversation
How are you running this, with https://github.com/asottile/blacken-docs ? If so, should it be added as an extra hook? |
This part I did manually, but yeah I've used blacken-docs for a lot of this cleanup. I don't think we'd be able to add it as a hook yet because it raises tons of errors at the moment due to unparsable code blocks (e.g., raw output and magic commands, #36734 (comment)). If we want to do this in general I think it probably warrants some kind of issue to encourage contributions from others as there's a lot of "manual labor" involved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
So IIUC we are changing this because it doesn't fit in the web page? Can we not edit the web page to better accommodate rather than changing this though? I think should keep consistent between our docs and internal code base |
Would changing the site be hard (I wouldn't know how to do that)? In general I think @jorisvandenbossche point makes sense of preferring not having to scroll over strict adherence to all internal style guidelines. I think the main thing is avoiding the older line-wrapping behavior which makes the docs harder to read IMO. |
I guess I don't really understand how setting this to 84 instead of 88 should impact the scrolling universally. Word wrapping should be controlled by the styling of the site, no? |
Code blocks don't get automatic word wrapping in html (as I think it should be?), as opposed to normal flowing text. So on my screen and with the current dev docs (this might of course depend on laptop, browser, OS, ..), the code blocks on a normal doc page have a width that fits 94 characters (eg here is an overflow (because of bad repr of categorical/interval index): https://pandas.pydata.org/docs/dev/user_guide/basics.html#discretization-and-quantiling, so you can check how many characters fit on screen). It's certainly possible to change the width of site (although there are also reasons to not make it too wide, like readability), but that's something we should then change first, IMO, as a user should simply never see hidden input code in the examples. |
thanks @dsaxton |
#36734 (comment)