This KB will explain the various methods on how to enter and format script snippets when creating a knowledge base article.
There are several methods which can be used to format the script snippet.
Method #1: Using the "Preformatted" paragraph type in the text editor UI.
- Copy your code snippet into your KB article (or write it out completely, whichever suits you best)
- Select the entire piece of code
- Choose the "Preformatted" paragraph type from the "Paragraph" toolbar item:
- You're done (see the blog post: Knowledge Byte #1 - Code Blocks for more screenshots).
Method #2: Modify the HTML source code directly.
- Open your KB and enter your script snippet, this is how your script snippet will appear with no formatting:
- Click anywhere in your script then click on the 'Source code' (<>) button in TinyMCE, locate your script snippet.
- Wrap your script snippet with the <pre> tag and click Ok.
- This is how your script snippet will now appear in your KB.
- In your KB, click to the right of the last character in the script, then press 'Enter' to create a new line.
You can now start entering your script. When finished, remove the previous script and Save.
For either method used, as specified in KB0680709 "Article Style Guide (KCS)", please set the font to "Andale Mono" or "Courier New" for your script snippets.