This documentation relates to an early version of Confluence.
For documentation on the latest Confluence release, please go to the documentation home page.

Code Block Macro

All Versions
Click for all versions
Confluence 1.4 Documentation

Index

The Code Block Macro allows you to display source code in your document with the appropriate syntax highlighting.

You can specify the programming language. Confluence currently supports Java, XML and SQL with Java being the default language for this macro.

Code Block Macro

{code:language} ... code ... {code}
OR
{code} ... java code ... {code}


Example 1: Java

What you need to type What you will get
{code}
public String getFoo()
{
return foo;
}
{code}
public String getFoo()
{
    return foo;
}



Example 2: XML

What you need to type What you will get
{code:XML}
<test>
<another tag="attribute"/>
</test>
{code}
<test>
    <another tag="attribute"/>
</test>
RELATED TOPICS

Working with Macros

Take me back to Help Home

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.