Inline code & code block

Prev Next

The unified Editor and the Advanced WYSIWYG editor support two ways to display code in your articles: inline code and code blocks.

  • Inline code formats a short snippet or command within a line of text, distinguishing it visually from the surrounding prose.
  • Code block displays a multi-line block of code as a separate section with syntax highlighting, a language label, and a copy option.

Document360 uses Prism.js for syntax highlighting and supports a wide range of programming languages in code blocks.

NOTE

The unified Editor is rolled out in phases and is currently available in projects created on or after November 23, 2026. Projects created earlier continue to use the Advanced WYSIWYG editor and the Markdown editor. We're working to make it available to all projects soon.

NOTE

Not sure which editor you are using? Open any article in edit mode and check the label in the article header. It shows Unified Editor, Advanced WYSIWYG, or Markdown.


Recommended scenarios

  • Use inline code to reference a variable name, file path, command, or parameter within a sentence, for example, "Set the value of max_retries to 3"
  • Use a code block for multi-line scripts, {{ glossary.API}} request examples, configuration files, or any code readers may need to copy and run
  • Use a custom language label when documenting a proprietary scripting language or configuration format not available in the default list
  • Use code blocks inside tab elements to show the same API call in multiple languages side by side (for example, Python, JavaScript, and cURL in separate tabs)

Inline code

Inline code is applied directly to selected text within a paragraph without creating a new block.

Text formatted as inline code within a sentence

Apply inline code in the Advanced WYSIWYG editor

  1. Select the text you want to format as inline code.
  2. In the floating toolbar, click the Inline code icon or use the keyboard shortcut Ctrl + E.

The selected text appears styled as code within the sentence.

Apply inline code in the unified Editor

  1. Select the text you want to format as inline code.
  2. Select Code in the bubble menu that appears above the selection. You can also open the dropdown next to Italic in the toolbar and select Inline code, or press Ctrl + E.

The fixed formatting toolbar across the top of the unified Editor

In Markdown view, wrap the text in single backticks, for example `max_retries`.


Code block

A code block creates a dedicated section for displaying multi-line code with syntax highlighting.

A code block with a language label and copy option

Insert a code block in the Advanced WYSIWYG editor

To insert a code block, use any of the following methods:

  1. Click the Code block icon in the Quick insert menu (appears when a block is empty)
  2. Type three backticks ``` and press Enter
  3. Use the slash command /code block and press Enter

After inserting a code block:

  1. Click on the code block. A floating menu appears.
  2. Select the desired language from the dropdown for syntax highlighting.
  3. Enter your code inside the block.

To copy the block, click the Copy icon. To remove it, click the Delete icon.

Setting a custom language label: If the language you need is not in the list, select Custom from the dropdown, click the Edit icon, enter your desired title, and click Update.

NOTE

In the Advanced WYSIWYG editor, a code block always requires a heading. To hide the heading on the knowledge base site, apply Custom CSS via Settings > Knowledge base site > Custom CSS & JavaScript. This will hide the heading across all code blocks on the site. If you prefer code blocks without a heading, use the Markdown editor instead.

Insert a code block in the unified Editor

In Block view, use any of these methods. The code block is added at the cursor's position.

  • In the toolbar, select Insert (+), then select Code block.
  • Type / and select Code block on the Insert tab.
  • In an empty block, select Code block on the quick insert bar.
  • Press Ctrl + Alt + C.

Then select the language and enter your code in the same way.

The Insert menu open in the unified Editor toolbar

In Markdown view, put three backticks and the language on the line above the code, and three backticks on the line below. To turn on line numbers or long-line wrapping, add lineNumbers or wordWrap after the language:

```javascript lineNumbers
const total = items.length;
```

Supported languages

Document360 supports syntax highlighting for the following languages (among others):

HTML, C#, Java, JavaScript, XML, JSON, CSS, SQL, Python, Markdown, PHP, PowerShell, Ruby, and Text.

For a full list, refer to Prism's supported languages.


Best practices

  • Use inline code for short references (one line or less) and code blocks for anything longer
  • Always select the correct language for your code block. Accurate syntax highlighting improves readability and signals the correct language to readers
  • Add a descriptive heading to your code block so readers know what the code does before reading it
  • Keep code blocks focused: one block per distinct snippet or example, and avoid combining unrelated code in a single block
  • Keep code clean and free of placeholder comments that could cause errors if run directly