Skip to main content

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.

  1. Select the assignment in the Assignments Panel.

    Paligo dashboard. The Assignments panel is highlighted, showing that the user has been assigned to review, contribute, and translate assignments.

    The Assignment Types control which view opens up.

    Tip

    For alternative ways to open an assignment, see Different Ways to Open Assignments.

  2. 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.

  3. Select Insert code block and choose programming language in Contributor Editor Toolbar. Insert_Code_Block_ContributorEditor_small.png

    Insert_CodeBlock_variants_ContributorEditor_small.png
  4. Enter the code inside the code block.

    code block containing CSS code
  5. Select Save. Save_ContributorEditor_small.png