XWiki Syntax Guide

Last modified by Андрей Калиновский on 2022/04/28 13:59

XWiki Syntax 2.0 » Editing

XWiki Syntax 2.0: Editing

Paragraphs

2.0 Paragraphs

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

FeatureXWiki Syntax 2.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(% style="text-align:center;color:blue" %)
Centered and blue paragraph

Centered and blue paragraph
Different style on some portion of the paragraph contentparagraph with (% style="color:red" %)red(%%) different style insideparagraph with red texte inside

Headings

2.0 Headings

FeatureXWiki Syntax 2.0Result
Standard headings
= level 1 = 
== level 2 ==
=== level 3 ===
==== level 4 ====
===== level 5 =====
====== level 6 ======

level 1

 

level 2

level 3

level 4

level 5
level 6
Parameterized headings(% style="color:blue" %)
= heading =

heading

Headings with XWiki Syntax=== Heading with **bold** ===

Heading with bold

Text Formatting

2.0 Text Formatting

FeatureXWiki Syntax 2.0Result
Bold**bold**bold
Underline__underline__underline
Italics//italic//italic
Striked out--strike--strike
Monospace##monospace##monospace
Superscriptsome ^^superscript^^some superscript
Subscriptsome ,,subscript,,some subscript

Horizontal Line

2.0 Horizontal Line

There must be 4 or more dashes.

FeatureXWiki Syntax 2.0Result
Simple horizontal line----

Parametrized horizontal line
(% style="border-color:blue" %)
----

Lists

2.0 Lists

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

FeatureXWiki Syntax 2.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
(% style="list-style-type: square" %)
* item 1
* item 2
  • item 1
  • item 2
Disc list
(% style="list-style-type: disc" %)
* item 1
* item 2
  • item 1
  • item 2
Lowercase Alphabetical list
(% style="list-style-type: lower-alpha" %)
* item 1
* item 2
  • item 1
  • item 2
Uppercase Alphabetical list
(% style="list-style-type: upper-alpha" %)
* item 1
* item 2
  • item 1
  • item 2
Lowercase Roman list
(% style="list-style-type: lower-roman" %)
* item 1
* item 2
  • item 1
  • item 2
Uppercase Roman list
(% style="list-style-type: upper-roman" %)
* item 1
* item 2
  • item 1
  • item 2
Lowercase Greek list
(% style="list-style-type: lower-greek" %)
* item 1
* item 2
  • item 1
  • item 2
Uppercase Greek list
(% style="list-style-type: upper-greek" %)
* item 1
* item 2
  • item 1
  • item 2
Hiragana list
(% style="list-style-type: hiragana" %)
* item 1
* item 2
  • item 1
  • item 2
Hiragana Iroah list
(% style="list-style-type: hiragana-iroha" %)
* item 1
* item 2
  • item 1
  • item 2
Katakana list
(% style="list-style-type: katakana" %)
* item 1
* item 2
  • item 1
  • item 2
Katakana Iroha list
(% style="list-style-type: katakana-iroha" %)
* item 1
* item 2
  • item 1
  • item 2
Armenian list
(% style="list-style-type: armenian" %)
* item 1
* item 2
  • item 1
  • item 2
Hebrew list
(% style="list-style-type: hebrew" %)
* item 1
* item 2
  • item 1
  • item 2
Georgian list
(% style="list-style-type: georgian" %)
* item 1
* item 2
  • item 1
  • item 2
CJK ideographic list
(% style="list-style-type: cjk-ideographic" %)
* item 1
* item 2
  • item 1
  • item 2

Definition Lists

2.0 Definition Lists

FeatureXWiki Syntax 2.0Result
Standard definition
; term
: definition
term
definition
Nested definitions
; term 1
: definition 1
:; term 2
:: definition 2
term 1
definition 1
term 2
definition 2
Parametrized definition
(% style="color:blue" %)
; term
: definition
term
definition

New Line/Line Breaks

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

FeatureXWiki Syntax 2.0Result
Line breakLine\\New lineLine
New line
New lineLine
New line
Line
New line
FeatureXWiki Syntax 2.0Result
Link to a page in the current Space[[WebHome]]XWiki
Link with a label

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

label
Link with XWiki Syntax in the label[[**bold label**>>WebHome]]bold label
Link to a page with the space specified[[Main.WebHome]]Main
Link to a subwiki[[subwiki:Main.WebHome]]Main
Link that opens in a new window[[label>>WebHome||target="_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[[image:Space2.Page2@img.png>>Space1.Page1]]img.png
Image Link with image parameters[[[[image:Space2.Page2@img.png||width="26" height="26"]]>>Space1.Page1]]img.png
Link to an attachment on the current page[[text>>attach:img.png]]text
Link to an attachment in a different page[[text>>attach:Space.Page@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
Link to an Anchor in the current page[[label>>#anchor]]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 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 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
      • 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 page that holds the attachment, see "Wiki page" 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: target="_blank" (open in new window)

Tables

2.0 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 2.0Result
Standard 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
(% style="background-color:red;text-align:center" %)
|=Title 1|=(% style="background-color:yellow" %)Title 2
|Word 1|Word 2
Title 1Title 2
Word 1Word 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

For improved features see the Livetable Macro.

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

Images

2.0 Images

FeatureXWiki Syntax 2.0Result
Image from attachment on current pageimage:img.pngimg.png
Image from attachment on another pageimage:Space.Page@img.pngimg.png
Image with parameters[[image:img.png||width="25" height="25"]]img.png
Images located at URLimage:https://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 wiki. The image reference will point to an image attached to a page inside that 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="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.
Tags:
Created by Андрей Калиновский on 2022/04/28 13:59
   
ГЛОНАССSoft wiki - 2024 г.