XWiki Syntax Guide

Last modified by wikibot on 2023/02/04 16:00

XWiki Syntax 2.1 » Programming

XWiki Syntax 2.1: Programming

Macros

2.0 Macros

There is only one kind of macro in XWiki Syntax 2.1, which is called by the syntax: {{macroname param1="value1" ... paramN="valueN"}}...{{/macroname}}. For macros without content there's a short notation: {{macroname param1="value1" ... paramN="valueN"/}}

FeatureXWiki Syntax 2.1Result
Rendering Macro with a content
{{code language="java"}}
System.out.println("Hello World!");
{{/code}}
System.out.println("Hello World!");
Rendering Macro without content

{{include reference="Space.Page"/}}

The referenced page is included in the current page

For the full list of available macros check the Extensions wiki.

Macros in this wiki

Failed to execute the [include] macro. Cause: [Current user [null] doesn't have view rights on document [xwiki:XWiki.XWikiSyntaxMacrosList]]. Click on this message for details.

HTML

2.0 HTML

In XWiki Syntax 2.1 HTML or XHTML must be entered by using the HTML macro.

XWiki Syntax 2.1Result
{{html}}<abbr title="HyperText Markup Language">HTML</abbr>{{/html}} HTML

Scripts

2.0 Scripts

FeatureXWiki Syntax 2.1
Velocity script
{{velocity}}
#set ($var = "whatever")
{{/velocity}}
Groovy script
{{groovy}}
def var = "whatever"
{{/groovy}}