Skip to content
The style guide is in beta: content and structure may change.

Inline code

This page describes the rules for code elements, such as function names, method names, and commands, in a sentence in body text.

The rules for blocks of code are on the code examples page, and the rules for values that the reader replaces are on the placeholders page. Two rules from the refer and link page also apply to body text and are listed at the end of this page.

inline-002 should GuidesAPI docsMarketingBlog

Use code font for every developer text element in body text, including attributes, classes, methods, constants, variables, parameters, environment variables, commands, flags, data types, and markup elements.

Examples

  • ✓ Set the timeout field in the request body.
  • ✗ Set the “timeout” field in the request body.

Rationale

Code font tells the reader that a word is literal code, which they type or match exactly. When every code element is in code font, the reader can rely on italic and bold to mean something else.

inline-001 should GuidesAPI docsMarketing

Don’t use a function or method name as an English verb in body text.

Examples

  • ✓ Call push() to add the message to the queue.
  • ✗ push() the message onto the queue.

Rationale

A method or function name is a noun that you never translate, so using it as a verb causes translation errors, and doesn’t clearly indicate whether a user performs an action or makes a call.