KB User's Guide - Embedding Code Snippets in a KB Document
Use the Code sample feature in the TinyMCE editor to add formatted, syntax-highlighted code to a KB document.
Insert a Code Sample
- In the KB editor, place your cursor where you want the code snippet to appear.
- From the editor menu, select Insert > Code sample....

- In the dialog box, select the appropriate programming language from the Language menu.
- Enter or paste your code into the code area.
- Select Save to insert the code sample into the document.
Edit or Remove a Code Sample
- Click anywhere within the existing code sample in the editor.
- Select Insert > Code sample... to update the language or code.
- Select Save to apply your changes.
- To remove the sample, select the code block and use the editor’s Delete or Backspace key.
Available Languages
Select the language that best matches your snippet. Common options include: Bash/Shell, C, C++, C#, CSS, Go, HTML, Java, JavaScript, Markdown, PHP, Python, Ruby, SQL, and XML.
Best Practices
- Use code samples for commands, configuration files, and programming examples.
- Select the correct language so the live site can apply appropriate syntax highlighting.
- Keep snippets focused on the steps or concept being documented.
- Do not include passwords, API keys, tokens, or other sensitive information.
- Use normal paragraph text before or after a code sample to explain what the code does and any required changes.
Code samples are displayed as formatted code blocks in the editor and are syntax-highlighted on the live KnowledgeBase site.
