We use a variety of formatting to highlight code or other technical language.
The following table provides some examples of our use of code format.
Why use code?
File paths and file names
Using code helps paths and file names stand out, and ensures clarity about the exact file name.
The agent looks for
NRDB event names and attributes
Many attribute names (such as
To analyze APM errors, use the
Using code formatting for method names is standard practice.
To initialize the APM agent, use
URLs you don't intend to be clicked
Using code formatting hints to the user that they may need to customize or tweak the URL to ensure it works for them.
In your web browser, navigate to the minion Overview page at
Command line utility names
If you think a reader or translator might confuse a command with a general English word, use code.
To install the utility, use
To format inline code (like
TransactionError), surround the text with backtick
To format one or more lines of code, insert three backticks (
``` ) above and below your code. This essentially acts like the HTML
<var> tag is used to highlight areas the user needs to customize the value in a code snippet.
Follow these guidelines when you use
- Address the reader directly (
- Use all caps and underscores
_to separate words (also known as SCREAMING_SNAKE_CASE).
- Don't combine them with other punctuation to indicate variables (such as wrapping the text in angle brackets or curly braces).
- Don't overuse them. For example, if you're showing a complete config file where the user is expected to customize many values, a
<var>tag on each configurable value is overkill.
<mark> tag to highlight areas of a code block that are particularly important. Most commonly,
<mark> is used to highlight New Relic API methods in sample code that contains a lot of "other logic." They're also handy when you want to indicate a bit of code that will be referenced later in a procedure or doc.
When you use
<mark>, you should usually follow the code block with a list of bullets that explain what each API call is doing and link to method syntax.