Code Macro

This is a XWiki 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

Highlight provided code snippet.

See http://pygments.org/languages/ for the list of currently supported languages.

Usage

{{code language=<providedlanguage>}}
… code here…
{{/code}}

Parameters definition

NameOptionalAllowed valuesDefault valueDescription
languageyesa stringthe macro tries to determine the syntaxthe language identifier of the provided code snippet. If no language identifier is specified then the macro will try to determine the syntax. To avoid highlight you can use "none" language identifier.

This macro also support all Box Macro parameters.

Adding new languages

Anyone can add a new language support by:

Example

{{code language="html"}}
<html>
  <head>Cool!</head>
</html>
{{/code}}

Result

code.png

Tags:
Created by Thomas Mortagne on 2008/12/02 15:02
Last modified by Thomas Mortagne on 2010/03/18 07:41

This wiki is licensed under a Creative Commons license
2.2.1.27354