Wiki source code of XWiki Syntaxes

Version 1.1 by Admin on 2009/09/16 15:32

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}{{toc depth="1"/}}{{/box}}
2
3 Starting with XWiki Enterprise version 1.7 and above we've introduced a new wiki syntax. So we're now naming the current syntax the //XWiki Syntax v1.0// and the new syntax is logically called the //XWiki Syntax v2.0//. The main reasons for introducing the new syntax were:
4 * Fix the limitations and ambiguities of the XWiki 1.0 syntax (which was inspired by both Radeox - the underlying rendering engine - and TWiki).
5 ** 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.
6 ** 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.
7 * Be closer to the [[Creole 1.0 syntax>>http://www.wikicreole.org/]] 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.
8
9 In addition to these 2 XWiki syntaxes we've also changed our underlying rendering engine (was Radeox previously) in favor of our own engine which is superset wrapper around [[Wikimodel>>http://code.google.com/p/wikimodel/]] and [[Doxia>>http://maven.apache.org/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>>#syntaxes]]
10
11 = General Remarks =
12
13 XWiki Syntax v2.0 corrects some errors or ambiguous syntax entered by the user as shown in the examples in the table below.
14
15 |=Description|=Example of invalid or ambiguous syntax|=Fixed XWiki Syntax 2.0
16 |Not closed tet styles|{{{**bold}}}|{{{**bold**}}}
17 |Two standalone elements not separated by 2 new lines|{{{| table cell}}}\\{{{* list item}}}|{{{| table cell}}}\\\\{{{* list item}}}
18 |Two standalone elements not separated by 2 new lines|{{{paragraph}}}\\{{{----}}}\\{{{paragraph}}}|{{{paragraph}}}\\\\{{{----}}}\\\\{{{paragraph}}}
19 |Ignored new line at beginning of document|<new line at beginning of document>\\paragraph|paragraph
20 |Not closed heading syntax|{{{=== heading}}}|{{{=== heading ===}}}
21
22 = Paragraphs =
23
24 Paragraphs are text elements separated by 2 or more new lines.
25
26 {{info}}
27 In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole syntax.
28 {{/info}}
29
30 (% style="width:100%" %)
31 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 1.2
32 |Simple paragraph|This is a paragraph|This is a paragraph|This is a paragraph|This is a paragraph
33 |Paragraph on multiple lines|Paragraph on{{{\\}}}\\multiple lines|Paragraph on\\multiple lines|Paragraph on\\multiple lines|Paragraph on\\multiple lines
34 |Two paragraphs|Paragraph one\\\\Paragraph two|Paragraph one\\\\Paragraph two|Paragraph one\\\\Paragraph two|Paragraph one\\\\Paragraph two
35 |Parametrized paragraph|<p style="text-align:center;color:blue">Centered and blue paragraph</p>|{{{(% style="text-align:center;color:blue" %)}}}\\Centered and blue paragraph|(% style="text-align:center;color:blue" %)\\Centered and blue paragraph|(% style="text-align:center;color:blue" %)\\Centered and blue paragraph
36
37 = Headings =
38
39 (% style="width:100%" %)
40 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
41 |Standard headings|(((
42 1 level 1
43 1.1 level 2
44 1.1.1 level 3
45 1.1.1.1 level 4
46 1.1.1.1.1 level 5
47 1.1.1.1.1.1 level 6
48 )))|((({{{
49 = level 1 =
50 == level 2 ==
51 === level 3 ===
52 ==== level 4 ====
53 ===== level 5 =====
54 ====== level 6 ======
55 }}})))|(((
56 {{html}}
57 <!-- Note: replace this with wiki syntax when http://jira.xwiki.org/jira/browse/XWIKI-4358 is implemented -->
58 <h1 id="Hlevel1"><span>level 1</span></h1><p>&nbsp;</p><h2 id="Hlevel2"><span>level 2</span></h2><h3 id="Hlevel3"><span>level 3</span></h3><h4 id="Hlevel4"><span>level 4</span></h4><h5 id="Hlevel5"><span>level 5</span></h5><h6 id="Hlevel6"><span>level 6</span></h6>
59 {{/html}})))
60 |Parametrized headings|<h1><span style="color:blue">heading</span></h1>|{{{(% style="color:blue" %)}}}\\= heading =|(((
61 {{html}}
62 <h1 id="Hheading" style="color:blue"><span>heading</span></h1>
63 {{/html}})))
64 |Headings with wiki syntax|1.1.1 Heading with *bold*|{{{=== Heading with **bold** ===}}}|(((=== Heading with **bold** ===)))
65
66 = Text Formatting =
67
68 {{info}}
69 New in XWiki Syntax 2.0 over XWiki Syntax 1.0:
70 * Spaces are allowed just after the syntax symbols (for example in XWiki Syntax 1.0, this was not * bold *).
71 * 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.
72 * Ability to span several lines (wasn't the case in XWiki Syntax 1.0).
73 {{/info}}
74
75 (% style="width:100%" %)
76 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
77 |Bold|{{{*bold*}}}|{{{**bold**}}}|**bold**
78 |Underline|{{{__underline___}}}|{{{__underline__}}}|__underline__
79 |Italics|{{{~~italic~~}}}|{{{//italic//}}}|//italic//
80 |Striked out|{{{--strike--}}}|{{{--strike--}}}|--strike--
81 |Monospace|<tt>monospace</tt>|{{{##monospace##}}}|##monospace##
82 |Superscript|some <sup>superscript</sup>|{{{some ^^superscript^^}}}|some ^^superscript^^
83 |Subscript|some <sub>subscript</sub>|{{{some ,,subscript,,}}}|some ,,subscript,,
84
85 = Horizontal Line =
86
87 {{info}}There must be 4 or more dashes.{{/info}}
88
89 {{info}}Note that this is different from Creole where exactly 4 dashes are required.{{/info}}
90
91 (% style="width:100%" %)
92 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
93 |Simple Horizontal Line|{{{----}}}|{{{----}}}|(((----)))
94 |Parametrized Horizontal Line|<hr style="color:blue"/>|((({{{
95 (% style="color:blue" %)
96 ----
97 }}})))|(((
98 (% style="color:blue" %)
99 ----
100 )))
101
102 = Lists =
103
104 (% style="width:100%" %)
105 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
106 |Bulleted list|((({{{
107 * item 1
108 ** item 2
109 *** item 3
110 * item 4
111 }}})))|((({{{
112 * item 1
113 ** item 2
114 *** item 3
115 * item 4
116 }}})))|(((
117 * item 1
118 ** item 2
119 *** item 3
120 * item 4
121 )))
122 |Numbered list|((({{{
123 1. item 1
124 11. item 2
125 111. item 3
126 1. item 4
127 }}})))|((({{{
128 1. item 1
129 11. item 2
130 111. item 3
131 1. item 4
132 }}})))|(((
133 1. item 1
134 11. item 2
135 111. item 3
136 1. item 4
137 )))
138 |Mixed list|((({{{
139 1. item 1
140 1*. item 2
141 1*. item 3
142 1. item 4
143 }}})))|((({{{
144 1. item 1
145 1*. item 2
146 1*. item 3
147 1. item 4
148 }}})))|(((
149 1. item 1
150 1*. item 2
151 1*. item 3
152 1. item 4
153 )))
154 |Square list|((({{{
155 - item 1
156 - item 2
157 }}})))|((({{{
158 (% style="list-style-type: square" %)
159 * item 1
160 * item 2
161 }}})))|(((
162 (% style="list-style-type: square" %)
163 * item 1
164 * item 2
165 )))
166 |Disc list|(((
167 <ul style="list-style-type: disc">
168 <li>item1</li>
169 <li>item2</li>
170 </ul>
171 )))|((({{{
172 (% style="list-style-type: disc" %)
173 * item 1
174 * item 2
175 }}})))|(((
176 (% style="list-style-type: disc" %)
177 * item 1
178 * item 2
179 )))
180 |Lowercase Alphabetical list|((({{{
181 a. item 1
182 a. item 2
183 }}})))|((({{{
184 (% style="list-style-type: lower-alpha" %)
185 * item1
186 * item2
187 }}})))|(((
188 (% style="list-style-type: lower-alpha" %)
189 * item1
190 * item2
191 )))
192 |Uppercase Alphabetical list|((({{{
193 A. item 1
194 A. item 2
195 }}})))|((({{{
196 (% style="list-style-type: upper-alpha" %)
197 * item1
198 * item2
199 }}})))|(((
200 (% style="list-style-type: upper-alpha" %)
201 * item1
202 * item2
203 )))
204 |Lowercase Roman list|((({{{
205 i. item 1
206 i. item 2
207 }}})))|((({{{
208 (% style="list-style-type: lower-roman" %)
209 * item1
210 * item2
211 }}})))|(((
212 (% style="list-style-type: lower-roman" %)
213 * item1
214 * item2
215 )))
216 |Uppercase Roman list|((({{{
217 I. item 1
218 I. item 2
219 }}})))|((({{{
220 (% style="list-style-type: upper-roman" %)
221 * item1
222 * item2
223 }}})))|(((
224 (% style="list-style-type: upper-roman" %)
225 * item1
226 * item2
227 )))
228 |Lowercase Greek list|((({{{
229 g. item 1
230 g. item 2
231 }}})))|((({{{
232 (% style="list-style-type: lower-greek" %)
233 * item1
234 * item2
235 }}})))|(((
236 (% style="list-style-type: lower-greek" %)
237 * item1
238 * item2
239 )))
240 |Uppercase Greek list|((({{{
241 G. item 1
242 G. item 2
243 }}})))|((({{{
244 (% style="list-style-type: upper-greek" %)
245 * item1
246 * item2
247 }}})))|(((
248 (% style="list-style-type: upper-greek" %)
249 * item1
250 * item2
251 )))
252 |Hiragana list|((({{{
253 h. item 1
254 h. item 2
255 }}})))|((({{{
256 (% style="list-style-type: hiragana" %)
257 * item1
258 * item2
259 }}})))|(((
260 (% style="list-style-type: hiragana" %)
261 * item1
262 * item2
263 )))
264 |Hiragana Iroah list|((({{{
265 H. item 1
266 H. item 2
267 }}})))|((({{{
268 (% style="list-style-type: hiragana-iroha" %)
269 * item1
270 * item2
271 }}})))|(((
272 (% style="list-style-type: hiragana-iroha" %)
273 * item1
274 * item2
275 )))
276 |Katakana list|((({{{
277 k. item 1
278 k. item 2
279 }}})))|((({{{
280 (% style="list-style-type: katakana" %)
281 * item1
282 * item2
283 }}})))|(((
284 (% style="list-style-type: katakana" %)
285 * item1
286 * item2
287 )))
288 |Katakana Iroha list|((({{{
289 K. item 1
290 K. item 2
291 }}})))|((({{{
292 (% style="list-style-type: katakana-iroha" %)
293 * item1
294 * item2
295 }}})))|(((
296 (% style="list-style-type: katakana-iroha" %)
297 * item1
298 * item2
299 )))
300 |Armenian list|((({{{
301 <ul style="list-style-type: armenian">
302 <li>item1</li>
303 <li>item2</li>
304 </ul>
305 }}})))|((({{{
306 (% style="list-style-type: armenian" %)
307 * item1
308 * item2
309 }}})))|(((
310 (% style="list-style-type: armenian" %)
311 * item1
312 * item2
313 )))
314 |Hebrew list|((({{{
315 j. item1
316 j. item2
317 }}})))|((({{{
318 (% style="list-style-type: hebrew" %)
319 * item1
320 * item2
321 }}})))|(((
322 (% style="list-style-type: hebrew" %)
323 * item1
324 * item2
325 )))
326 |Georgian list|((({{{
327 <ul style="list-style-type: georgian">
328 <li>item1</li>
329 <li>item2</li>
330 </ul>
331 }}})))|((({{{
332 (% style="list-style-type: georgian" %)
333 * item1
334 * item2
335 }}})))|(((
336 (% style="list-style-type: georgian" %)
337 * item1
338 * item2
339 )))
340 |CJK ideographic list|((({{{
341 <ul style="list-style-type: cjk-ideographic">
342 <li>item1</li>
343 <li>item2</li>
344 </ul>
345 }}})))|((({{{
346 (% style="list-style-type: cjk-ideographic" %)
347 * item1
348 * item2
349 }}})))|(((
350 (% style="list-style-type: cjk-ideographic" %)
351 * item1
352 * item2
353 )))
354
355 = Definition Lists =
356
357 (% style="width:100%" %)
358 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
359 |Standard definition|((({{{
360 <dl>
361 <dt>term</dt>
362 <dd>definition</dd>
363 </dl>
364 }}})))|((({{{
365 ; term
366 : definition
367 }}})))|(((
368 ; term
369 : definition
370 )))
371 |Nested definitions|((({{{
372 <dl>
373 <dt>term1</dt>
374 <dd>definition1
375 <dl>
376 <dt>term2</dt>
377 <dd>definition2</dd>
378 </dl>
379 </dd>
380 </dl>
381 }}})))|((({{{
382 ; term1
383 : definition1
384 :; term2
385 :: definition2
386 }}})))|(((
387 ; term1
388 : definition1
389 :; term2
390 :: definition2
391 )))
392 |Parametrized definition|((({{{
393 <dl style="color:blue">
394 <dt>term</dt>
395 <dd>definition</dd>
396 </dl>
397 }}})))|((({{{
398 (% style="color:blue" %)
399 ; term
400 : definition
401 }}})))|(((
402 (% style="color:blue" %)
403 ; term
404 : definition
405 )))
406
407 = New Line/Line breaks =
408
409 A new line is a carriage return. A line break is a forced new line that can appear anywhere in the text.
410
411 {{info}}
412 In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole syntax.
413 {{/info}}
414
415 (% style="width:100%" %)
416 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
417 |Line break|{{{Line\\New line}}}|{{{Line\\New line}}}|Line\\New line|Line\\New line
418 |New line|Line\\New line|Line\\New line|Line New line|Line\\New line
419
420 = Links =
421
422 (% style="width:100%" %)
423 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
424 |Link to a page in the current Space|{{{[WebHome]}}}|{{{[[WebHome]]}}}|[[Web Home>>WebHome]]|[[WebHome]]
425 |Link with a label|{{{[label>WebHome]}}}|{{{[[label>>WebHome]]}}}|[[label>>WebHome]]|[[label>>WebHome]]
426 |Link to a page with the space specified|{{{[Main.WebHome]}}}|{{{[[Main.WebHome]]}}}|[[Web Home>>Main.WebHome]]|[[Main.WebHome]]
427 |Link to a subwiki|{{{[subwiki:Main.WebHome]}}}|{{{[[subwiki:Main.WebHome]]}}}|[[Web Home>>xwiki:Main.WebHome]]|[[xwiki:Main.WebHome]]
428 |Link that opens in a new page|{{{[label>WebHome>_blank]}}}|{{{[[label>>WebHome||rel="__blank"]]}}}|[[label>>WebHome||rel="__blank"]]|[[label>>WebHome||rel="__blank"]]
429 |Link to a URL directly in the text|{{{This is a URL: http://xwiki.org}}}|{{{This is a URL: http://xwiki.org}}}|This is a URL: http://xwiki.org|This is a URL: http://xwiki.org
430 |Link to a URL|{{{[http://xwiki.org]}}}|{{{[[http://xwiki.org]]}}}|[[http://xwiki.org]]|[[http://xwiki.org]]
431 |Link to a URL with a label|{{{[XWiki>http://xwiki.org]}}}|{{{[[XWiki>>http://xwiki.org]]}}}|[[XWiki>>http://xwiki.org]]|[[XWiki>>http://xwiki.org]]
432 |Link to an email|{{{[[email protected]>mailto:[email protected]]}}}|{{{[[[email protected]>>mailto:[email protected]]]}}}|[[[email protected]>>mailto:[email protected]]]|[[[email protected]>>mailto:[email protected]]]
433 |Image Link|{{{<a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2}</a>}}}|(((
434 {{{[[image:[email protected]>>Space1.Page1]]}}}
435 {{info}}Wiki syntax is supported inside link labels{{/info}}
436 )))|[[image:img.png>>Main.WebHome]]|[[image:img.png>>Main.WebHome]]
437 |Link to an attachment in the current page|(((
438 {{info}}See [[Attach Macro>>http://code.xwiki.org/xwiki/bin/view/Macros/AttachMacro]] for details{{/info}}
439 {{{{attach:text|file=img.png}}}}
440 )))|{{{[[text>>attach:img.png]]}}}|[[text>>attach:img.png]]|[[text>>attach:img.png]]
441 |Link to an attachment in a different page|(((
442 {{info}}See [[Attach Macro>>http://code.xwiki.org/xwiki/bin/view/Macros/AttachMacro]] for details{{/info}}
443 {{{{attach:text|document=Space.Page|file=img.png}}}}
444 )))|{{{[[text>>attach:[email protected]]]}}}|[[text>>attach:[email protected]]]|[[text>>attach:[email protected]]]
445
446 == XWiki Syntax 1.0 Link Specification ==
447
448 The full format of a link is ##(alias[|&gt;])+(link)(@interWikiAlias)+([|&gt;]target)+##
449 * ##alias##: An optional string which will be displayed to the user as the link name when rendered. Example: "My Page".
450 * ##link##: The full link reference using the following syntax: ##(virtualWikiAlias:)+(space.)+(reference)(?queryString)+(#anchor)+##
451 * Note that either the ##link## or the ##alias## must be specified.
452 ** ##virtualWikiAlias##: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: "mywiki".
453 ** ##space##: An optional Wiki Space name. If not space is specified the current space is used. Example: "Main".
454 ** ##reference##: The link reference. This can be either a URI in the form ##{{{protocol:path}}}## (example: {{{"http://xwiki.org"}}}, {{{"mailto:[email protected]"}}}) or a wiki page name (example: "WebHome").
455 ** ##queryString##: An optional query string for specifying parameters that will be used in the rendered URL. Example: {{{"mydata1=5&amp;mydata2=Hello"}}}.
456 ** ##anchor##: An optional anchor name pointing to an anchor defined in the referenced link. Note that in XWiki anchors are automatically created for titles. Example: "TableOfContentAnchor".
457 * ##interWikiAlias##: An optional [[Inter Wiki>>http://en.wikipedia.org/wiki/InterWiki]] alias as defined in the InterWiki Map (see the [[Admin Guide>>http://platform.xwiki.org/xwiki/bin/view/AdminGuide/]]). Example: "wikipedia"
458 * ##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 page. Examples: "_self", "_blank"
459
460 == XWiki Syntax 2.0 Link Specification ==
461
462 The full format of a link is ##(label>>)?(link)(||parameters)*##
463 * ##label##: the link label, can contain wiki syntax
464 * ##link##: the link target, i.e. where to go when the link is clicked. It has a similar format than in the XWiki 1.0 syntax and it can also contain 2 types of URIs: ##mailto:## and ##attach:## for linking to an email and linking to an attachment respectively.
465 * ##parameters##: An optional list of parameters passed to the link.
466
467 = Tables =
468
469 Allows to easily create content in table format. It also support parameters for table, row or cell in XWiki Syntax 2.0.
470
471 (% style="width:100%" %)
472 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
473 |Standard table|{{{(((
474 {table}
475 Title 1 | Title 2
476 Word 1 | Word 2
477 {table}
478 )))}}}|((({{{
479 |=Title 1|=Title 2
480 |Word 1|Word 2
481 }}}))) or ((({{{
482 !=Title 1!=Title 2
483 !!Word 1!!Word 2
484 }}})))|(((
485 |=Title 1|=Title 2
486 |Word 1|Word 2
487 )))
488 |Parametrized table|(((
489 <table style="background-color:red;align:center">
490 <tbody>
491 <tr>
492 <td>Title 1</td>
493 <td style="background-color:yellow">Title 2</td>
494 </tr>
495 <tr>
496 <td>Word 1</td>
497 <td>Word 2</td>
498 </tr>
499 </tbody>
500 </table>
501 )))|((({{{
502 (% style="background-color:red;align=center" %)
503 |=Title 1|=(% style="background-color:yellow" %)Title 2
504 |Word 1|Word 2
505 }}})))|(((
506 (% style="background-color:red;align=center" %)
507 |=Title 1|=(% style="background-color:yellow" %)Title 2
508 |Word 1|Word 2
509 )))
510 |Filterable Sortable table|((({{{
511 $xwiki.ssfx.use("js/xwiki/table/table.css")
512 $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
513 <table id="tableid" class="grid sortable filterable doOddEven">
514 <tr class="sortHeader">
515 <th>Title1</th>
516 <th>Title2</th>
517 </tr>
518 <tr>
519 <td>Cell11</td>
520 <td>Cell12</td>
521 </tr>
522 <tr>
523 <td>Cell21</td>
524 <td>Cell22</td>
525 </tr>
526 </table>
527 }}})))|((({{{
528 {{velocity}}
529 $xwiki.ssfx.use("js/xwiki/table/table.css")
530 $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
531 {{/velocity}}
532
533 {{html}}
534 <table id="tableid" class="grid sortable filterable doOddEven">
535 <tr class="sortHeader">
536 <th>Title1</th>
537 <th>Title2</th>
538 </tr>
539 <tr>
540 <td>Cell11</td>
541 <td>Cell12</td>
542 </tr>
543 <tr>
544 <td>Cell21</td>
545 <td>Cell22</td>
546 </tr>
547 </table>
548 {{/html}}}}})))|(((
549 {{velocity}}
550 $xwiki.ssfx.use("js/xwiki/table/table.css")
551 $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
552 {{/velocity}}
553
554 {{html}}
555 <table id="tableid" class="grid sortable filterable doOddEven">
556 <tr class="sortHeader">
557 <th>Title1</th>
558 <th>Title2</th>
559 </tr>
560 <tr>
561 <td>Cell11</td>
562 <td>Cell12</td>
563 </tr>
564 <tr>
565 <td>Cell21</td>
566 <td>Cell22</td>
567 </tr>
568 </table>
569 {{/html}})))
570
571 = Images =
572
573 (% style="width:100%" %)
574 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
575 |Image from attachment in current page|(((
576 {{info}}See [[Image Macro>>http://code.xwiki.org/xwiki/bin/view/Macros/ImageMacro]] for details{{/info}}
577 {{{{image:img.png}}}}
578 )))|{{{image:img.png}}}|image:img.png
579 |Image from attachment in another document|{{{{image:img.png|document=Space.Page}}}}|{{{image:[email protected]}}}|image:img.png
580 |Image with parameters|{{{{image:img.png|width=25|height=25}}}}|{{{[[image:img.png||width="25" height="25"]]}}}|[[image:img.png||width="25" height="25"]]
581 |Images located at URL|{{{http://some/url/img.png}}}|{{{image:http://some/url/img.png}}}|image:img.png
582
583 = Verbatim =
584
585 Allow to enter content that will not be formatted (in other words the wiki syntax will not be taken into account).
586
587 {{info}}
588 In XWiki Syntax 1.0 the [[Pre macro>>http://code.xwiki.org/xwiki/bin/view/Macros/PreMacro]] only preserves wiki syntax and Radeox macros. However HTML snippets and Groovy/Velocity scripts are still executed.
589 {{/info}}
590
591 (% style="width:100%" %)
592 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
593 |Verbatim inline|{{{Some verbatim {pre}*[not rendered]*{/pre} content}}}|{{{Some verbatim {{{**[[not rendered]]**}}} content}}}|Some verbatim {{{*[not rendered]*}}} content|Some verbatim {{{**[[not rendered]]**}}} content
594 |Verbatim block|((({{{
595 {pre}
596 multi line
597 *verbatim*
598 content
599 {/pre}
600 }}}
601 {{info}}It's also possible to use the [[Code macro>>http://code.xwiki.org/xwiki/bin/view/Macros/CodeMacro]] but it displays its content in a box by default.{{/info}}
602 )))|((({{{
603 {{{
604 multi line
605 **verbatim**
606 content
607 }}}
608 }}})))|((({{{
609 multi line
610 *verbatim*
611 content
612 }}})))|((({{{
613 multi line
614 **verbatim**
615 content
616 }}})))
617
618 = Quotations =
619
620 Allows to quote some text.
621
622 (% style="width:100%" %)
623 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
624 |Simple quote|(((
625 <blockquote><p>john said this</p></blockquote>
626 I said ok
627 )))|((({{{
628 > john said this
629 I said ok
630 }}})))|(((
631 > john said this
632 I said ok
633 )))
634 |Nested quotes|(((
635 <blockquote><p>john said this</p>
636 <blockquote><p>marie answered that</p></blockquote>
637 </blockquote>
638 I said ok
639 )))|((({{{
640 > john said this
641 >> marie answered that
642 I said ok
643 }}})))|(((
644 > john said this
645 >> marie answered that
646 I said ok
647 )))
648
649 = Groups =
650
651 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.
652
653 (% style="width:100%" %)
654 |=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
655 |{{info}}This feature doesn't exist in XWiki syntax 1.0. You'd have to use pure HTML to achieve the result.{{/info}}|((({{{
656 |=Header 1|=Header 2|=Header 3
657 |Cell One|(((
658 = Embedded document
659
660 Some embedded paragraph.
661
662 * list item one
663 * list item two
664 ** sub-item 1
665 ** sub-item 2
666 ))) | Cell Three
667
668 Next paragraph in the top-level document
669 }}})))|(((
670 |=Header 1|=Header 2|=Header 3
671 |Cell One|(((
672 {{html}}<h1 id="HEmbeddeddocument"><span>Embedded document</span></h1>{{/html}}
673
674 Some embedded paragraph.
675
676 * list item one
677 * list item two
678 ** sub-item 1
679 ** sub-item 2
680 ))) | Cell Three
681
682 Next paragraph in the top-level document
683 )))
684
685 = Escapes =
686
687 (% style="width:100%" %)
688 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
689 |Escape a character|{{{This is not a \[link\]}}}|(((
690 {{{This is not a ~[~[link~]~]}}}
691 {{info}}To enter a ~~ character use a double escape: ~~~~{{/info}}
692 )))|{{{This is not a [link]}}}|{{{This is not a [[link]]}}}
693
694 = Macros =
695
696 There are 2 kinds of macros in XWiki syntax 1.0:
697 * Velocity macros (called using the ###macroname(param1 ... paramN)## syntax)
698 * Radeox macros (called using the ##{macroname:param1=value1|...|paramN=valueN}## syntax)
699
700 There are also 2 kinds of macros in XWiki Syntax 2.0:
701 * Velocity macros (called using the ###macroname(param1 ... paramN)## syntax inside the Velocity Macro)
702 * XWiki macros (called using the ##{{{{{macroname param1="value1" ... paramN="valueN"}}}}}## syntax)
703
704 {{info}}The Radeox macros cannot be used in XWiki Syntax 2.0. Thus they have been rewritten as XWiki macros.{{/info}}
705
706 {{info}}For the full list of available macros check the [[Macro Reference page>>http://code.xwiki.org/xwiki/bin/view/Macros/]].{{/info}}
707
708 (% style="width:100%" %)
709 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0
710 |Velocity Macro|((({{{#info("Some text")}}})))|((({{{
711 {{velocity}}{{html}}
712 #info("some text")
713 {{/html}}{{/velocity}}}}}
714 {{info}}We're using the HTML macro in the example since the ###info## macro returns HTML content.{{/info}}
715
716 {{info}}Starting with XE 2.0 you should use the [[Message Macro>>http://code.xwiki.org/xwiki/bin/view/Macros/MessageMacro]] to implement this example.{{/info}}
717 )))
718 |Radeox Macro/XWiki Macros|((({{{
719 {code:java}
720 java content
721 {code}
722 }}})))|((({{{
723 {{code language="java"}}
724 java content
725 {{/code}}
726 }}})))
727
728 = HTML =
729
730 {{info}}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.{{/info}}
731
732 (% style="width:100%" %)
733 |=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
734 |<b>bold</b>|{{{{{html}}<b>bold</b>{{/html}}}}}|{{html}}<b>bold</b>{{/html}}
735
736 {{info}}In XWiki Syntax 2.0, by default the HTML macro does not understands wiki syntax (other macros included since it's wiki syntax too). To enable it, use {{{{{html wiki="true"}}}}}.{{/info}}
737
738 = Velocity/Groovy Scripts =
739
740 {{info}}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.{{/info}}
741
742 (% style="width:100%" %)
743 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0
744 |Velocity script|((({{{
745 #set ($var = "whatever")
746 }}})))|((({{{
747 {{velocity}}
748 #set ($var = "whatever")
749 {{/velocity}}
750 }}})))
751 |Groovy script|((({{{
752 <%
753 def var = "whatever"
754 %>
755 }}})))|((({{{
756 {{groovy}}
757 def var = "whatever"
758 {{/groovy}}
759 }}})))
760
761 = Parameters =
762
763 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.
764
765 (% style="width:100%" %)
766 |=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Generated XHTML
767 |((({{{
768 <h1 class="myClass" style="myStyle" id="myId">heading</h1>
769 }}})))|((({{{
770 (% class="myClass" style="myStyle" id="myId" %)
771 = heading =
772 }}})))|((({{{
773 <h1 class="myClass" style="myStyle" id="myId">heading</h1>
774 }}})))
775
776 {{id name="syntaxes"/}}
777 = Other syntaxes =
778
779 The following other syntaxes are implemented in XWiki Enterprise 1.6 and later:
780 * [[JSPWiki>>http://www.jspwiki.org/wiki/TextFormattingRules]]
781 * [[MediaWiki>>http://en.wikipedia.org/wiki/Help:Editing]]
782 * [[Confluence>>http://confluence.atlassian.com/display/CONF20/Confluence+Notation+Guide+Overview]]
783 * [[TWiki>>http://twiki.org/cgi-bin/view/TWiki/WikiSyntax]]
784 * [[Creole 1.0>>http://www.wikicreole.org/wiki/Creole1.0]]
785 * [[XHTML 1.0>>http://www.w3.org/TR/xhtml1/]]
786
787 {{warning}}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.{{/warning}}
  • Powered by XWiki 15.10.8-node2. Hosted and managed by XWiki SAS

Get Connected