Skip to content

Latest commit

Β 

History

History
76 lines (74 loc) Β· 4.41 KB

File metadata and controls

76 lines (74 loc) Β· 4.41 KB
Β 
1
# Style Guide
2
Oct 10, 2017
Oct 10, 2017
3
* Documentation is written in markdown files with names formatted as
4
`lowercase-with-dashes.md`.
5
* Underscores in filenames are allowed only when they are present in the
Jan 25, 2018
Jan 25, 2018
6
topic the document will describe (e.g. `child_process`).
7
* Some files, such as top-level markdown files, are exceptions.
8
* Documents should be word-wrapped at 80 characters.
9
* The formatting described in `.editorconfig` is preferred.
May 23, 2017
May 23, 2017
10
* A [plugin][] is available for some editors to automatically apply these
11
rules.
Jan 3, 2018
Jan 3, 2018
12
* Changes to documentation should be checked with `make lint-md`.
13
* American English spelling is preferred. "Capitalize" vs. "Capitalise",
14
"color" vs. "colour", etc.
Dec 1, 2017
Dec 1, 2017
15
* Use [serial commas][].
Mar 9, 2018
Mar 9, 2018
16
* Avoid personal pronouns in reference documentation ("I", "you", "we").
Mar 13, 2018
Mar 13, 2018
17
* Personal pronouns are acceptable in colloquial documentation such as guides.
18
* Use gender-neutral pronouns and gender-neutral plural nouns.
Mar 9, 2018
Mar 9, 2018
19
* OK: "they", "their", "them", "folks", "people", "developers"
Oct 10, 2017
Oct 10, 2017
20
* NOT OK: "his", "hers", "him", "her", "guys", "dudes"
21
* When combining wrapping elements (parentheses and quotes), terminal
22
punctuation should be placed:
23
* Inside the wrapping element if the wrapping element contains a complete
24
clause β€” a subject, verb, and an object.
25
* Outside of the wrapping element if the wrapping element contains only a
26
fragment of a clause.
27
* Place end-of-sentence punctuation inside wrapping elements β€” periods go
28
inside parentheses and quotes, not after.
29
* Documents must start with a level-one heading. An example document will be
30
linked here eventually.
31
* Prefer affixing links to inlining links β€” prefer `[a link][]` to
32
`[a link](http://example.com)`.
33
* When documenting APIs, note the version the API was introduced in at
34
the end of the section. If an API has been deprecated, also note the first
35
version that the API appeared deprecated in.
Jun 23, 2017
Jun 23, 2017
36
* When using dashes, use [Em dashes][] ("β€”" or `Option+Shift+"-"` on macOS)
37
surrounded by spaces, as per [The New York Times Manual of Style and Usage][].
38
* Including assets:
39
* If you wish to add an illustration or full program, add it to the
40
appropriate sub-directory in the `assets/` dir.
41
* Link to it like so: `[Asset](/assets/{subdir}/{filename})` for file-based
42
assets, and `![Asset](/assets/{subdir}/{filename})` for image-based assets.
43
* For illustrations, prefer SVG to other assets. When SVG is not feasible,
44
please keep a close eye on the filesize of the asset you're introducing.
45
* For code blocks:
46
* Use language aware fences. ("```js")
47
* Code need not be complete β€” treat code blocks as an illustration or aid to
48
your point, not as complete running programs. If a complete running program
49
is necessary, include it as an asset in `assets/code-examples` and link to
50
it.
May 23, 2017
May 23, 2017
51
* When using underscores, asterisks, and backticks, please use proper escaping
Oct 10, 2017
Oct 10, 2017
52
(`\_`, `\*` and ``\` `` instead of `_`, `*` and `` ` ``).
May 23, 2017
May 23, 2017
53
* References to constructor functions should use PascalCase.
54
* References to constructor instances should use camelCase.
55
* References to methods should be used with parentheses: for example,
56
`socket.end()` instead of `socket.end`.
May 25, 2017
May 25, 2017
57
* To draw special attention to a note, adhere to the following guidelines:
58
* Make the "Note:" label italic, i.e. `*Note*:`.
59
* Use a capital letter after the "Note:" label.
60
* Preferably, make the note a new paragraph for better visual distinction.
Sep 28, 2017
Sep 28, 2017
61
* Function arguments or object properties should use the following format:
62
* <code>* \`name\` {type|type2} Optional description. \*\*Default:\*\* \`defaultValue\`</code>
63
* E.g. <code>* `byteOffset` {integer} Index of first byte to expose. **Default:** `0`</code>
64
* The `type` should refer to a Node.js type or a [JavaScript type][]
65
* Function returns should use the following format:
66
* <code>* Returns: {type|type2} Optional description.</code>
67
* E.g. <code>* Returns: {AsyncHook} A reference to `asyncHook`.</code>
Nov 22, 2017
Nov 22, 2017
68
* Use official styling for capitalization in products and projects.
69
* OK: JavaScript, Google's V8
70
* NOT OK: Javascript, Google's v8
Jun 23, 2017
Jun 23, 2017
72
[Em dashes]: https://en.wikipedia.org/wiki/Dash#Em_dash
Sep 28, 2017
Sep 28, 2017
73
[Javascript type]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Data_structures_and_types
Dec 1, 2017
Dec 1, 2017
74
[serial commas]: https://en.wikipedia.org/wiki/Serial_comma
Jun 23, 2017
Jun 23, 2017
75
[The New York Times Manual of Style and Usage]: https://en.wikipedia.org/wiki/The_New_York_Times_Manual_of_Style_and_Usage
Sep 28, 2017
Sep 28, 2017
76
[plugin]: http://editorconfig.org/#download