Confluence Docs 3.3 : Code Block Macro
This page last changed on Dec 17, 2009 by ggaskell.
The Code Block Macro allows you to display source code in your document with the appropriate syntax highlighting. The code block displays on the page as shown below. public static void main(String[] args) { System.out.println("Hello World!"); } On this page: Usage with the Macro BrowserTo insert the code block macro into a page using the Macro Browser,
Once you've found the code block macro, click 'insert' to add it to your page. Usage with the Wiki Markup Editor
ParametersParameters are options that you can include in Confluence macros to control the content or format of the macro output. The table below lists relevant parameters for this macro. Parameter names are different in the macro browser and in wiki markup. Below we show the macro browser parameter names in bold text, and the equivalent wiki markup parameters in (bracketed) text. If we do not show any parameter name for the wiki markup, then you should leave out the parameter name and simply include the parameter value as the first parameter, immediately after the colon (:).
Be aware that any white space contained between the {code} commands is not manipulated in any way by the Code Block Macro. This is to provide the writer with flexibility over code indentation.
ExamplesExample 1: Java
Example 2: XML
Example 3: HTML
RELATED TOPICSWorking with Macros Take me back to the Confluence User's Guide. |
![]() |
Document generated by Confluence on Jul 09, 2010 01:08 |