XWiki Syntaxes

Last modified by Administrator on 2012/05/23 12:34

Starting with XWiki Enterprise version 1.7 we've introduced a new wiki syntax. We've named the old syntax the XWiki Syntax 1.0 and the new syntax was logically called the XWiki Syntax 2.0. The main reasons for introducing the new syntax were:

  • Fix the limitations and ambiguities of the XWiki Syntax 1.0 (which was inspired by both Radeox - the underlying rendering engine - and TWiki).
    • Not optimal symbols. For example the symbol for bold was single stars. This was causing trouble when users were entering text containing stars since that text was mistakenly considered to be bold when it wasn't. Hence we've rationalized the syntax by using at least double characters everywhere. 
    • Ambiguities. For example there was an ambiguity between a bold item starting a line and a bulletted list. Resolving the ambiguities was required in order to rewrite the WYSIWYG editor so that it could be deterministic.
  • Be closer to the Creole 1.0 syntax which is becoming a standard for wiki syntax. In addition the Creole community has taken the time to analyze all the existing wiki syntaxes before deciding on symbols. The choices made are thus very good.

Since the introduction of XWiki Syntax 2.0 a few shortcomings of this syntax have been found. To fix these a new, as of now experimental, XWiki Syntax 2.1 was introduced in XWiki Enterprise version 3.0. Some reason for the development of this new syntax are:

  • Homogenize the link and image syntax for better clarity, consistency and extensibility.
  • Added ability to display icons,  to link to files using the UNC notation and to link to relative URLs.
Since XWiki Syntax 2.1 is based on XWiki Syntax 2.0 all syntax from XWiki Syntax 2.0 is valid unless the 2.1 specifications suggest differently.

In addition to these XWiki-specific syntaxes we've also changed our underlying rendering engine in XWiki Enterprise version 1.7 (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.

General Remarks

XWiki Syntax 2.0 corrects some errors or ambiguous syntax entered by the user as shown in the examples in the table below.

DescriptionExample of invalid or ambiguous syntaxFixed XWiki Syntax 2.0
Unclosed text 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 linesparagraph
----
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

Paragraphs are text elements separated by 2 or more new lines.

In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole Syntax.
FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result XWiki Syntax 1.0Result XWiki Syntax 2.0
Simple paragraphThis is a paragraphThis is a paragraphThis is a paragraphThis is a paragraph
Paragraph on multiple linesParagraph on\\
multiple lines
Paragraph on
multiple lines
Paragraph on
multiple lines
Paragraph on
multiple lines
Two paragraphsParagraph 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

Headings

FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result
Standard headings

1 level 1
1.1 level 2
1.1.1 level 3
1.1.1.1 level 4
1.1.1.1.1 level 5
1.1.1.1.1.1 level 6

= level 1 = 
== level 2 ==
=== level 3 ===
==== level 4 ====
===== level 5 =====
====== level 6 ======

level 1

 

level 2

level 3

level 4

level 5
level 6
Parametrized headings<h1><span style="color:blue">heading</span></h1>(% style="color:blue" %)
= heading =

heading

Headings with XWiki Syntax1.1.1 Heading with *bold*=== Heading with **bold** ===

Heading with bold

Text Formatting

New in XWiki Syntax 2.0 over XWiki Syntax 1.0:

  • Spaces are allowed just after the syntax symbols (for example in XWiki Syntax 1.0, this was not possible: * bold *).
  • Use double symbols when there was only a single symbol in XWiki Syntax 1.0 so that it's less likely that the user will mistakenly use them in text.
  • Ability to span several lines (wasn't possible in XWiki Syntax 1.0).
FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result
Bold*bold***bold**bold
Underline__underline_____underline__underline
Italics~~italic~~//italic//italic
Striked out--strike----strike--strike
Monospace<tt>monospace</tt>##monospace##monospace
Superscriptsome <sup>superscript</sup>some ^^superscript^^some superscript
Subscriptsome <sub>subscript</sub>some ,,subscript,,some subscript

Horizontal Line

There must be 4 or more dashes.
Note that this is different from Creole where exactly 4 dashes are required.
FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result
Simple horizontal line--------

Parametrized horizontal line<hr style="color:blue"/>
(% style="color:blue" %)
----

Lists

Some of the mentioned styles do not work on all browsers. For a comprehensive list follow this link.
FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result
Bulleted list
* item 1
** item 2
*** item 3
* item 4
* 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
  1. item 1
    1. item 2
      1. item 3
  2. 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
  1. item 1
    • item 2
    • item 3
  2. item 4
Square list
- item 1
- item 2
(% style="list-style-type: square" %)
* item 1
* item 2
  • item 1
  • item 2
Disc list

<ul style="list-style-type: disc">
  <li>item 1</li>
  <li>item 2</li>
</ul>

(% style="list-style-type: disc" %)
* item 1
* item 2
  • item 1
  • item 2
Lowercase Alphabetical list
a. item 1
a. item 2
(% style="list-style-type: lower-alpha" %)
* item 1
* item 2
  • item 1
  • item 2
Uppercase Alphabetical list
A. item 1
A. item 2
(% style="list-style-type: upper-alpha" %)
* item 1
* item 2
  • item 1
  • item 2
Lowercase Roman list
i. item 1
i. item 2
(% style="list-style-type: lower-roman" %)
* item 1
* item 2
  • item 1
  • item 2
Uppercase Roman list
I. item 1
I. item 2
(% style="list-style-type: upper-roman" %)
* item 1
* item 2
  • item 1
  • item 2
Lowercase Greek list
g. item 1
g. item 2
(% style="list-style-type: lower-greek" %)
* item 1
* item 2
  • item 1
  • item 2
Uppercase Greek list
G. item 1
G. item 2
(% style="list-style-type: upper-greek" %)
* item 1
* item 2
  • item 1
  • item 2
Hiragana list
h. item 1
h. item 2
(% style="list-style-type: hiragana" %)
* item 1
* item 2
  • item 1
  • item 2
Hiragana Iroah list
H. item 1
H. item 2
(% style="list-style-type: hiragana-iroha" %)
* item 1
* item 2
  • item 1
  • item 2
Katakana list
k. item 1
k. item 2
(% style="list-style-type: katakana" %)
* item 1
* item 2
  • item 1
  • item 2
Katakana Iroha list
K. item 1
K. item 2
(% style="list-style-type: katakana-iroha" %)
* item 1
* item 2
  • item 1
  • item 2
Armenian list
<ul style="list-style-type: armenian">
  <li>item 1</li>
  <li>item 2</li>
</ul>
(% style="list-style-type: armenian" %)
* item 1
* item 2
  • item 1
  • item 2
Hebrew list
j. item 1
j. item 2
(% style="list-style-type: hebrew" %)
* item 1
* item 2
  • item 1
  • item 2
Georgian list
<ul style="list-style-type: georgian">
  <li>item 1</li>
  <li>item 2</li>
</ul>
(% style="list-style-type: georgian" %)
* item 1
* item 2
  • item 1
  • item 2
CJK ideographic list
<ul style="list-style-type: cjk-ideographic">
  <li>item 1</li>
  <li>item 2</li>
</ul>
(% style="list-style-type: cjk-ideographic" %)
* item 1
* item 2
  • item 1
  • item 2

Definition Lists

FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result
Standard definition
<dl>
  <dt>term</dt>
  <dd>definition</dd>
</dl>
; term
: definition
term
definition
Nested definitions
<dl>
  <dt>term 1</dt>
  <dd>definition 1
    <dl>
      <dt>term 2</dt>
      <dd>definition 2</dd>
    </dl>
  </dd>
</dl>
; term 1
: definition 1
:; term 2
:: definition 2
term 1
definition 1
term 2
definition 2
Parametrized definition
<dl style="color:blue">
  <dt>term</dt>
  <dd>definition</dd>
</dl>
(% style="color:blue" %)
; term
: definition
term
definition

New Line/Line breaks

A new line is a carriage return. A line break is a forced new line that can appear anywhere in the text.

In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole Syntax.
FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result XWiki Syntax 1.0Result XWiki Syntax 2.0
Line breakLine\\New lineLine\\New lineLine
New line
Line
New line
New lineLine
New line
Line
New line
Line New lineLine
New line

Links

FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result XWiki Syntax 1.0Result XWiki Syntax 2.0
Link to a page in the current Space[WebHome][[WebHome]]Web HomeWebHome
Link with a label[label>WebHome]

[[label>>WebHome]]
XWiki Syntax is supported inside link labels.

labellabel
Link with XWiki Syntax in the label<a href="$xwiki.getURL("WebHome")"><strong>bold label</strong></a>[[**bold label**>>WebHome]]bold labelbold label
Link to a page with the space specified[Main.WebHome][[Main.WebHome]]Web HomeWebHome
Link to a subwiki[subwiki:Main.WebHome][[subwiki:Main.WebHome]]Web HomeWebHome
Link that opens in a new window[label>WebHome>_blank][[label>>WebHome||rel="__blank"]]labellabel
Link to a URL directly in the textThis is a URL: http://xwiki.orgThis is a URL: http://xwiki.orgThis is a URL: http://xwiki.orgThis is a URL: http://xwiki.org
Link to a URL[http://xwiki.org][[http://xwiki.org]]http://xwiki.orghttp://xwiki.org
Link to a URL with a label[XWiki>http://xwiki.org][[XWiki>>http://xwiki.org]]XWikiXWiki
Link to an email address[john@smith.net>mailto:john@smith.net][[john@smith.net>>mailto:john@smith.net]]john@smith.netjohn@smith.net
Image Link<a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2}</a>[[image:Space2.Page2@img.png>>Space1.Page1]]img.pngimg.png
Image Link with image parameters<a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2|width=26|height=26}</a>[[[[image:Space2.Page2@img.png||width="26" height="26"]]>>Space1.Page1]]img.pngimg.png
Link to an attachment on the current page

See Attach Macro for details
{attach:text|file=img.png}

[[text>>attach:img.png]]texttext
Link to an attachment in a different page

See Attach Macro for details
{attach:text|document=Space.Page|file=img.png}

[[text>>attach:Space.Page@img.png]]texttext
Link to an Anchor in a page[label>Space.Page#anchor][[label>>Space.Page#anchor]]labellabel
Link to a Heading in a page

When you add a Heading, an anchor named "H" followed by the heading title with only alpha characters is created. For example, for a Heading named "My heading", the generated anchor will be "HMyheading".
[label>Space.Page#HMyheading]

[[label>>Space.Page#HMyheading]]labellabel

XWiki Syntax 1.0 Link Specification

Part in ( ) is required, parts in [ ] are optional and one of the two chars in { } needs to be added if optional parts are being used.

The full format of a link is [label {> or |}] (resource) [@interWikiAlias] [{> or |} target]

  • label: An optional string which will be displayed to the user as the link name when rendered. Example: My Page
  • resource: The full link reference using the following syntax: (reference) [?queryString] [#anchor]
    • reference: The link reference. This can be either
      • A URI in the form protocol:path (examples: http://xwiki.org, mailto:john@smith.com), or
      • A wiki page reference in the form [[wikiName:] space.] (page). Examples: WebHome, Main.WebHome, mywiki:Main.WebHome
        • wikiName: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: mywiki
        • space: An optional wiki Space name. If no space is specified the current space is used. Example: Main
        • page: A required string containing the name of the linked wiki page. Example: WebHome
    • queryString: An optional query string for specifying parameters that will be used in the rendered URL. Example: mydata1=5&mydata2=Hello
    • anchor: An optional anchor name pointing to an anchor defined in the referenced link. Note that in XWiki anchors are automatically created for headings. Example: HTableOfContents
  • interWikiAlias: An optional Inter Wiki alias as defined in the InterWiki Map (see the Admin Guide). This is only valid for wiki page names. Example: wikipedia
  • target: An optional string corresponding to the HTML target attribute for a HTML A link element. This element is used when rendering the link. It defaults to opening the link in the current window. Examples: _self, _blank

XWiki Syntax 2.0 Link Specification

The part in ( ) is required, while the parts in [ ] are optional.

The full format of a link is [label>>] (resource) [@interWikiAlias] [||parameters]

  • label: An optional string which will be displayed to the user as the link name when rendered. The label may contain XWiki Syntax. If no label is specified a default label will be generated. The generation pattern can be changed, see the Admin Guide. Example: My Page
  • resource: The full link reference using the following syntax: (reference) [?queryString] [#anchor]
    • reference: The link reference in one of the following forms:
      • URL: Any URL in the form of protocol://path. Examples: http://xwiki.org, https://svn.xwiki.org/
      • Wiki page name reference in the form [[wikiName:] space.] (page). Examples: WebHome, Main.WebHome, mywiki:Main.WebHome
        • wikiName: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: mywiki
        • space: An optional wiki Space name. If no space is specified the current space is used. Example: Main
        • page: A required string containing the name of the linked wiki page. Example: WebHome
      • Attachment reference in the form attach: [wikiPageName@] (attachmentName). Examples: attach:img.png, attach:mywiki:Main.WebHome@img.png
        • attach:: A required string identifying the resource as attachment.
        • wikiPageName: An optional string referencing the document that holds the attachment, see "Wiki page name" above.
        • attachmentName: Name of the attachment as it is stored in the wiki.
      • Email address in the form mailto: (emailAddress) (#anchor is not valid). Example: mailto:john@smith.com
        • mailto:: A required string identifying the resource as email.
        • emailAddress: Targeted email address. Example: "john@smith.com"
    • queryString: An optional query string for specifying parameters that will be used in the rendered URL. Example: mydata1=5&mydata2=Hello
    • anchor: An optional anchor name pointing to an anchor defined in the referenced link. Note that in XWiki anchors are automatically created for headings. Example: HTableOfContents
  • interWikiAlias: An optional Inter Wiki alias as defined in the InterWiki Map (see the Admin Guide). This is only valid for wiki page names. Example: wikipedia
  • parameters: An optional list of parameters passed to the link. Example: rel="__blank" (open in new window)

XWiki Syntax 2.1 Link Specification

The part in ( ) is required, while the parts in [ ] are optional.

The full format of a link is [label>>] (resource) [||parameters]

  • label: An optional string which will be displayed to the user as the link name when rendered. The label may contain XWiki Syntax. If no label is specified a default label will be generated. The generation pattern can be changed, see the Admin Guide. Example: My Page
  • resource: A required string with the link reference in one of the following forms
    • URL: Any URL in the form of [url:] (protocol://path). Examples: http://xwiki.org, url:https://svn.xwiki.org/
      • url: An optional string identifying the resource as an URL.
    • Wiki page name reference in the form [doc:] [[wikiName:] space.] (page). Examples: WebHome, Main.WebHome, mywiki:Main.WebHome
      • doc: An optional string identifying the resource as an XWiki document.
      • wikiName: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: mywiki
      • space: An optional wiki Space name. If no space is specified the current space is used. Example: Main
      • page: A required string containing the name of the linked wiki page. Example: WebHome
    • InterWiki page name reference in the form interwiki: (interWikiAlias:) (page). Example: interwiki:wikipedia:XWiki
      • interwiki: A required string identifying the resource as an InterWiki link.
      • interWikiAlias: An optional Inter Wiki alias as defined in the InterWiki Map (see the Admin Guide). Example: wikipedia
      • page: A required string containing the name of the linked page. Example: XWiki
    • Attachment reference in the form attach: [wikiPageName@] (attachmentName). Examples: attach:img.png, attach:mywiki:Main.WebHome@img.png
      • attach:: A required string identifying the resource as attachment.
      • wikiPageName: An optional string referencing the document that holds the attachment, see "Wiki page name" above.
      • attachmentName: Name of the attachment as it is stored in the wiki.
    • Email address in the form mailto: (emailAddress) (#anchor is not valid). Example: mailto:john@smith.com
      • mailto:: A required string identifying the resource as email.
      • emailAddress: Targeted email address. Example: john@smith.com
    • Relative path reference on the server in the form path: (relPath). Example: path:$doc.getURL('reset') produces target address http://server.domain.com/xwiki/bin/reset/Space/Page where /xwiki/bin/reset/Space/Page is produced by $doc.getURL('reset').
      • path: A required string identifying the resource as a relative path.
      • relPath: A required string containing the relative path of the resource on the server that shall be linked.
    • UNC (Windows Explorer) reference in the form unc: (path). The link is rendered as a file:// link. Examples: unc:C:\Windows\, unc:\\myserver\path\img.png, unc:home/user/somefile
      • unc: A required string identifying the resource as a UNC (Windows Explorer) path.
      • path: A required string containing the local path of resource accessible by the user. Examples: C:\Windows\, \\myserver\path\img.png, home/user/somefile
  • parameters: An optional list of space-separated parameters passed to the link. Example: queryString="mydata1=5&mydata2=Hello" anchor="HTableOfContents" rel="__blank"
    • queryString: An optional query string for specifying parameters that will be appended to the link target address and used in the rendered URL. Example: url:http://domain.com/path||queryString="mydata1=5&mydata2=Hello" produces target address http://domain.com/path?mydata1=5&mydata2=Hello
    • anchor: An optional anchor name pointing to an anchor defined in the referenced link. Note that in XWiki anchors are automatically created for headings. Example: url:http://domain.com/path||anchor="HTableOfContents" produces target address http://domain.com/path#HTableOfContents
    • rel: An optional parameter that allows to open link target in new window. Example: rel="__blank"

Tables

Allows to easily create content in table format. Parameters for table, row or cell are also supported in XWiki Syntax 2.0.

FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result
Standard table
{table}
Title 1 | Title 2
Word 1 | Word 2
{table}
|=Title 1|=Title 2
|Word 1|Word 2
or
!=Title 1!=Title 2
!!Word 1!!Word 2
Title 1Title 2
Word 1Word 2
Parametrized table

<table style="background-color:red;align:center">
  <tbody>
    <tr>
      <td>Title 1</td>
      <td style="background-color:yellow">Title 2</td>
    </tr>
    <tr>
      <td>Word 1</td>
      <td>Word 2</td>
    </tr>
  </tbody>
</table>

(% style="background-color:red;align=center" %)
|=Title 1|=(% style="background-color:yellow" %)Title 2
|Word 1|Word 2
Title 1Title 2
Word 1Word 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>Title 1</th>
    <th>Title 2</th>
  </tr>
  <tr>
   <td>Cell 11</td>
   <td>Cell 12</td>
  </tr>
  <tr>
   <td>Cell 21</td>
   <td>Cell 22</td>
  </tr>
</table>
For improved features see the Livetable Macro.
{{velocity}}
$xwiki.ssfx.use("js/xwiki/table/table.css")
$xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
{{/velocity}}

(% class="grid sortable filterable doOddEven" id="tableid" %)
(% class="sortHeader" %)|=Title 1|=Title 2
|Cell 11|Cell 12
|Cell 21|Cell 22
For improved features see the Livetable Macro.
Title 1Title 2
Cell 11Cell 12
Cell 21Cell 22

Images

FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result
Image from attachment on current page

See Image Macro for details
{image:img.png}

image:img.pngimg.png
Image from attachment on another page{image:img.png|document=Space.Page}image:Space.Page@img.pngimg.png
Image with parameters{image:img.png|width=25|height=25}[[image:img.png||width="25" height="25"]]img.png
Images located at URLhttp://some/url/img.pngimage:http://some/url/img.pngimg.png

XWiki Syntax 2.0 Image Specification

The part in ( ) is required, while the parts in { } are optional.

The full format of an image is either image: (reference) or [[image: (reference) {||parameters}]]

  • image: A required string identifying the resource as image.
  • reference: The reference to the image that shall be displayed in one of the following forms:
    • URL: Any URL to an image in the form of http://path/imageName. Example: http://domain.org/path/img.png
    • Attachment reference in the form {{{wikiName:} space.} page@} (imageName)
      • wikiName: An optional string containing the name of a virtual wiki. The image reference will point to an image attached to a page inside that virtual wiki. Example: mywiki
      • space: An optional wiki Space name. If no space is specified the current space is used. Example: Main
      • page: An optional string containing the name of the wiki page to which the referenced image is attached. Example: WebHome
      • imageName: A required string containing the name of the image attached to a page as it is stored in the wiki.
  • parameters: An optional list of space-separated parameters passed to the image. Example: width="800" height="600" alt="img.png" title="My nice image"
    • HTML attributes: All attributes defined by the HTML standard will be added to the rendered HTML <img> tag.
      • style: CSS style information that should be applied to the image. Examples: style="float:right;height:50" (image on right side, height 50 px), style="style="display:block;margin-left:auto;margin-right:auto;width:80%" (image centered, width 80% of block width), style="vertical-align:bottom" (text starts at bottom of picture)
      • height: A parameter that defines the height of the displayed image. The value should be presented either in pixel (example: height="80") or in pixel related to the height of the block containing the image (example: height="40%").
      • width: A parameter that defines the width of the displayed image. The value should be presented either in pixel (example: width="80") or in pixel related to the width of the block containing the image (example: width="40%").
      • title: A parameter that defines the title the displayed image which will be visible when hovering the mouse trigger over the image, for instance. Example: title="My nice image"
      • alt: A parameter that defines which text should be displayed if the browser is not able to display the image. Since this is a required HTML attribute XWiki will use the file name instead if the alt parameter is not defined. Example: alt="img.png"
      • More: A more in depth explanation on the HTML <img> tag including more attributes can be reviewed on w3.org.

XWiki Syntax 2.1 Image Specification

The part in ( ) is required, while the parts in { } are optional.

The full format of an image is either image: (reference) or [[image: (reference) {||parameters}]]

  • image: A required string identifying the resource as image.
  • reference: The reference to the image that shall be displayed in one of the following forms:
    • URL: Any URL to an image in the form of protocol://path/imageName. Example: http://domain.org/path/img.png
    • Attachment reference in the form {{{wikiName:} space.} page@} (imageName)
      • wikiName: An optional string containing the name of a virtual wiki. The image reference will point to an image attached to a page inside that virtual wiki. Example: mywiki
      • space: An optional wiki Space name. If no space is specified the current space is used. Example: Main
      • page: An optional string containing the name of the wiki page to which the referenced image is attached. Example: WebHome
      • imageName: A required string containing the name of the image attached to a page as it is stored in the wiki.
    • Icon reference in the form (icon:) (iconName). Example: icon:accept
      • icon: A required string identifying the image reference as an icon from the XWiki Icon Set.
      • iconName: A required string identifying the icon referenced. Example: accept
  • parameters: An optional list of space-separated parameters passed to the image. Example: width="800" height="600" alt="img.png" title="My nice image"
    • HTML attributes: All attributes defined by the HTML standard will be added to the rendered HTML <img> tag.
      • style: CSS style information that should be applied to the image. Examples: style="float:right;height:50" (image on right side, height 50 px), style="style="display:block;margin-left:auto;margin-right:auto;width:80%" (image centered, width 80% of block width), style="vertical-align:bottom" (text starts at bottom of picture)
      • height: A parameter that defines the height of the displayed image. The value should be presented either in pixel (example: height="80") or in pixel related to the height of the block containing the image (example: height="40%").
      • width: A parameter that defines the width of the displayed image. The value should be presented either in pixel (example: width="80") or in pixel related to the width of the block containing the image (example: width="40%").
      • title: A parameter that defines the title the displayed image which will be visible when hovering the mouse trigger over the image, for instance. Example: title="My nice image"
      • alt: A parameter that defines which text should be displayed if the browser is not able to display the image. Since this is a required HTML attribute XWiki will use the file name instead if the alt parameter is not defined. Example: alt="img.png"
      • More: A more in depth explanation on the HTML <img> tag including more attributes can be reviewed on w3.org.
    • queryString: Allows queries to be passed to the server when creating the download link for the referenced image. Example: queryString="width=100&height=800&keepAspectRatio=true" (keepAspectRatio=true will fail if the width and height parameters are specified in addition to queryString!)

Verbatim

Allow to enter content that will not be formatted (in other words the XWiki Syntax will not be taken into account).

In XWiki Syntax 1.0 the Pre macro only preserves XWiki Syntax and Radeox macros. However HTML snippets and Groovy/Velocity scripts are still executed.
FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result XWiki Syntax 1.0Result XWiki Syntax 2.0
Verbatim inlineSome verbatim {pre}*[not rendered]*{/pre} contentSome verbatim {{{**[[not rendered]]**}}} contentSome verbatim *[not rendered]* contentSome verbatim **[[not rendered]]** content
Verbatim block

{pre} multi line *verbatim* content {/pre}
It's also possible to use the Code macro but it displays its content in a box by default.

{{{
multi line
**verbatim**
content
}}}
multi line
*verbatim*
content
multi line
**verbatim**
content

Quotations

Allows to quote some text.

FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result
Simple quote

<blockquote><p>john said this</p></blockquote>
I said ok

> john said this
I said ok

 john said this

I said ok

Nested quotes

<blockquote><p>john said this</p>
  <blockquote><p>marie answered that</p></blockquote>
</blockquote>
I said ok 

> john said this
>> marie answered that
I said ok

 john said this

 marie answered that

I said ok

Groups

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.0XWiki Syntax 2.0Result
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
Header 1Header 2Header 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

Escapes

Allows to escape XWiki Syntax.

FeatureXWiki Syntax 1.0XWiki Syntax 2.0Result XWiki Syntax 1.0Result XWiki Syntax 2.0
Escape a characterThis is not a \[link\]

This is not a ~[~[link~]~]
To enter a ~ character use a double escape: ~~

This is not a [link]This is not a [[link]]

Macros

There are 2 kinds of macros in XWiki Syntax 1.0:

  • Velocity macros (called using the #macroname(param1 ... paramN) syntax)
  • Radeox macros (called using the {macroname:param1=value1|...|paramN=valueN} syntax)

There are also 2 kinds of macros in XWiki Syntax 2.0:

  • Velocity macros (called using the #macroname(param1 ... paramN) syntax inside the Velocity Macro)
  • XWiki macros (called using the {{macroname param1="value1" ... paramN="valueN"}} syntax)
The Radeox macros cannot be used in XWiki Syntax 2.0. Thus they have been rewritten as XWiki macros.
For the full list of available macros check the Extensions wiki.
FeatureXWiki Syntax 1.0XWiki Syntax 2.0
Velocity Macro
#info("Some text")
{{info}}
Some text
{{/info}}
Radeox Macro/XWiki Macro
{code:java}
java content
{code}
{{code language="java"}}
java content
{{/code}}

HTML

In XWiki Syntax 2.0 HTML or XHTML must be entered by using the HTML macro whereas in XWiki Syntax 1.0 it's possible to enter HTML directly in the text.
XWiki Syntax 1.0XWiki Syntax 2.0Result
<b>bold</b>{{html}}<b>bold</b>{{/html}}bold
In XWiki Syntax 2.0, by default the HTML macro does not understands XWiki Syntax (other macros included since it's XWiki Syntax too). To enable it, use {{html wiki="true"}}.

Velocity/Groovy Scripts

In XWiki Syntax 1.0 it was possible to enter Velocity scripts anywhere directly in the page. This lead to issues for example when the user was involuntarily entering Velocity content. It was also performance hungry for pages not requiring Velocity content. There were several other technical limitations. Thus in XWiki Syntax 2.0 Velocity scripts must be entered using the velocity macro. Same goes for entering Groovy scripts.
FeatureXWiki Syntax 1.0XWiki Syntax 2.0
Velocity script
#set ($var = "whatever")
{{velocity}}
#set ($var = "whatever")
{{/velocity}}
Groovy script
<%
def var = "whatever"
%>
{{groovy}}
def var = "whatever"
{{/groovy}}

Parameters

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.0XWiki Syntax 2.0Generated 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>

Other syntaxes

The following other syntaxes are implemented in XWiki Enterprise 1.6 and later:

The implementation for these syntaxes is not fully finished yet. For example support for links is not working perfectly yet. We also need to define if we want to extend the original syntaxes to support XWiki-specific features like ability to link to another sub-wiki.
Tags:
Created by Administrator on 2008/02/20 22:36

Recently Modified

 | harini

Tag Cloud

  1. *nix
  2. 6.1.0.1
  3. 7.0.0.3
  4. 7.1
  5. 71 upgrade
  6. accounts payable
  7. Acquisition
  8. acquisition framework
  9. ActiveMQ
  10. address
  11. admin
  12. agreement
  13. AHS Projects
  14. alternative
  15. analyzer
  16. annotation date
  17. architecture diagram
  18. archived
  19. assessment
  20. assessments
  21. asset
  22. authenticated
  23. B3 BizCubed Way
  24. b3 managed services
  25. BA Client
  26. BA1000
  27. backup
  28. baseline
  29. beer
  30. BI server cache
  31. biserver
  32. bitbucket
  33. bizcubedlogo
  34. boost
  35. Boost Juice
  36. branding
  37. brew
  38. brightcove
  39. bug fix
  40. build
  41. building manager
  42. business analytics
  43. bzr
  44. calculated
  45. CalculatedMemberProperty
  46. Calendar
  47. careflight validation
  48. catalogue
  49. certification
  50. chrome
  51. cifs
  52. client information y7
  53. clients
  54. colo
  55. commands
  56. comparison
  57. compile
  58. completion
  59. computer
  60. conference
  61. configuration
  62. connection
  63. control framework
  64. core business
  65. courses
  66. credit cards
  67. CRM
  68. cryptography
  69. css
  70. custom training
  71. data acquisition
  72. data retention
  73. data services
  74. data source
  75. data-integration-server
  76. datamap
  77. Date
  78. date filtering
  79. date range
  80. Day
  81. de bortoli
  82. default assignee
  83. delete
  84. delivery
  85. depricated
  86. dev
  87. dev lifecycle
  88. development
  89. devstorage
  90. DI
  91. DI Server Set Up
  92. dimension
  93. distinct capability
  94. draft
  95. eclipse
  96. edit defaults
  97. ehcache
  98. email
  99. Emails
  100. employee details
  101. enabled analytics
  102. env
  103. epygi
  104. Escalation
  105. eset
  106. ETL
  107. ETL build specsavers
  108. execute transformation
  109. execution
  110. export
  111. extension
  112. external
  113. Facebook
  114. Facebook Acquisition
  115. facebook page
  116. facebook post
  117. FAZ001
  118. FAZ002
  119. fde
  120. file sharing
  121. fiscal
  122. flurry
  123. flurry Acquisition
  124. fmg
  125. folder structure
  126. framework
  127. geo
  128. git
  129. grand
  130. Grid
  131. guidelines
  132. hadoop
  133. home
  134. homebrew
  135. hourly
  136. https
  137. human resources
  138. hyperlink
  139. ide
  140. iinet
  141. image cache
  142. import
  143. Infobright
  144. integration
  145. internal
  146. internode
  147. invoicing
  148. IOOF
  149. IOOF refresh from production
  150. IoT
  151. IT Support
  152. ivy
  153. jce
  154. jdbc
  155. jira
  156. JIRA Labels
  157. JMS
  158. jndi
  159. Kettle
  160. keytool
  161. knowledge
  162. late files
  163. LDAP
  164. lead consultant
  165. level 2
  166. level 3
  167. license management
  168. linux
  169. locking
  170. locking revenue
  171. logging
  172. logo
  173. longform
  174. LVM
  175. managed service
  176. management.bizcubed
  177. management7
  178. map
  179. marketingnotes
  180. md5
  181. MDX
  182. measures
  183. meeting
  184. meeting rooms
  185. member
  186. members
  187. memory
  188. Messaging
  189. metastore
  190. metastore explorer
  191. metrics
  192. microsoft
  193. migration
  194. minutes
  195. monitoring system
  196. move to prod
  197. move to production
  198. multiplier
  199. mvn
  200. nas
  201. new users
  202. notebook
  203. nprs
  204. odbc
  205. office
  206. OLD
  207. onedrive
  208. onlinetraining
  209. operations
  210. OPZ001
  211. orange team
  212. org chart
  213. organisational structure
  214. partitionschema
  215. payroll
  216. PDI
  217. pentaho backup
  218. pentaho dataservices
  219. Pentaho leads
  220. pentaho reverse proxy
  221. persona
  222. phone
  223. Phone Conversations
  224. pipe
  225. png
  226. PO Box
  227. POC
  228. post mortem
  229. post office
  230. pre-requisites
  231. priority
  232. process
  233. prodmgt
  234. project
  235. project plan
  236. Project Report
  237. project template
  238. proof of concept
  239. properties
  240. prototype
  241. proxy
  242. prpt cache
  243. PUC
  244. purple team
  245. raft email acquisition
  246. reconcile
  247. reconciliation
  248. red team
  249. ReferenceError
  250. register
  251. registry
  252. reimbursement
  253. relative
  254. renewal
  255. replication
  256. Report
  257. resize
  258. resolution
  259. restart biserver
  260. restore
  261. Retail Zoo
  262. review
  263. roles
  264. rsa
  265. runner
  266. samba
  267. samples
  268. sanity checklist
  269. saz
  270. SAZ001
  271. scentre
  272. scope
  273. scope management
  274. scripts
  275. sev1
  276. severity
  277. share
  278. shell scripts
  279. shorewall
  280. signature block
  281. skills
  282. skills register
  283. slaveserver
  284. software
  285. sol1
  286. solutions architect
  287. specsavers
  288. sslmode
  289. standard
  290. standard config changes
  291. standards
  292. start
  293. startup
  294. stop
  295. streamhub api
  296. subscription
  297. subtotal
  298. support cases
  299. swiftfox
  300. symbolic links
  301. synology
  302. team meeting
  303. teleconference
  304. teleconferencing
  305. telephone
  306. templates
  307. tenders
  308. test
  309. testing
  310. testing framework
  311. ticket
  312. Timesheets
  313. to delete
  314. tomcat
  315. tools
  316. total
  317. training
  318. Transformations
  319. tree
  320. tweaks
  321. Ubuntu
  322. unregistered process
  323. update
  324. upgrades
  325. validation
  326. vault
  327. vcenter
  328. virtual machine
  329. virtual tables
  330. vision
  331. vitual machine
  332. vlan
  333. VM
  334. vnc
  335. vsphere
  336. weekly
  337. wiki
  338. work instruction
  339. workflow
  340. working from home
  341. worklog
  342. wotif
  343. xero
  344. y7
  345. y7 processes
  346. yahoo
  347. yahoo!7
  348. yahoo!7 client information
  349. yahoo7
  350. zero
  351. zimbra
  352. ZooBI
  353. zsa
  354. ZSA001

This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 3.5.1 - Documentation