apiaryio / api-blueprint

API Blueprint
https://apiblueprint.org
MIT License
8.64k stars 2.14k forks source link

Wrap lines, use semantic linebreaks #324

Closed jean closed 8 years ago

jean commented 8 years ago

I noticed that the ### Create a New Question [POST] example rendered in a box with horisontal scrollbar, with most of the description scrolling off to the right.

When going to fix this, I noticed that descriptive text wasn't wrapped. Wrap lines, it's more suited to a plaintext format like markdown.

Semantic linebreaks: http://rhodesmill.org/brandon/2012/one-sentence-per-line/

pksunkara commented 8 years ago

Can you please squash this into a single commit?

jean commented 8 years ago

I'll do so and let you know :-) I'm going through the spec now.

pksunkara commented 8 years ago

@jean Actually, after giving it a thought, I realised we don't need to wrap everything. Can you only wrap the examples which are nested in code blocks? And don't do the semantic line breaks. Just wrapping them is enough.

jean commented 8 years ago

@pksunkara well, I realise it's to some extent a matter of preference. For rendering, paragraphs don't need to be wrapped. But markdown uses a double-linebreak as paragraph separator so that paragraphs can be wrapped. As Gruber writes:

Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.

For me, this includes wrapping lines. A lot of source code, such as C or javascript, doesn't need wrapping either. But yet we do, for readability and better diffs.

Here's a markdown style guide that raises the same points (both pro and con): http://www.cirosantilli.com/markdown-style-guide/#line-wrapping

So with my pull request, I'd like to advocate for wrapping the markdown source at around 80 characters.

pksunkara commented 8 years ago

@jean I understand. But can we wrap the examples first in this PR? You can make another PR to wrap all other markdown.

PS: No semantic line breaks though.

jean commented 8 years ago

@pksunkara OK! I'll prepare a new PR.

jean commented 8 years ago

@pksunkara this PR now only wraps descriptions in examples.

pksunkara commented 8 years ago

Thanks for the PR! 😄

jean commented 8 years ago

Thanks for the tools :)