Colons

A colon indicates that closely related information follows.

Introductory phrase preceding colon

When a colon introduces a list, the text that precedes the colon should ordinarily be able to stand alone as a complete sentence.

Examples

Recommended: The fields are defined as follows:

Not recommended: The fields are:

The Japanese colon in commit subjects

A commit subject separates its Classification from the rest with the Japanese colon β€” :, the fullwidth colon at U+FF1A β€” rather than with the ASCII one.

Recommended: πŸ—οΈπŸ”§οΌšlet the glob see dot files β€” U+FF1A, no space after it

Not recommended: πŸ—οΈπŸ”§: let the glob see dot files β€” U+003A and a space

Those two lines are within a few pixels of each other on screen, which is the whole difficulty: the mark is one to copy rather than to type. nps verify.commits refuses a subject that lacks it, so a colon typed by hand fails the pull request rather than landing.

The mark is fullwidth, so the gap a space would give is already inside the glyph, and no space follows it. An ASCII colon is narrow enough that the emoji crowds the first word, and the space that would fix the crowding spends one of the fifty characters a subject is allowed.

It is not chosen for size. : takes three bytes in UTF-8 where a colon and a space take two. What it buys is a subject that reads at the same width as the emoji beside it, in a terminal and on a page alike.

Bold and italic text preceding colons

When non-italic (also known as Roman) text that precedes a colon is bold, the colon should not be made bold, italic, or otherwise (e.g., color-stylized, etc.). This, however, is not a hard and fast rule. In general, use best intuition.

Code text preceding colons

When text that precedes a colon is tagged as <code>, don't include the colon in the <code> tagging unless it is already part of the code itself. For more information about formatting code, see Some specific items to put in code font.

Colons within sentences

In general, the first word in the text that follows a colon should be in lowercase. For exceptions, see capitalization.

Examples

Recommended: Tone: concise, conversational, friendly, respectful

Recommended: When you add or update content to an existing project, remember to take these steps: review the style guide, use checklists, enlist a fellow writer or an editor to copyedit your work, and request a developmental edit if you feel it's warranted.

See also

For more information about how to punctuate introductory material, see the sections on list introductions and code-sample introductions.

For information about when it's better to use colons than dashes, see Dashes.