Skip to content
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

Don't hard-wrap Markdown documents #1240

Closed
wants to merge 1 commit into from
Closed

Don't hard-wrap Markdown documents #1240

wants to merge 1 commit into from

Conversation

wincent
Copy link
Contributor

@wincent wincent commented Jun 24, 2016

When preparing the 0.9.1 release notes in CHANGLOG.md and previewing them on GitHub, I noticed some awkward wrapping in the rendered HTML near places where I had put hard line breaks in the file. This was fixed by not wrapping the 0.9.1 chunk of the release notes.

In this commit I've gone back and unwrapped all the Markdown files where we were hard-wrapping (the vast majority already don't hardwrap).

I was too lazy to visually inspect all the files, so I identified the likely candidates with this snippet of Ruby:

Dir['docs/*'].map{|d|File.read(d).lines.max_by{|l|l.size}}.map(&:size)

Which returned a list of the longest line of all files in "docs/":

=> [518, 448, 170, 423, 310, 181, 208, 204, 269, 81, 98, 79, 80, 112, 404,
467, 557, 269, 312, 325, 391, 177, 224, 172, 339, 186, 871, 306, 767, 401,
211, 153]

The obvious candidates were the chunk in the middle with lengths 81, 98, 79, 80 and 112, corresponding to the GraphQL docs, and sure enough, they were all hard-wrapped. Unwrapped by mashing J mindlessly in Vim.

When preparing the 0.9.1 release notes in `CHANGLOG.md` and previewing them on
GitHub, I noticed some awkward wrapping in the rendered HTML near places where I
had put hard line breaks in the file. This was fixed by not wrapping the 0.9.1
chunk of the release notes.

In this commit I've gone back and unwrapped all the Markdown files where we were
hard-wrapping (the vast majority already don't hardwrap).

I was too lazy to visually inspect all the files, so I identified the likely
candidates with this snippet of Ruby:

```
Dir['docs/*'].map{|d|File.read(d).lines.max_by{|l|l.size}}.map(&:size)
```

Which returned a list of the longest line of all files in "docs/":

```
=> [518, 448, 170, 423, 310, 181, 208, 204, 269, 81, 98, 79, 80, 112, 404,
467, 557, 269, 312, 325, 391, 177, 224, 172, 339, 186, 871, 306, 767, 401,
211, 153]
```

The obvious candidates were the chunk in the middle with lengths 81, 98, 79, 80
and 112, corresponding to the GraphQL docs, and sure enough, they were all
hard-wrapped. Unwrapped by mashing `J` mindlessly in Vim.
@ghost ghost added the CLA Signed label Jun 24, 2016
@ghost ghost closed this in a3075fa Jun 24, 2016
@wincent wincent deleted the unwrap branch June 24, 2016 23:33
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant