XWiki Syntax Guide

Редактировал(а) atsarkov 20.03.2025 15:03

XWiki Syntax 1.0 » Editing

XWiki Syntax 1.0: Editing

Paragraphs

1.0 Paragraphs

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

New lines are not honored in XWiki Syntax 1.0.
You need to insert a double backslash instead, like: \\

FeatureXWiki Syntax 1.0Result
Simple paragraphThis is a paragraphThis is a paragraph
Paragraph on multiple linesParagraph on\\
multiple lines
Paragraph on
multiple lines
Two paragraphsParagraph 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

Заголовки

1.0 Headings

ФункциональностьСинтаксис XWiki 1.0Результат
Стандартные заголовки

1 уровень 1
1.1 уровень 2
1.1.1 уровень 3
1.1.1.1 уровень 4
1.1.1.1.1 уровень 5
1.1.1.1.1.1 уровень 6

уровень 1

уровень 2

уровень 3

уровень 4

уровень 5
уровень 6
Параметризованные заголовки<h1><span style="color:blue">Заголовок</span></h1>

заголовок

Заголовки с синтаксисом XWiki1.1.1 Заголовок с *полужирным*

Heading with bold

Text Formatting

1.0 Text Formatting

FeatureXWiki Syntax 1.0Result
Bold*bold*bold
Underline__underline___underline
Italics~~italic~~italic
Striked out--strike--strike
Monospace<tt>monospace</tt>monospace
Superscriptsome <sup>superscript</sup>some superscript
Subscriptsome <sub>subscript</sub>some subscript

Horizontal Line

1.0 Horizontal Line

There must be 4 or more dashes.

FeatureXWiki Syntax 1.0Result
Simple horizontal line----

Parametrized horizontal line<hr style="border-color:blue"/>

Lists

1.0 Lists

Some of the mentioned styles do not work on all browsers. For a comprehensive list follow this link.

FeatureXWiki Syntax 1.0Result
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
    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
    • item 2
    • item 3
  2. item 4
Square list
- 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>

  • item 1
  • item 2
Lowercase Alphabetical list
a. item 1
a. item 2
  • item 1
  • item 2
Uppercase Alphabetical list
A. item 1
A. item 2
  • item 1
  • item 2
Lowercase Roman list
i. item 1
i. item 2
  • item 1
  • item 2
Uppercase Roman list
I. item 1
I. item 2
  • item 1
  • item 2
Lowercase Greek list
g. item 1
g. item 2
  • item 1
  • item 2
Uppercase Greek list
G. item 1
G. item 2
  • item 1
  • item 2
Hiragana list
h. item 1
h. item 2
  • item 1
  • item 2
Hiragana Iroha list
H. item 1
H. item 2
  • item 1
  • item 2
Katakana list
k. item 1
k. item 2
  • item 1
  • item 2
Katakana Iroha list
K. item 1
K. item 2
  • item 1
  • item 2
Armenian list
<ul style="list-style-type: armenian">
  <li>item 1</li>
  <li>item 2</li>
</ul>
  • item 1
  • item 2
Hebrew list
j. item 1
j. item 2
  • item 1
  • item 2
Georgian list
<ul style="list-style-type: georgian">
  <li>item 1</li>
  <li>item 2</li>
</ul>
  • item 1
  • item 2
CJK ideographic list
<ul style="list-style-type: cjk-ideographic">
  <li>item 1</li>
  <li>item 2</li>
</ul>
  • item 1
  • item 2

Списки определений

1.0 Definition Lists

ФункциональностьCинтаксис XWiki 1.0Результат
Стандартное определение
<dl>
  <dt>термин</dt>
  <dd>определение</dd>
</dl>
термин
определение
Вложенные определения
<dl>
  <dt>термин 1</dt>
  <dd>определение 1
    <dl>
      <dt>термин 2</dt>
      <dd>определение 2</dd>
    </dl>
  </dd>
</dl>
термин 1
определение 1
термин 2
определение 2
Параметризированное определение
<dl style="color:blue">
  <dt>термин</dt>
  <dd>определение</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.

New lines are not honored in XWiki Syntax 1.0. Use line breaks instead.

FeatureXWiki Syntax 1.0Result
Line breakLine\\New lineLine
New line
New lineLine
New line
Line New line
FeatureXWiki Syntax 1.0Result
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 textThis is a URL: https://xwiki.orgThis 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[john@smith.net>mailto:john@smith.net]john@smith.net
Image Link<a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2}</a>img.png
Image Link with image parameters<a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2|width=26|height=26}</a>img.png
Link to an attachment on the current page

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

text
Link to an attachment in a different page

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

text
Link to an Anchor in a page[label>Space.Page#anchor]label
Link to a Heading in a page
[label>Space.Page#HMyheading]
label

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".

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:] 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
  • 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.

FeatureXWiki Syntax 1.0Result
Standard table
{table}
Title 1 | Title 2
Word 1 | Word 2
{table}
Title 1Title 2
Word 1Word 2
Parametrized table

<table style="background-color:red;text-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>

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="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>

For improved features see the Livetable Macro.

Title 1Title 2
Cell 11Cell 12
Cell 21Cell 22

Images

1.0 Images

FeatureXWiki Syntax 1.0Result
Image from attachment on current page

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

img.png
Image from attachment on another page{image:img.png|document=Space.Page}img.png
Image with parameters{image:img.png|width=25|height=25}img.png
Images located at URLhttps://some/url/img.pngimg.png