Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

Begin style guide: Document conventions #633

Merged
merged 1 commit into from Dec 22, 2015

Conversation

joshix
Copy link
Contributor

@joshix joshix commented Oct 21, 2015

Add a style/ directory.
Add STYLE.md guide to conventions and standards. Beginning with headings.

Addresses https://github.com/coreos-inc/coreos-pages/issues/324

@@ -0,0 +1,30 @@
# Headings in CoreOS Documentation
`# Headings in CoreOS Documentation`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure what to make of this at first. Maybe we have an example that uses the headings in the doc as an example and it looks something like:

For example, this document's headings are structured in code as:

# Headings in CoreOS Documentation

## Documentation Format

### Subheadings

#### Subheadings and the Sidebar Outline

### Example: *The "Average" Document*

@robszumski
Copy link
Member

Should we go ahead and make the whole styleguide one document, ie styleguide.md and keep it in the root dir, like the license, etc?

As much as I hate to suggest this, maybe do all caps like the rest, ie STYLEGUIDE.md

@robszumski
Copy link
Member

We can always break it apart later if needed

The site deployment process inspects a document's headings to derive the thumb-index outlines seen in the right sidebar of documentation viewed at [CoreOS.com](https://coreos.com/docs/).

### Example: *The "Average" Document*
`### Example: "The Average Document"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inconsistent with the preceding line

@jonboulle
Copy link
Contributor

Perhaps not in this PR but would love to address the wrapping issue raised in rkt/rkt#1648. Generally speaking, we've tried to stick to a "one sentence per line" policy in markdown documentation because it makes it much easier to review diffs on GitHub.

@robszumski
Copy link
Member

@jonboulle I break this rule all over the place, so we should try to figure out a rule around that.

@jonboulle
Copy link
Contributor

dragging in @philips ...

@joshix
Copy link
Contributor Author

joshix commented Oct 21, 2015

@robszumski Re: file names/directory anticipation: I'm so much in the undecided column that I started on two previous drafts with the file name styleguide.md, then STYLEGUIDE.md in observance of observed local custom. However I moved it into a directory because then each file beneath style/ may have a shorter name and this particular iteration can omit an introduction explaining it is not in fact the Style Guide, etc. This to explain my thinking, rather than argue with urgency for either side.

I had thought about some more-developed later version living in a file named coreos/docs/CONTRIBUTING.md, superseding this PR, following the model of, and linked to from within, existing code contribution guidelines like https://github.com/coreos/etcd/blob/master/CONTRIBUTING.md.

@joshix joshix self-assigned this Oct 21, 2015
@joshix
Copy link
Contributor Author

joshix commented Oct 21, 2015

@jonboulle So the source for markdown would look like:

# Markdown line breaks

This is a sample document showing the proposed one-sentence-per-line formatting convention.
This second sentence continues the same paragraph.

This third sentence begins a second paragraph.

## Second heading

This sentence is short.
This sentence is longer.
This sentence is longest.

This sentence is lonely.

Renders as:

Markdown line breaks

This is a sample document showing the proposed one-sentence-per-line formatting convention.
This second sentence continues the same paragraph.

This third sentence begins a second paragraph.

Second heading

This sentence is short.
This sentence is longer.
This sentence is longest.

This sentence is lonely.

Other renderers ignore the single-LF and join lines so separated into paragraphs, but the github renderer seems to obey rather than ignore them.

@jonboulle
Copy link
Contributor

I'm confused. We do this successfully elsewhere. Let me look when in front
of keyboard again.
On Oct 21, 2015 13:38, "Josh Wood" notifications@github.com wrote:

@jonboulle https://github.com/jonboulle So the source for markdown
would look like:

Markdown line breaks

This is a sample document showing the proposed one-sentence-per-line formatting convention.
This second sentence continues the same paragraph.

This third sentence begins a second paragraph.

Second heading

This sentence is short.
This sentence is longer.
This sentence is longest.

This sentence is lonely.

Renders as:
Markdown line breaks

This is a sample document showing the proposed one-sentence-per-line
formatting convention.
This second sentence continues the same paragraph.

This third sentence begins a second paragraph.
Second heading

This sentence is short.
This sentence is longer.
This sentence is longest.

This sentence is lonely.

Other renderers ignore the single-LF and join lines so separated into
paragraphs, but the github renderer seems to obey rather than ignore them.


Reply to this email directly or view it on GitHub
#633 (comment).

@joshix
Copy link
Contributor Author

joshix commented Oct 21, 2015

I think the github md interpreter gives different output here in a comments chain vs on displaying a source file, e.g., coreos/docs/README.md. That file when experimentally adjusted toward one-sentence-per-file-line displays as expected, with single LF usually just consumed and ignored. See joshix@81debe7

One-sentence-per-line:

Pro:

  • Definitely easier to diff and review.

Con:

  • More tedious to write
  • More tedious to read as source and/or in terminal
  • Does not address 80-char width also discussed in related issue(s)

@jonboulle
Copy link
Contributor

I'm still in favour of optimising for diff reviews, and am not really concerned about the tediousness of writing it.
Crazy compromise: 80-char width but new sentence always means newline?!

@crawford
Copy link
Contributor

crawford commented Nov 2, 2015

I don't really like the idea of imposing this restriction on all teams just because some most teams use poor tooling to review diffs (read GitHub (which still blows my mind)). I'm in favor of an 80-char limit (without the proposed line break) since I get work done in a terminal and that is where the docs need to be readable.

@joshix joshix force-pushed the styledir-hdings branch 2 times, most recently from 5f1956f to 0f47628 Compare November 5, 2015 01:59
@jonboulle
Copy link
Contributor

@joshix care to make an executive decision on this one?

@joshix
Copy link
Contributor Author

joshix commented Nov 18, 2015

Sure. Let me hang the exit sign on the bikeshed door:

  1. One-sentence-per-line: Nice idea. But formatting concerns begin to tread on the ideas the reader is trying to understand, the writer is trying to communicate. The text becomes fussy and stops looking like paragraphs when read in markdown source form. The value added in reviewing is, to me, minimal. Write natural english sentences and paragraphs, not one-sentence-per-line.
  2. Character per line limit: Obey projects' 80-char per line rule. URLs and other literal formations can break this rule for a line or two. Use common sense, but generally wrap your lines at around char 80 unless the wrapping newline breaks the output from the presentation layer.

I intend to write as much into the CONTRIBUTING guide and update this PR, unless anyone thinks I should be set on fire instead.

Cf. https://github.com/google/styleguide/blob/gh-pages/docguide/style.md#character-line-limit

@jonboulle
Copy link
Contributor

Markdown compiler is the source of truth.

I don't follow, source of truth for what?

@joshix
Copy link
Contributor Author

joshix commented Nov 18, 2015

Just about whether or not something can or cannot be line-wrapped.

@jonboulle
Copy link
Contributor

SGTM, probably best to get an ack from @philips as AIUI he's the initiator
of the one-sentence-per-line style

On Wed, Nov 18, 2015 at 1:14 PM, Josh Wood notifications@github.com wrote:

Just about whether or not something can or cannot be line-wrapped.


Reply to this email directly or view it on GitHub
#633 (comment).

@philips
Copy link
Contributor

philips commented Nov 25, 2015

I still like one sentence per line and it works in nearly all editors. The 80 char rule gets you into doc churn hell because everyone's editor is going to do something different whether that be wrapping to 79, wrapping words with dashes, etc.

@joshix
Copy link
Contributor Author

joshix commented Nov 25, 2015

@philips Since we don't agree, let me spell out my reasoning and you can make the ruling. I thought about the points you raise, but I came down to two points: 1) as @crawford alludes, part of the intent of Markdown is plain-text readability. The source document is supposed to be a fair rough representation of the document as rendered. We write the kind of docs with markdown that one would expect to read in a terminal. The one sentence-per-line rule makes this pretty terrible. Nothing looks like a paragraph. I presumed (not knowing the history) that markdown was chosen for these conventional reasons and therefore those goals were worth preserving.

Having thought it out that way, I compared with some style guides for large repos using Markdown. Google's rules pretty much encapsulate what I was aiming for. Maybe that's confirmation bias. https://github.com/google/styleguide/blob/gh-pages/docguide/style.md#character-line-limit

In order, I would happily concede on the proposed 80-chars per line. I truly think the intent of markdown is writing natural english paragraphs, and I kind of hate humanfmt in general.

I would be forced to concede, but like it much less, if we had to adopt one-sentence-per-line all over.

@joshix
Copy link
Contributor Author

joshix commented Nov 30, 2015

Note: spec unordered list style (* Item)

@joshix joshix force-pushed the styledir-hdings branch 5 times, most recently from 1305624 to ef2a25f Compare December 6, 2015 22:00
@jonboulle
Copy link
Contributor

I should clarify that my preference is not strictly sentence-per-line, but rather just avoiding line length limits. I'm +1 on the proposed paragraph-per-line.

@joshix
Copy link
Contributor Author

joshix commented Dec 13, 2015

YAML files: secret.yaml vs secret.yml

Set style for this. Before deciding, note that upstream k8s tends to say *.yaml.

@joshix
Copy link
Contributor Author

joshix commented Dec 17, 2015

@robszumski @meghanschofield @philips I think we could land this as a delightful holiday gift for one and all. Would enjoy your parting thoughts on same.


### Naming

Name hyperlinks carefully to give them maximum context. For example, note that certain information is in the [style guide](STYLE.md), rather than just pointing lazily to the style guide [here](STYLE.md). The link text "here" gives almost no information about its target. It is helpful to [write a clear sentence](https://faculty.washington.edu/heagerty/Courses/b572/public/StrunkWhite.pdf) first, then bracket the choice words within to declare them a hyperlink.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes yes yes. I hate saying "these are available here"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shakes fist

@robszumski
Copy link
Member

Added a few comments, but overall looks good.


## Translations
1. Fork this repository into your git workspace and/or github account
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub

CoreOS conventions of English style, markdown text formatting, and the like.
joshix pushed a commit that referenced this pull request Dec 22, 2015
Begin style guide: Document conventions
@joshix joshix merged commit a64eabe into coreos:master Dec 22, 2015
@joshix joshix deleted the styledir-hdings branch December 22, 2015 21:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants