freedomofpress / encryption-works

Encryption Works: How to Protect Your Privacy in the Age of NSA Surveillance
https://freedom.press/training/
Other
354 stars 58 forks source link

Line wrapping #226

Open garrettr opened 8 years ago

garrettr commented 8 years ago

I think we should wrap all the lines in the markdown source of Encryption Works at a reasonable length, e.g. 80 characters. Reasons:

  1. This is a common convention
  2. Aids readability of the Markdown source
  3. Makes diffs easier to read
  4. Makes pull requests easier to review (see https://github.com/freedomofpress/encryption-works/pull/225#discussion_r45834393)

If we do this, we should also document the preferred line length convention in CONTRIBUTING.md.

Follow up from https://github.com/freedomofpress/encryption-works/pull/225#issuecomment-159640371.

rileyjshaw commented 8 years ago

We might want to set the length cap a bit higher than 80 characters, since not everything in Markdown can handle hard-wraps. Headers don't wrap, for example, and the following line:

## A Guide to Protecting Your Privacy for Journalists, Sources, and Everyone Else

is 81 characters.

rileyjshaw commented 8 years ago

...after the line length passes a certain point, GitHub doesn't highlight word changes within the file...

Probably worth experimenting a bit to see what that "certain point" actually is before we settle on a number. I can't find anything about it in cursory searches.

garrettr commented 8 years ago

@rileyjshaw I actually emailed them about this a while back and they gave me a concrete max length. I'll have to look it up though, I think it's hiding in my inbox somewhere.

garrettr commented 8 years ago

Also, I wonder if Github Flavored Markdown might complicate matters a bit, because it handles newlines differently:

The biggest difference with writing on GitHub is the way we handle linebreaks. With Markdown, you can hard wrap paragraphs of text to have them combine into a single paragraph. We find this causes a huge number of unintentional formatting errors. In comments, GitHub treats newlines in paragraph-like content as real line breaks, which is usually what you intended.

Source

This might lead to confusing discrepancies between the Markdown as rendered on Github and the Markdown as rendered by other tools (e.g. markdown, pandoc, etc.)

rileyjshaw commented 8 years ago

Oh good catch!

I can't actually repro the described wrapping behaviour in GitHub's Markdown editor for encryption_works.md. Here's what I get for the Roses are red... example:

screen shot 2015-11-25 at 10 55 47 am screen shot 2015-11-25 at 10 56 01 am
rileyjshaw commented 8 years ago

Hmm, I just re-read the GitHub docs.

It appears that they only treat comments differently, which this comment confirms :)

screen shot 2015-11-30 at 3 11 32 pm

rileyjshaw commented 8 years ago

On second thought, it probably makes sense to just wrap at 80 chars and leave hard-wrapping elements (eg. headers) alone. Thoughts on that @garrettr?