In order to show certain details in instructions, editors can insert excerpts of computer code in knowledge base articles. In order to maintain accessibility as well as readability, you should format these excerpts of computer code depending on the audience of the article—it differs between TDX internal articles and public articles.
Note: Adding code using the Formatted option within the Paragraph Format dropdown (where Headings are located) is not supported.
Note for public-facing articles: Code appears as pink text in TDX and black bolded text in Drupal.
Adding Code to the Body of an Article in TDX
-
In TDX edit mode, highlight the text you want to format as code.
- Bold the text
- Select the formatting Styles dropdown.

- Select Computer Code (under the Inline Styles section).

- The resulting text will appear in dark pink with a lighter pink background in TDX and as bolded black text in Drupal. Both with a slightly different typeface from the instruction text.
- Example:
eyaml encrypt -p - Example in TDX:

- Example:
Note: If drafting code in a Google file such as a Google Doc, the color contrast will not meet accessibility guidelines. However, once the code is added within the TDX article, it will meet accessibility guidelines.