-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
What do we define as the max line length for code blocks? #4858
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
Comments
We can make the code listings responsive ... but only if we remove the line numbering. |
@javiereguiluz I think you didn't understand me. The problem is that the width of the code block is no longer static, but variable (until a certain max-width). This means there is no way we can fully promise our "no horizontal scrollbars" statement. Now, we have to define until what length we're going to support this. |
Hmm, I'm not sure :). Sure, I want to keep things from being too long (just like we do in real coding), but sometimes I don't care. For example, I'm not too concerned if a long XML namespace declaration goes long. But if I had to choose, I'd say we keep things under 85 - but not worry about some less-important edge-cases. On average then, since we'd be keeping things under 85, that would probably make most long lines be 80 or less. |
Btw, I'm pretty happy with how the site looks on mobile - I was just playing around with it :) |
I personally have my editor set up to display two vertical lines at 80 and another at 120 symbols. From that I noticed 80 looks about the right choice. With code blocks being intended by 4 symbols the 80 line about where you reach the right side of the code block. |
I think we can agree that there is a not-so-strict line length of 85 characters for code blocks. Someone has to add this to the documentation standards ( |
It's already defined on line 60 of https://github.com/symfony/symfony-docs/edit/2.7/contributing/documentation/standards.rst |
Indeed, good catch @anacicconi! @wouterj @weaverryan I suggest to just close here then. What do you think? |
Agreed on the standard and that the standard is documented. Thanks point @anacicconi for pointing that out - it's nice to close issues :) |
See #4778 (comment)
Since the website is now response, code blocks have no longer a fixed width and avoiding horizontal scrollbars isn't possible at any time. What should we keep as max line length rule for code blocks?
/cc @weaverryan @xabbuh
The text was updated successfully, but these errors were encountered: