Code Macro (Radeox)

Last modified by Vincent Massol on 2016/06/05 22:26

Pretty prints code snippets.

Replaced by the Code Macro.

XWiki's code macro inherits from Radeox's code macro and has the same features.

Usage

{code[:none|:java|:xml|:sql]}

Parameters definition

  • none: no formatting
  • java: forces the pretty printer to use the Java coloring scheme. This is the default.
  • xml: forces the pretty printer to use the XML coloring scheme.
  • sql: force the pretty printer to use the SQL coloring scheme.

If no format is specified then the macro defaults to java.

Example

{code}
public class MyClass {
  public void helloWorld() {}
}
{code}

{code:xml}
<hello>
  <world>Cool!</world>
</hello>
{code}

{code:sql}
SELECT * FROM TABLE;
{code}

Result

public class MyClass {
 public void helloWorld() {}
}
<hello>
 <world>Cool!</world>
</hello>
SELECT * FROM TABLE;

Get Connected