vertx-web-site / vertx-web-site.github.io

The official Vert.x website (https://vertx.io)
https://vertx.io
Apache License 2.0
18 stars 72 forks source link

discuss line format of examples #25

Closed pmlopes closed 3 years ago

pmlopes commented 4 years ago

I'm browsing the manuals and see scrolling:

image

If we can define a safe length for the examples I can update the .editorconfig files across repo's to hint the recommended text length in the examples folders.

@michel-kraemer and @vietj it seems that 80 chars is safe on my 1920x1080 resolution, but I'm not sure if it will be lots of white space for larger ones)

What are your thoughts?

michel-kraemer commented 4 years ago

Yes, it seems 80 characters is the right number. On an HD screen, the code box already has its maximum width. On smaller screens (less than 1200 pixels wide), the scroll bars will automatically reappear of course.

michel-kraemer commented 3 years ago

@pmlopes @vietj @jponge @slinkydeveloper I'd like to bring up this discussion again. If everything is OK with the line format as it is now, we should close the issue.

jponge commented 3 years ago

Agreed

pmlopes commented 3 years ago

I think it's OK, I've added .editorconfig rules to many projects for this purpose. If anything is missing, let me know and I'll add it to the missing ones.

Basically this is the trick:

[**/examples/**.java]
# 84 looks like a odd number, however
# it accounts for 4 spaces (class and example method indentation)
max_line_length = 84

And then just do a reformat action form the IDE to fix the line length.

michel-kraemer commented 3 years ago

Great. So, can we close the issue?

jponge commented 3 years ago

Yes 😉