8000 What do we define as the max line length for code blocks? · Issue #4858 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
wouterj opened this issue Jan 16, 2015 · 9 comments
Closed

What do we define as the max line length for code blocks? #4858

wouterj opened this issue Jan 16, 2015 · 9 comments
Labels
actionable Clear and specific issues ready for anyone to take them. good first issue Ideal for your first contribution! (some Symfony experience may be required)

Comments

@wouterj
Copy link
Member
wouterj commented Jan 16, 2015

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?

  • Use the 85 character rule we're using already (but did not apply to the docs)
  • Use 72 to be consistent with the text
  • Use 95, the maximum amount of characters when the site reaches its max width
  • Use somthing else

/cc @weaverryan @xabbuh

@wouterj wouterj changed the title What's the soft max line length rule for code blocks? What do we define as the max line length for code blocks? Jan 16, 2015
@javiereguiluz
Copy link
Member

We can make the code listings responsive ... but only if we remove the line numbering.

@wouterj
Copy link
Member Author
wouterj commented Jan 16, 2015

@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.

@weaverryan
Copy link
Member

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.

@weaverryan
Copy link
Member

Btw, I'm pretty happy with how the site looks on mobile - I was just playing around with it :)

@ifdattic
Copy link
Contributor

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.

@wouterj
Copy link
Member Author
wouterj commented May 3, 2015

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 (/contributing/documentation/standards)

@wouterj wouterj added good first issue Ideal for your first contribution! (some Symfony experience may be required) actionable Clear and specific issues ready for anyone to take them. labels May 3, 2015
@anacicconi
Copy link

@xabbuh
Copy link
Member
xabbuh commented May 23, 2015

Indeed, good catch @anacicconi!

@wouterj @weaverryan I suggest to just close here then. What do you think?

@weaverryan
Copy link
Member

Agreed on the standard and that the standard is documented. Thanks point @anacicconi for pointing that out - it's nice to close issues :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. good first issue Ideal for your first contribution! (some Symfony experience may be required)
Projects
None yet
Development

No branches or pull requests

6 participants
0