Capitalization
When to capitalize, and when to leave a word lowercase.
Capitalize a name. Leave everything else alone. Most disagreements about capitalization are really disagreements about whether a thing is a name, and answering that question settles the spelling.
A capital letter is a claim that a word is the name of one particular thing. Applying it to an ordinary noun — a feature, a format, a role — asks the reader to look for a proper noun that is not there.
Capitalization in headings
A page title is set in title case, capitalizing the first word, the last word, and everything between them except articles, coordinating conjunctions, and prepositions.
Recommended: Documenting Command-Line Syntax
Not recommended: Documenting command-line syntax
The exceptions are what the rule turns on. A preposition in the middle of a title stays lowercase however long the title is:
Recommended: Code in Text
Not recommended: Code In Text
A heading inside a page is set in sentence case: the first word capitalized, and after that only what would be capitalized in running text.
Recommended: Explaining placeholders
Not recommended: Explaining Placeholders
An adapted page follows these rules too. A page that carries an attribution line says where its wording came from, not whose house style it is set in, and a reader moving between pages should not be able to tell which is which from the headings.
The name of the project
The project is OpenINF. One capital at the front for Open, three at the back for INF, and nothing else.
Recommended: OpenINF
Not recommended: OPENINF, Openinf, openINF
Setting the name in full capitals is shouting it, and a name that shouts in running text is a name the reader learns to skip. This holds in headings, in navigation, and in the small print at the foot of a page — nowhere is it OPENINF.
The scope on npm is lowercase, because npm scopes are lowercase: @openinf. Write a package name exactly as it is published, in code font, and never capitalize it to start a sentence. Rewrite the sentence instead.
Recommended: The @openinf/util-types package has no dependencies.
Not recommended: @openinf/util-types has no dependencies.
Words that only look like names
Technologies, formats, and general concepts are ordinary nouns. They take a capital only where a name is embedded in them.
| Write | Not |
|---|---|
| open source | Open Source |
| the web | the Web |
| the internet | the Internet |
| a pull request | a Pull Request |
| the command line | the Command Line |
| JavaScript, npm, Git | Javascript, NPM, git |
The last row is the exception that proves the rule: those three are names, and each has one correct spelling that is neither all lowercase nor all capitals.
After a colon
A colon does not start a new sentence, so what follows it is capitalized only if it would be capitalized anywhere else. See Colons for when the colon is the right mark at all.