CodeMacro

This is a Radeox macro, bundled with all the XWiki products by default.
Macro developed by the XWiki Development Team.
This macro cannot currently be downloaded separately.

Code Macro

Displays code located between {code} elements with a special formatting. XWiki's code macro inherits from Radeox's code macro and has the same features. It knows how to display Java code, XML

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;
Tags:
Created by VincentMassol on 2006/12/10 21:18
Last modified by Ecaterina Valica on 2009/10/15 17:52

This wiki is licensed under a Creative Commons license
2.3.28624