XWiki Syntax Guide
XWiki Syntax 1.0
XWiki Syntax 1.0: All
General
Introduction
1.0 Introduction
The XWiki Syntax 1.0 was the first attempt to implement a Wiki-style Syntax in XWiki. It had some limitations and some formatting can only be achieved by inserting raw HTML. We recommend using the newer syntaxes; XWiki Syntax 1.0 is only supported for backwards compatibility.
In addition to the XWiki-specific syntaxes we've also changed our underlying rendering engine in XWiki 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.
Other Syntaxes
1.0 Other Syntaxes
Other syntaxes are also available.
Editing
Paragraphs
1.0 Paragraphs
Paragraphs are text elements separated by 2 or more new lines.
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Simple paragraph | This is a paragraph | This is a paragraph |
Paragraph on multiple lines | Paragraph on\\ multiple lines | Paragraph on multiple lines |
Two paragraphs | Paragraph one Paragraph two | Paragraph one Paragraph two |
Parametrized paragraph | <p style="text-align:center;color:blue">Centered and blue paragraph</p> | Centered and blue paragraph |
Headings
1.0 Headings
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Standard headings | 1 level 1 | level 1
level 2level 3level 4level 5level 6 |
Parameterized headings | <h1><span style="color:blue">Heading</span></h1> | heading |
Headings with XWiki Syntax | 1.1.1 Heading with *bold* | Heading with bold |
Text Formatting
1.0 Text Formatting
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Bold | *bold* | bold |
Underline | __underline___ | underline |
Italics | ~~italic~~ | italic |
Striked out | --strike-- | |
Monospace | <tt>monospace</tt> | monospace |
Superscript | some <sup>superscript</sup> | some superscript |
Subscript | some <sub>subscript</sub> | some subscript |
Horizontal Line
1.0 Horizontal Line
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Simple horizontal line | ---- | |
Parametrized horizontal line | <hr style="border-color:blue"/> |
Lists
1.0 Lists
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Bulleted list | * item 1 ** item 2 *** item 3 * item 4 |
|
Numbered list | 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 |
|
Square list | - item 1 - item 2 |
|
Disc list | <ul style="list-style-type: disc"> |
|
Lowercase Alphabetical list | a. item 1 a. item 2 |
|
Uppercase Alphabetical list | A. item 1 A. item 2 |
|
Lowercase Roman list | i. item 1 i. item 2 |
|
Uppercase Roman list | I. item 1 I. item 2 |
|
Lowercase Greek list | g. item 1 g. item 2 |
|
Uppercase Greek list | G. item 1 G. item 2 |
|
Hiragana list | h. item 1 h. item 2 |
|
Hiragana Iroha list | H. item 1 H. item 2 |
|
Katakana list | k. item 1 k. item 2 |
|
Katakana Iroha list | K. item 1 K. item 2 |
|
Armenian list | <ul style="list-style-type: armenian"> <li>item 1</li> <li>item 2</li> </ul> |
|
Hebrew list | j. item 1 j. item 2 |
|
Georgian list | <ul style="list-style-type: georgian"> <li>item 1</li> <li>item 2</li> </ul> |
|
CJK ideographic list | <ul style="list-style-type: cjk-ideographic"> <li>item 1</li> <li>item 2</li> </ul> |
|
Definition Lists
1.0 Definition Lists
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Standard definition | <dl> <dt>term</dt> <dd>definition</dd> </dl> |
|
Nested definitions | <dl> <dt>term 1</dt> <dd>definition 1 <dl> <dt>term 2</dt> <dd>definition 2</dd> </dl> </dd> </dl> |
|
Parametrized definition | <dl style="color:blue"> <dt>term</dt> <dd>definition</dd> </dl> |
|
New Line/Line Breaks
1.0 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.
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Line break | Line\\New line | Line New line |
New line | Line New line | Line New line |
Links
1.0 Links
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Link to a page in the current Space | [WebHome] | Web Home |
Link with a label | [label>WebHome] | label |
Link with XWiki Syntax in the label | <a href="$xwiki.getURL("WebHome")"><strong>bold label</strong></a> | bold label |
Link to a page with the space specified | [Main.WebHome] | Web Home |
Link to a subwiki | [subwiki:Main.WebHome] | Web Home |
Link that opens in a new window | [label>WebHome>_blank] | label |
Link to a URL directly in the text | This is a URL: https://xwiki.org | This is a URL: https://xwiki.org |
Link to a URL | [https://xwiki.org] | https://xwiki.org |
Link to a URL with a label | [XWiki>https://xwiki.org] | XWiki |
Link to an email address | [[email protected]>mailto:[email protected]] | [email protected] |
Image Link | <a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2}</a> | |
Image Link with image parameters | <a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2|width=26|height=26}</a> | |
Link to an attachment on the current page |
| |
Link to an attachment in a different page |
| |
Link to an Anchor in a page | [label>Space.Page#anchor] | label |
Link to a Heading in a page | [label>Space.Page#HMyheading] | label |
XWiki Syntax 1.0 Link Specification
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:[email protected]), or
- A wiki page reference in the form [[wikiName:] spaceNameList.] (pageName). Examples: WebHome, Main.WebHome, mywiki:Main.WebHome
- wikiName: An optional string containing the name of a wiki. The link will point to a page inside that wiki. Example: mywiki
- spaceNameList: An optional dot-separated list of wiki Space names. If no space is specified the current space is used. Examples: Main, A.B, A.B.C
- pageName: 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
- reference: The link reference. This can be either
- 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 Hhttps://TML 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
Tables
1.0 Tables
Allows to easily create content in table format.
Feature | XWiki Syntax 1.0 | Result | ||||||
---|---|---|---|---|---|---|---|---|
Standard table | {table} Title 1 | Title 2 Word 1 | Word 2 {table} |
| ||||||
Parametrized table | <table style="background-color:red;text-align:center"> |
| ||||||
Filterable Sortable table | $xwiki.ssfx.use("js/xwiki/table/table.css") $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true) <table id="table1id" 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> |
|
Images
1.0 Images
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Image from attachment on current page |
| |
Image from attachment on another page | {image:img.png|document=Space.Page} | |
Image with parameters | {image:img.png|width=25|height=25} | |
Images located at URL | https://some/url/img.png |
Advanced
Verbatim
1.0 Verbatim
Allow to enter content that will not be formatted (in other words the XWiki Syntax will not be taken into account).
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Verbatim inline | Some verbatim {pre}*[not rendered]*{/pre} content | Some verbatim *[not rendered]* content |
Verbatim block |
{pre}
multi line
*verbatim*
content
{/pre}
| multi line *verbatim* content |
Quotations
1.0 Quotations
Allows to quote some text.
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Simple quote | <blockquote><p>john said this</p></blockquote> |
I said ok |
Nested quotes | <blockquote><p>john said this</p> |
I said ok |
Escapes
1.0 Escapes
Allows to escape XWiki Syntax.
Feature | XWiki Syntax 1.0 | Result |
---|---|---|
Escape a character | This is not a \[link\] | This is not a [link] |
Parameters
1.0 Parameters
In XWiki Syntax 1.0 there is 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 | Generated XHTML |
---|---|
<h1 class="myClass" style="myStyle" id="myId">heading</h1> | <h1 class="myClass" style="myStyle" id="myId">heading</h1> |
Programming
Macros
1.0 Macros
There are two 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)
Feature | XWiki Syntax 1.0 |
---|---|
Velocity Macro | #info("Some text") |
Radeox Macro | {code:java} java content {code} |
HTML
1.0 HTML
XWiki Syntax 1.0 | Result |
---|---|
<abbr title="HyperText Markup Language">HTML</abbr> | HTML |
Scripts
1.0 Scripts
Feature | XWiki Syntax 1.0 |
---|---|
Velocity script | #set ($var = "whatever") |
Groovy script | <% def var = "whatever" %> |