Starting with XWiki Enterprise version 1.7 and above we've introduced a new wiki syntax. So we're now naming the current syntax the XWiki Syntax v1.0 and the new syntax is logically called the XWiki Syntax v2.0. The main reasons for introducing the new syntax were:
In addition to these 2 XWiki syntaxes we've also changed our underlying rendering engine (was Radeox previously) in favor of our own engine which is superset wrapper around Wikimodel and Doxia (and possibly others in the future). This has allowed us to provide other syntaxes in the wiki: MediaWiki, Confluence, JSPWiki, Creole, TWiki and more
XWiki Syntax v2.0 corrects some errors or ambiguous syntax entered by the user as shown in the examples in the table below.
Description | Example of invalid or ambiguous syntax | Fixed XWiki Syntax 2.0 |
---|---|---|
Not closed tet styles | **bold | **bold** |
Two standalone elements not separated by 2 new lines | | table cell * list item | | table cell * list item |
Two standalone elements not separated by 2 new lines | paragraph ---- paragraph | paragraph ---- paragraph |
Ignored new line at beginning of document | <new line at beginning of document> paragraph | paragraph |
Not closed heading syntax | === heading | === heading === |
Paragraphs are text elements separated by 2 or more new lines.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result XWiki Syntax 1.0 | Result XWiki Syntax 1.2 |
---|---|---|---|---|
Simple paragraph | This is a paragraph | This is a paragraph | This is a paragraph | This is a paragraph |
Paragraph on multiple lines | Paragraph on\\ multiple lines | Paragraph on multiple lines | Paragraph on multiple lines | Paragraph on multiple lines |
Two paragraphs | Paragraph one Paragraph two | Paragraph one Paragraph two | Paragraph one Paragraph two | Paragraph one Paragraph two |
Parametrized paragraph | <p style="text-align:center;color:blue">Centered and blue paragraph</p> | (% style="text-align:center;color:blue" %) Centered and blue paragraph | Centered and blue paragraph | Centered and blue paragraph |
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|---|---|---|
Standard headings | 1 level 1 | = level 1 = == level 2 == === level 3 === ==== level 4 ==== ===== level 5 ===== ====== level 6 ====== | level 1
level 2level 3level 4level 5level 6 |
Parametrized headings | <h1><span style="color:blue">heading</span></h1> | (% style="color:blue" %) = heading = | heading |
Headings with wiki syntax | 1.1.1 Heading with *bold* | === Heading with **bold** === | Heading with bold |
New in XWiki Syntax 2.0 over XWiki Syntax 1.0:
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|---|---|---|
Bold | *bold* | **bold** | bold |
Underline | __underline___ | __underline__ | underline |
Italics | ~~italic~~ | //italic// | italic |
Striked out | --strike-- | --strike-- | |
Monospace | <tt>monospace</tt> | ##monospace## | monospace |
Superscript | some <sup>superscript</sup> | some ^^superscript^^ | some superscript |
Subscript | some <sub>subscript</sub> | some ,,subscript,, | some subscript |
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|---|---|---|
Simple Horizontal Line | ---- | ---- | |
Parametrized Horizontal Line | <hr style="color:blue"/> | (% style="color:blue" %) ---- |
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|---|---|---|
Bulleted list | * item 1 ** item 2 *** item 3 * item 4 | * item 1 ** item 2 *** item 3 * item 4 |
|
Numbered list | 1. item 1 11. item 2 111. item 3 1. item 4 | 1. item 1 11. item 2 111. item 3 1. item 4 |
|
Mixed list | 1. item 1 1*. item 2 1*. item 3 1. item 4 | 1. item 1 1*. item 2 1*. item 3 1. item 4 |
|
Square list | - item 1 - item 2 | (% style="list-style-type: square" %) * item 1 * item 2 |
|
Disc list | <ul style="list-style-type: disc"> | (% style="list-style-type: disc" %) * item 1 * item 2 |
|
Lowercase Alphabetical list | a. item 1 a. item 2 | (% style="list-style-type: lower-alpha" %) * item1 * item2 |
|
Uppercase Alphabetical list | A. item 1 A. item 2 | (% style="list-style-type: upper-alpha" %) * item1 * item2 |
|
Lowercase Roman list | i. item 1 i. item 2 | (% style="list-style-type: lower-roman" %) * item1 * item2 |
|
Uppercase Roman list | I. item 1 I. item 2 | (% style="list-style-type: upper-roman" %) * item1 * item2 |
|
Lowercase Greek list | g. item 1 g. item 2 | (% style="list-style-type: lower-greek" %) * item1 * item2 |
|
Uppercase Greek list | G. item 1 G. item 2 | (% style="list-style-type: upper-greek" %) * item1 * item2 |
|
Hiragana list | h. item 1 h. item 2 | (% style="list-style-type: hiragana" %) * item1 * item2 |
|
Hiragana Iroah list | H. item 1 H. item 2 | (% style="list-style-type: hiragana-iroha" %) * item1 * item2 |
|
Katakana list | k. item 1 k. item 2 | (% style="list-style-type: katakana" %) * item1 * item2 |
|
Katakana Iroha list | K. item 1 K. item 2 | (% style="list-style-type: katakana-iroha" %) * item1 * item2 |
|
Armenian list | <ul style="list-style-type: armenian"> <li>item1</li> <li>item2</li> </ul> | (% style="list-style-type: armenian" %) * item1 * item2 |
|
Hebrew list | j. item1 j. item2 | (% style="list-style-type: hebrew" %) * item1 * item2 |
|
Georgian list | <ul style="list-style-type: georgian"> <li>item1</li> <li>item2</li> </ul> | (% style="list-style-type: georgian" %) * item1 * item2 |
|
CJK ideographic list | <ul style="list-style-type: cjk-ideographic"> <li>item1</li> <li>item2</li> </ul> | (% style="list-style-type: cjk-ideographic" %) * item1 * item2 |
|
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|---|---|---|
Standard definition | <dl> <dt>term</dt> <dd>definition</dd> </dl> | ; term : definition |
|
Nested definitions | <dl> <dt>term1</dt> <dd>definition1 <dl> <dt>term2</dt> <dd>definition2</dd> </dl> </dd> </dl> | ; term1 : definition1 :; term2 :: definition2 |
|
Parametrized definition | <dl style="color:blue"> <dt>term</dt> <dd>definition</dd> </dl> | (% style="color:blue" %) ; term : definition |
|
A new line is a carriage return. A line break is a forced new line that can appear anywhere in the text.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result XWiki Syntax 1.0 | Result XWiki Syntax 2.0 |
---|---|---|---|---|
Line break | Line\\New line | Line\\New line | Line New line | Line New line |
New line | Line New line | Line New line | Line New line | Line New line |
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result XWiki Syntax 1.0 | Result XWiki Syntax 2.0 |
---|---|---|---|---|
Link to a page in the current Space | [WebHome] | [[WebHome]] | Web Home | WebHome |
Link with a label | [label>WebHome] | [[label>>WebHome]] | label | label |
Link to a page with the space specified | [Main.WebHome] | [[Main.WebHome]] | Web Home | WebHome |
Link to a subwiki | [subwiki:Main.WebHome] | [[subwiki:Main.WebHome]] | Web Home | WebHome |
Link that opens in a new page | [label>WebHome>_blank] | [[label>>WebHome||rel="__blank"]] | label | label |
Link to a URL directly in the text | This is a URL: http://xwiki.org | This is a URL: http://xwiki.org | This is a URL: http://xwiki.org | This is a URL: http://xwiki.org |
Link to a URL | [http://xwiki.org] | [[http://xwiki.org]] | http://xwiki.org | http://xwiki.org |
Link to a URL with a label | [XWiki>http://xwiki.org] | [[XWiki>>http://xwiki.org]] | XWiki | XWiki |
Link to an email | [john@smith.net>mailto:john@smith.net] | [[john@smith.net>>mailto:john@smith.net]] | john@smith.net | john@smith.net |
Image Link | <a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2}</a> | [[image:Space2.Page2@img.png>>Space1.Page1]] | ![]() | ![]() |
Link to an attachment in the current page | See Attach Macro for details | [[text>>attach:img.png]] | text | text |
Link to an attachment in a different page | See Attach Macro for details | [[text>>attach:Space.Page@img.png]] | text | text |
The full format of a link is (alias[|>])+(link)(@interWikiAlias)+([|>]target)+
The full format of a link is (label>>)?(link)(||parameters)*
Allows to easily create content in table format. It also support parameters for table, row or cell in XWiki Syntax 2.0.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result | ||||||
---|---|---|---|---|---|---|---|---|---|
Standard table | ((( {table} Title 1 | Title 2 Word 1 | Word 2 {table} ))) | |=Title 1|=Title 2 |Word 1|Word 2 !=Title 1!=Title 2 !!Word 1!!Word 2 |
| ||||||
Parametrized table | <table style="background-color:red;align:center"> | (% style="background-color:red;align=center" %) |=Title 1|=(% style="background-color:yellow" %)Title 2 |Word 1|Word 2 |
| ||||||
Filterable Sortable table | $xwiki.ssfx.use("js/xwiki/table/table.css") $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true) <table id="tableid" class="grid sortable filterable doOddEven"> <tr class="sortHeader"> <th>Title1</th> <th>Title2</th> </tr> <tr> <td>Cell11</td> <td>Cell12</td> </tr> <tr> <td>Cell21</td> <td>Cell22</td> </tr> </table> | {{velocity}} $xwiki.ssfx.use("js/xwiki/table/table.css") $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true) {{/velocity}} {{html}} <table id="tableid" class="grid sortable filterable doOddEven"> <tr class="sortHeader"> <th>Title1</th> <th>Title2</th> </tr> <tr> <td>Cell11</td> <td>Cell12</td> </tr> <tr> <td>Cell21</td> <td>Cell22</td> </tr> </table> {{/html}} |
|
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|---|---|---|
Image from attachment in current page | See Image Macro for details | image:img.png | ![]() |
Image from attachment in another document | {image:img.png|document=Space.Page} | image:Space.Page@img.png | ![]() |
Image with parameters | {image:img.png|width=25|height=25} | [[image:img.png||width="25" height="25"]] | ![]() |
Images located at URL | http://some/url/img.png | image:http://some/url/img.png | ![]() |
Allow to enter content that will not be formatted (in other words the wiki syntax will not be taken into account).
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result XWiki Syntax 1.0 | Result XWiki Syntax 2.0 |
---|---|---|---|---|
Verbatim inline | Some verbatim {pre}*[not rendered]*{/pre} content | Some verbatim {{{**[[not rendered]]**}}} content | Some verbatim *[not rendered]* content | Some verbatim **[[not rendered]]** content |
Verbatim block |
{pre}
multi line
*verbatim*
content
{/pre}
| {{{ multi line **verbatim** content }}} | multi line *verbatim* content | multi line **verbatim** content |
Allows to quote some text.
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|---|---|---|
Simple quote | <blockquote><p>john said this</p></blockquote> | > john said this I said ok |
I said ok |
Nested quotes | <blockquote><p>john said this</p> | > john said this >> marie answered that I said ok |
I said ok |
Groups can be used to insert another document inline directly into the current document. This allows for example to insert complex elements inside a list item or inside a table cell. Groups are delimited by the following syntactic elements: (((...))). One Group can contain another Group and there is no limit of imbrication.
XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result | ||||||
---|---|---|---|---|---|---|---|---|
This feature doesn't exist in XWiki syntax 1.0. You'd have to use pure HTML to achieve the result. | |=Header 1|=Header 2|=Header 3 |Cell One|((( = Embedded document Some embedded paragraph. * list item one * list item two ** sub-item 1 ** sub-item 2 ))) | Cell Three Next paragraph in the top-level document |
Next paragraph in the top-level document |
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result XWiki Syntax 1.0 | Result XWiki Syntax 2.0 |
---|---|---|---|---|
Escape a character | This is not a \[link\] | This is not a ~[~[link~]~] | This is not a [link] | This is not a [[link]] |
There are 2 kinds of macros in XWiki syntax 1.0:
There are also 2 kinds of macros in XWiki Syntax 2.0:
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 |
---|---|---|
Velocity Macro | #info("Some text") |
{{velocity}}{{html}}
#info("some text")
{{/html}}{{/velocity}} Starting with XE 2.0 you should use the Message Macro to implement this example. |
Radeox Macro/XWiki Macros | {code:java} java content {code} | {{code language="java"}} java content {{/code}} |
XWiki Syntax 1.0 | XWiki Syntax 2.0 | Result |
---|---|---|
<b>bold</b> | {{html}}<b>bold</b>{{/html}} | bold |
Feature | XWiki Syntax 1.0 | XWiki Syntax 2.0 |
---|---|---|
Velocity script | #set ($var = "whatever") | {{velocity}} #set ($var = "whatever") {{/velocity}} |
Groovy script | <% def var = "whatever" %> | {{groovy}} def var = "whatever" {{/groovy}} |
With XWiki Syntax 2.0 it's possible to pass parameters to the different syntax elements and also to blocks of text. This is used for example to style them. You can set any parameter key/value pair you want. The XHTML renderer will pass these parameters as XHTML attributes to the underlying XHTML representation of the different syntax elements. In XWiki Syntax 1.0 there was no syntax for passing parameters and the only way to do it was to write XHTML directly in the content as shown in the table below.
XWiki Syntax 1.0 | XWiki Syntax 2.0 | Generated XHTML |
---|---|---|
<h1 class="myClass" style="myStyle" id="myId">heading</h1> | (% class="myClass" style="myStyle" id="myId" %) = heading = | <h1 class="myClass" style="myStyle" id="myId">heading</h1> |
The following other syntaxes are implemented in XWiki Enterprise 1.6 and later: