Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Panel

For more information about the 'code' macro, please see the documentation.

Excerpt

The 'code' macro is a useful way of presenting source code in an easy-to-read format on your Confluence pages. Its use is very straightforward: simply enclose your source code between {code} elements.As you read below, look for the bold code tags to indicate how the highlighting occurs.

Here are some examples:

XML

Code Block
\{code:XML\}
<test>
    <another tag="attribute"/>
</test>
\{code\}

...

Code Block
\{code:SQL\}
SELECT * FROM TABLE1 WHERE ID=0 AND NAME NOT IN (SELECT NAME FROM NAMES)
\{code\}

gives

Code Block
SQL
SQL
SELECT * FROM TABLE1 WHERE ID=0 AND NAME NOT IN (SELECT NAME FROM NAMES)

...