Add Code Blocks
A code block is a section of one or more lines of code. When the content is published, the code block is formatted with syntax highlighting, indentation. In many cases Paligo will output proper syntax highlighting just by autodetecting the language. But in some cases the results will be better if the language is specified.
The following instruction shows how to add a code block in Contributor Editor.
Tip
If you want to change the programming language for an existing code block, position the cursor inside the code block and select a new programming language from the toolbar.
-
Select the assignment in the Assignments Panel.
Tip
For alternative ways to open an assignment, see Different Ways to Open Assignments.
-
Position the cursor in a new paragraph.
Tip
You can also highlight a text and then select the code block option in the Contributor Editor Toolbar to turn it into a code block.
-
Select Insert code block and choose programming language in Contributor Editor Toolbar.
-
Enter the code inside the code block.
-
Select Save.