XWiki Syntax 2.1
The XWiki Syntax 2.0 has proven to be quite useful and robust in general; however since its introduction a few shortcomings have been found. The corresponding improvements have been consolidated in XWiki Syntax 2.1. Some new features of this syntax are:
XWiki Syntax 2.1 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.1 |
---|---|---|
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 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 === |
Other syntaxes are also available.
Paragraphs are text elements separated by 2 or more new lines.
Feature | XWiki Syntax 2.1 | 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 | (% style="text-align:center;color:blue" %) Centered and blue paragraph | Centered and blue paragraph |
Different style on some portion of the paragraph content | paragraph with (% style="color:red" %)red(%%) different style inside | paragraph with red texte inside |
Feature | XWiki Syntax 2.1 | Result |
---|---|---|
Standard headings | = level 1 = == level 2 == === level 3 === ==== level 4 ==== ===== level 5 ===== ====== level 6 ====== | level 1
level 2level 3level 4level 5level 6 |
Parameterized headings | (% style="color:blue" %) = heading = | heading |
Headings with XWiki Syntax | === Heading with **bold** === | Heading with bold |
Feature | XWiki Syntax 2.1 | Result |
---|---|---|
Bold | **bold** | bold |
Underline | __underline__ | underline |
Italics | //italic// | italic |
Striked out | --strike-- | |
Monospace | ##monospace## | monospace |
Superscript | some ^^superscript^^ | some superscript |
Subscript | some ,,subscript,, | some subscript |
Feature | XWiki Syntax 2.1 | Result |
---|---|---|
Simple horizontal line | ---- | |
Parametrized horizontal line | (% style="border-color:blue" %) ---- |
Feature | XWiki Syntax 2.1 | 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 | (% style="list-style-type: square" %) * item 1 * item 2 |
|
Disc list | (% style="list-style-type: disc" %) * item 1 * item 2 |
|
Lowercase Alphabetical list | (% style="list-style-type: lower-alpha" %) * item 1 * item 2 |
|
Uppercase Alphabetical list | (% style="list-style-type: upper-alpha" %) * item 1 * item 2 |
|
Lowercase Roman list | (% style="list-style-type: lower-roman" %) * item 1 * item 2 |
|
Uppercase Roman list | (% style="list-style-type: upper-roman" %) * item 1 * item 2 |
|
Lowercase Greek list | (% style="list-style-type: lower-greek" %) * item 1 * item 2 |
|
Uppercase Greek list | (% style="list-style-type: upper-greek" %) * item 1 * item 2 |
|
Hiragana list | (% style="list-style-type: hiragana" %) * item 1 * item 2 |
|
Hiragana Iroah list | (% style="list-style-type: hiragana-iroha" %) * item 1 * item 2 |
|
Katakana list | (% style="list-style-type: katakana" %) * item 1 * item 2 |
|
Katakana Iroha list | (% style="list-style-type: katakana-iroha" %) * item 1 * item 2 |
|
Armenian list | (% style="list-style-type: armenian" %) * item 1 * item 2 |
|
Hebrew list | (% style="list-style-type: hebrew" %) * item 1 * item 2 |
|
Georgian list | (% style="list-style-type: georgian" %) * item 1 * item 2 |
|
CJK ideographic list | (% style="list-style-type: cjk-ideographic" %) * item 1 * item 2 |
|
Feature | XWiki Syntax 2.1 | Result |
---|---|---|
Standard definition | ; term : definition |
|
Nested definitions | ; term 1 : definition 1 :; term 2 :: definition 2 |
|
Parametrized definition | (% 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 2.1 | Result |
---|---|---|
Line break | Line\\New line | Line New line |
New line | Line New line | Line New line |
Feature | XWiki Syntax 2.1 | Result |
---|---|---|
Absolute link to page PageB located in PageA | [[PageA.PageB]] | PageB |
Relative link to page PageA from the current page | [[PageA]] or [[.PageA]] | PageA |
Relative link to page PageB in PageA from the current page | [[.PageA.PageB]] | PageB |
Link with a label | [[label>>PageA]] | label |
Link with wiki syntax in the label | [[**bold label**>>PageA]] | bold label |
Link on an image | [[image:PageA@img.png>>PageA]] | |
Absolute link to page PageB located in PageA in wiki WikiA | [[WikiA:PageA.PageB]] | PageB |
Link that opens in a new window | [[PageA||target="_blank"]] | PageA |
Implicit link to a URL | This is a URL: https://xwiki.org | This is a URL: https://xwiki.org |
Explicit link to a URL | [[https://xwiki.org]] | https://xwiki.org |
Explicit link to a URL with a label | [[XWiki>>https://xwiki.org]] | XWiki |
Link to an email address | [[john@smith.net>>mailto:john@smith.net]] | john@smith.net |
Link to an attachment on the current page | [[attach:img.png]] | img.png |
Link to an attachment in a different page | [[attach:PageA.PageB@img.png]] | img.png |
Link to an Anchor in a page | [[PageA.PageB||anchor="anchor"]] | PageB |
Link to a Heading in a page | [[PageA.PageB||anchor="HMyheading"]] | PageB |
Link to an anchor in the current page | [[label>>||anchor="anchor"]] | label |
Link to a page with a query string | [[PageA.PageB||queryString="param1=value1¶m2=value2"]] | PageB |
Link to the current page with a query string | [[label>>||queryString="param1=value1¶m2=value2"]] | label |
The full format of a link is [label>>] (resource) [||parameters]
Allows to easily create content in table format. Parameters for table, row or cell are also supported in XWiki Syntax 2.1.
Feature | XWiki Syntax 2.1 | Result | ||||||
---|---|---|---|---|---|---|---|---|
Standard table | |=Title 1|=Title 2 |Word 1|Word 2 !=Title 1!=Title 2 !!Word 1!!Word 2 |
| ||||||
Parametrized table | (% style="background-color:red;text-align:center" %) |=Title 1|=(% style="background-color:yellow" %)Title 2 |Word 1|Word 2 |
| ||||||
Filterable Sortable table | {{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 |
|
Feature | XWiki Syntax 2.1 | Result |
---|---|---|
Image from attachment on current page | image:img.png | |
Image from attachment on another page | image:PageA.PageB@img.png | |
Image with parameters | [[image:img.png||width="25" height="25"]] | |
Image with caption | [[~[~[XWiki~>~>https://www.xwiki.org~]~] supports captions.>>image:img.png]] | |
Images located at URL | image:https://some/url/img.png | |
Prepackaged Icons | image:icon:accept |
The full format of an image is either image: (reference) or [[{caption>>}image: (reference) {||parameters}]]
Allow to enter content that will not be formatted (in other words the XWiki Syntax will not be taken into account).
Feature | XWiki Syntax 2.1 | Result |
---|---|---|
Verbatim inline | Some verbatim {{{**[[not rendered]]**}}} content | Some verbatim **[[not rendered]]** content |
Verbatim block | {{{ multi line **verbatim** content }}} | multi line **verbatim** content |
Allows to quote some text.
Feature | XWiki Syntax 2.1 | Result |
---|---|---|
Simple quote | > john said this I said ok |
I said ok |
Nested quotes | > 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 or style inside a list item, inside a table cell or a paragraph. Groups are delimited by the following syntactic elements: (((...))). One Group can contain another Group and there is no limit of imbrication.
XWiki Syntax 2.1 | 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 | ||||||
(% class="myClass" style="color:blue" %)(((blue paragraphs inside myClass))) | blue paragraphs inside my group |
Allows to escape XWiki Syntax.
Feature | XWiki Syntax 2.1 | Result |
---|---|---|
Escape a character | This is not a ~[~[link~]~] | This is not a [[link]] |
Escape longer text (also see "Verbatim") | {{{ some **longer** text //without// formatting}}} | some **longer** text //without// formatting |
With XWiki Syntax 2.1 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.
XWiki Syntax 2.1 | Generated XHTML |
---|---|
(% class="myClass" style="myStyle" id="myId" %) = heading = | <h1 class="myClass" style="myStyle" id="myId">heading</h1> |
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"/}}
Feature | XWiki Syntax 2.1 | Result |
---|---|---|
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 |
Id | Name | Category | Description | Visibility |
---|---|---|---|---|
toc | Table Of Contents | Navigation | Generates a Table Of Contents. | Global |
iconPicker | Icon Picker | Development | Select an icon within the XWiki icon set. | Current Wiki |
formula | Formula | Content | Displays a mathematical formula. | Global |
wikimacrocontent | WikiMacro Content | Development | Display editable content of a wikimacro. | Global |
mention | User Mention | Notifications | Inserts a user mention. | Current Wiki |
example | Example | Formatting | Shows an example and its source code. | Current Wiki |
async | Async | Content | Asynchronous and cached execution of wiki content. | Global |
spaceindex | Space Index | Deprecated | Lists documents in a space. | Current Wiki |
box | Box | Formatting | Draw a box around provided content. | Global |
spaces | Spaces | Deprecated | Displays all the spaces in this wiki. | Current Wiki |
error | Error Message | Formatting | Displays an error message note. | Global |
warning | Warning Message | Formatting | Displays a warning message note. | Global |
messageSender | Message Sender | Social | A control that allows users to enter messages that are handled by the MessageStream module. | Current Wiki |
children | Children | Navigation | Displays a tree of children pages of the current page | Current Wiki |
workspaces | Workspaces | Deprecated | Deprecated macro that should not be used, here for compatibility reason. Please use the "wikis" macro instead. | Current Wiki |
display | Display | Content | Display other pages into the current page. | Global |
translation | Translation | Content | Display a translation message. | Global |
context | Context | Development | Executes content in the context of the passed document | Global |
info | Info Message | Formatting | Displays an info message note. | Global |
tree | Tree | Navigation | Displays a tree hierarchy defined by the macro content or the source parameter. | Current Wiki |
liveData | Live Data | Content | Display dynamic lists of data. | Global |
rss | RSS | Content | Output latest feed entries from a RSS feed. | Global |
success | Success Message | Formatting | Displays a success message note. | Global |
documentTree | Document Tree | Navigation | Displays the tree of XWiki documents. | Current Wiki |
template | Template | Development | Insert a template. | Global |
notificationsAutoWatchPreferences | Notifications Auto Watch Preferences | Notifications | Current Wiki | |
chart | Chart | Content | Displays a graphical chart generated from miscellaneous data sources | Global |
container | Container | Layout | A macro to enclose multiple groups and add decoration, such as layout. | Global |
notificationsEmailPreferences | Notifications Email Preferences | Notifications | Display the preferences of the current user about notification emails. | Current Wiki |
tagcloud | Tag Cloud | Content | Displays the cloud of tags in this wiki or in the specified space, if any. | Current Wiki |
activity | Activity (legacy) | Notifications | Provide a macro implemented with the Notifications Application to keep a backward compatibility with Activity Stream. | Current Wiki |
python | Python | Development | Executes a python script. | Global |
comment | Comment | Development | Allows putting comments in the source content. This macro doesn't output anything. | Global |
html | HTML | Development | Inserts HTML or XHTML code into the page. | Global |
content | Content | Content | Allows writing content in any wiki markup | Global |
script | Script | Development | Execute script in provided script language. | Global |
useravatar | User Avatar | Content | Allows displaying the avatar for a specific user. | Global |
office | Office Document Viewer | Content | View office attachments (doc, ppt, xls, odt, odp, ods etc.) inside wiki pages without downloading or importing them. | Global |
gallery | Gallery | Layout | Displays the images found in the provided content using a slide-show view. | Global |
uiextension | UI Extensions | Development | Insert a UI extension. | Global |
notificationsSystemFiltersPreferences | Notifications System Filters Preferences | Notifications | Display the preferences of the given user about system notification filters. | Current Wiki |
uiextensions | UI Extensions | Development | Insert UI extensions. | Global |
dashboard | Dashboard | Layout | A macro to define a dashboard. | Global |
putFootnotes | Put Footnote | Content | Displays the footnotes defined so far. If missing, all footnotes are displayed by default at the end of the page. | Global |
wikis | Wikis | Navigation | List all wikis | Current Wiki |
attachmentSelector | Attachment Selector | Development | A control to be used for object properties of the current document that are supposed to contain the name of an attachment from the current (or target) document. Allows uploading new attachments, and deleting attachments from the target document. If no target document is specified, the current document will be used. Object properties are only saved to the current document. | Current Wiki |
notificationsApplicationsPreferences | Notifications Applications Preferences | Notifications | Display the preferences of the current user about notification applications. | Current Wiki |
cache | Cache | Development | Caches content. | Global |
menu | Menu | Navigation | Displays a menu created using simple wiki syntax (nested lists and links). | Global |
notificationsCustomFiltersPreferences | Notifications Custom Filters Preferences | Notifications | Display the preferences of the given user about custom notification filters. | Current Wiki |
documents | Documents | Content | Displays a list of documents in a Livetable | Current Wiki |
notificationsFiltersPreferences | Notifications Filters Preferences (deprecated) | Notifications | Display the preferences of the current user about notification filters. This macro is now deprecated in favor of Custom Notifications Filters Preferences or System Notifications Filters Preferences. | Current Wiki |
notifications | Notifications | Notifications | Current Wiki | |
velocity | Velocity | Development | Executes a Velocity script. | Global |
wikimacroparameter | WikiMacro Parameter | Development | Display editable parameter of a wikimacro. | Global |
groovy | Groovy | Development | Execute a groovy script. | Global |
footnote | Footnote | Content | Generates a footnote to display at the end of the page. | Global |
code | Code | Formatting | Highlights code snippets of various programming languages | Global |
id | Id | Navigation | Allows putting a reference/location in a page. In HTML for example this is called an Anchor. It allows pointing to that location, for example in links. | Global |
include | Include | Content | Include other pages into the current page. | Global |
XWiki Syntax 2.1 | Result |
---|---|
{{html}}<abbr title="HyperText Markup Language">HTML</abbr>{{/html}} | HTML |
Feature | XWiki Syntax 2.1 |
---|---|
Velocity script | {{velocity}} #set ($var = "whatever") {{/velocity}} |
Groovy script | {{groovy}} def var = "whatever" {{/groovy}} |