Wiki source code of Syntax Guide Improvements

Last modified by Ecaterina Moraru (Valica) on 2017/09/04 14:46

Show last authors
1 {{error}}
2 Patch applied, see XE-839, if you want to further improve this page, copy the content from the latest commit below
3 {{/error}}
4
5 {{velocity}}
6 $xwiki.get('ssx').use($doc.getFullName())
7 {{/velocity}}
8
9 {{box cssClass="floatinginfobox" title="**Contents**"}}
10 {{toc depth="1"/}}
11 {{/box}}
12
13 Starting with XWiki version 1.7 we've introduced a new wiki syntax. We've named the old syntax the //XWiki Syntax 1.0// and the new syntax was logically called the //XWiki Syntax 2.0//. The main reasons for introducing the new syntax were:
14
15 * Fix the limitations and ambiguities of the XWiki Syntax 1.0 (which was inspired by both Radeox - the underlying rendering engine - and TWiki).
16 ** 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.
17 ** 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.
18 * 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.
19
20 Since the introduction of XWiki Syntax 2.0 a few shortcomings of this syntax have been found. To fix these a new, as of now //experimental//, XWiki Syntax 2.1 was introduced in XWiki version 3.0. Some reason for the development of this new syntax are:
21
22 * Homogenize the link and image syntax for better clarity, consistency and extensibility.
23 * Added ability to display icons, to link to files using the UNC notation and to link to relative URLs.
24
25 {{info}}
26 Since XWiki Syntax 2.1 is based on XWiki Syntax 2.0 all syntax from XWiki Syntax 2.0 is valid unless the 2.1 specifications suggest differently.
27 {{/info}}
28
29 In addition to these XWiki-specific syntaxes we've also changed our underlying rendering engine in XWiki version 1.7 (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]]
30
31 = General Remarks =
32
33 XWiki Syntax 2.0 corrects some errors or ambiguous syntax entered by the user as shown in the examples in the table below.
34
35 |=Description|=Example of invalid or ambiguous syntax|=Fixed XWiki Syntax 2.0
36 |Unclosed text styles|{{{**bold}}}|{{{**bold**}}}
37 |Two standalone elements not separated by 2 new lines|{{{| table cell}}}
38 {{{* list item}}}|{{{| table cell}}}
39 \\{{{* list item}}}
40 |Two standalone elements not separated by 2 new lines|{{{paragraph}}}
41 {{{----}}}
42 {{{paragraph}}}|{{{paragraph}}}
43 \\{{{----}}}
44 \\{{{paragraph}}}
45 |Ignored new line at beginning of document|<new line at beginning of document>
46 paragraph|paragraph
47 |Not closed heading syntax|{{{=== heading}}}|{{{=== heading ===}}}
48
49 = Paragraphs =
50
51 Paragraphs are text elements separated by 2 or more new lines.
52
53 {{info}}
54 In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole Syntax.
55 {{/info}}
56
57 (% style="width:100%" %)
58 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
59 |Simple paragraph|This is a paragraph|This is a paragraph|This is a paragraph|This is a paragraph
60 |Paragraph on multiple lines|Paragraph on{{{\\}}}
61 multiple lines|Paragraph on
62 multiple lines|Paragraph on
63 multiple lines|Paragraph on
64 multiple lines
65 |Two paragraphs|Paragraph one
66 \\Paragraph two|Paragraph one
67 \\Paragraph two|Paragraph one
68 \\Paragraph two|Paragraph one
69 \\Paragraph two
70 |Parametrized paragraph|<p style="text-align:center;color:blue">Centered and blue paragraph</p>|{{{(% style="text-align:center;color:blue" %)}}}
71 Centered and blue paragraph|(% style="text-align:center;color:blue" %)
72 Centered and blue paragraph|(% style="text-align:center;color:blue" %)
73 Centered and blue paragraph
74
75 = Headings =
76
77 (% style="width:100%" %)
78 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
79 |Standard headings|(((
80 1 level 1
81 1.1 level 2
82 1.1.1 level 3
83 1.1.1.1 level 4
84 1.1.1.1.1 level 5
85 1.1.1.1.1.1 level 6
86 )))|(((
87 {{{
88 = level 1 =
89 == level 2 ==
90 === level 3 ===
91 ==== level 4 ====
92 ===== level 5 =====
93 ====== level 6 ======
94 }}}
95 )))|(((
96 {{html}}
97 <!-- Note: replace this with wiki syntax when https://jira.xwiki.org/browse/XWIKI-4358 is implemented -->
98 <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>
99 {{/html}}
100 )))
101 |Parametrized headings|<h1><span style="color:blue">heading</span></h1>|{{{(% style="color:blue" %)}}}
102 ~= heading =|(((
103 {{html}}
104 <h1 id="Hheading" style="color:blue"><span>heading</span></h1>
105 {{/html}}
106 )))
107 |Headings with XWiki Syntax|1.1.1 Heading with *bold*|{{{=== Heading with **bold** ===}}}|(((
108 === Heading with **bold** ===
109 )))
110
111 = Text Formatting =
112
113 {{info}}
114 New in XWiki Syntax 2.0 over XWiki Syntax 1.0:
115 * Spaces are allowed just after the syntax symbols (for example in XWiki Syntax 1.0, this was not possible: * bold *).
116 * 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.
117 * Ability to span several lines (wasn't possible in XWiki Syntax 1.0).
118 {{/info}}
119
120 (% style="width:100%" %)
121 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
122 |Bold|{{{*bold*}}}|{{{**bold**}}}|**bold**
123 |Underline|{{{__underline___}}}|{{{__underline__}}}|__underline__
124 |Italics|{{{~~italic~~}}}|{{{//italic//}}}|//italic//
125 |Striked out|{{{--strike--}}}|{{{--strike--}}}|--strike--
126 |Monospace|<tt>monospace</tt>|{{{##monospace##}}}|##monospace##
127 |Superscript|some <sup>superscript</sup>|{{{some ^^superscript^^}}}|some ^^superscript^^
128 |Subscript|some <sub>subscript</sub>|{{{some ,,subscript,,}}}|some ,,subscript,,
129
130 = Horizontal Line =
131
132 {{info}}
133 There must be 4 or more dashes.
134 {{/info}}
135
136 {{info}}
137 Note that this is different from Creole where exactly 4 dashes are required.
138 {{/info}}
139
140 (% style="width:100%" %)
141 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
142 |Simple horizontal line|{{{----}}}|{{{----}}}|(((
143 ----
144 )))
145 |Parametrized horizontal line|<hr style="color:blue"/>|(((
146 {{{
147 (% style="color:blue" %)
148 ----
149 }}}
150 )))|(((
151 (% style="color:blue" %)
152 ----
153 )))
154
155 = Lists =
156
157 {{info}}
158 Some of the mentioned styles do not work on all browsers. For a comprehensive list follow [[this link>>http://www.quirksmode.org/css/lists.html]].
159 {{/info}}
160
161 (% style="width:100%" %)
162 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
163 |Bulleted list|(((
164 {{{
165 * item 1
166 ** item 2
167 *** item 3
168 * item 4
169 }}}
170 )))|(((
171 {{{
172 * item 1
173 ** item 2
174 *** item 3
175 * item 4
176 }}}
177 )))|(((
178 * item 1
179 ** item 2
180 *** item 3
181 * item 4
182 )))
183 |Numbered list|(((
184 {{{
185 1. item 1
186 11. item 2
187 111. item 3
188 1. item 4
189 }}}
190 )))|(((
191 {{{
192 1. item 1
193 11. item 2
194 111. item 3
195 1. item 4
196 }}}
197 )))|(((
198 1. item 1
199 11. item 2
200 111. item 3
201 1. item 4
202 )))
203 |Mixed list|(((
204 {{{
205 1. item 1
206 1*. item 2
207 1*. item 3
208 1. item 4
209 }}}
210 )))|(((
211 {{{
212 1. item 1
213 1*. item 2
214 1*. item 3
215 1. item 4
216 }}}
217 )))|(((
218 1. item 1
219 1*. item 2
220 1*. item 3
221 1. item 4
222 )))
223 |Square list|(((
224 {{{
225 - item 1
226 - item 2
227 }}}
228 )))|(((
229 {{{
230 (% style="list-style-type: square" %)
231 * item 1
232 * item 2
233 }}}
234 )))|(((
235 (% style="list-style-type: square" %)
236 * item 1
237 * item 2
238 )))
239 |Disc list|(((
240 <ul style="list-style-type: disc">
241 <li>item 1</li>
242 <li>item 2</li>
243 </ul>
244 )))|(((
245 {{{
246 (% style="list-style-type: disc" %)
247 * item 1
248 * item 2
249 }}}
250 )))|(((
251 (% style="list-style-type: disc" %)
252 * item 1
253 * item 2
254 )))
255 |Lowercase Alphabetical list|(((
256 {{{
257 a. item 1
258 a. item 2
259 }}}
260 )))|(((
261 {{{
262 (% style="list-style-type: lower-alpha" %)
263 * item 1
264 * item 2
265 }}}
266 )))|(((
267 (% style="list-style-type: lower-alpha" %)
268 * item 1
269 * item 2
270 )))
271 |Uppercase Alphabetical list|(((
272 {{{
273 A. item 1
274 A. item 2
275 }}}
276 )))|(((
277 {{{
278 (% style="list-style-type: upper-alpha" %)
279 * item 1
280 * item 2
281 }}}
282 )))|(((
283 (% style="list-style-type: upper-alpha" %)
284 * item 1
285 * item 2
286 )))
287 |Lowercase Roman list|(((
288 {{{
289 i. item 1
290 i. item 2
291 }}}
292 )))|(((
293 {{{
294 (% style="list-style-type: lower-roman" %)
295 * item 1
296 * item 2
297 }}}
298 )))|(((
299 (% style="list-style-type: lower-roman" %)
300 * item 1
301 * item 2
302 )))
303 |Uppercase Roman list|(((
304 {{{
305 I. item 1
306 I. item 2
307 }}}
308 )))|(((
309 {{{
310 (% style="list-style-type: upper-roman" %)
311 * item 1
312 * item 2
313 }}}
314 )))|(((
315 (% style="list-style-type: upper-roman" %)
316 * item 1
317 * item 2
318 )))
319 |Lowercase Greek list|(((
320 {{{
321 g. item 1
322 g. item 2
323 }}}
324 )))|(((
325 {{{
326 (% style="list-style-type: lower-greek" %)
327 * item 1
328 * item 2
329 }}}
330 )))|(((
331 (% style="list-style-type: lower-greek" %)
332 * item 1
333 * item 2
334 )))
335 |Uppercase Greek list|(((
336 {{{
337 G. item 1
338 G. item 2
339 }}}
340 )))|(((
341 {{{
342 (% style="list-style-type: upper-greek" %)
343 * item 1
344 * item 2
345 }}}
346 )))|(((
347 (% style="list-style-type: upper-greek" %)
348 * item 1
349 * item 2
350 )))
351 |Hiragana list|(((
352 {{{
353 h. item 1
354 h. item 2
355 }}}
356 )))|(((
357 {{{
358 (% style="list-style-type: hiragana" %)
359 * item 1
360 * item 2
361 }}}
362 )))|(((
363 (% style="list-style-type: hiragana" %)
364 * item 1
365 * item 2
366 )))
367 |Hiragana Iroah list|(((
368 {{{
369 H. item 1
370 H. item 2
371 }}}
372 )))|(((
373 {{{
374 (% style="list-style-type: hiragana-iroha" %)
375 * item 1
376 * item 2
377 }}}
378 )))|(((
379 (% style="list-style-type: hiragana-iroha" %)
380 * item 1
381 * item 2
382 )))
383 |Katakana list|(((
384 {{{
385 k. item 1
386 k. item 2
387 }}}
388 )))|(((
389 {{{
390 (% style="list-style-type: katakana" %)
391 * item 1
392 * item 2
393 }}}
394 )))|(((
395 (% style="list-style-type: katakana" %)
396 * item 1
397 * item 2
398 )))
399 |Katakana Iroha list|(((
400 {{{
401 K. item 1
402 K. item 2
403 }}}
404 )))|(((
405 {{{
406 (% style="list-style-type: katakana-iroha" %)
407 * item 1
408 * item 2
409 }}}
410 )))|(((
411 (% style="list-style-type: katakana-iroha" %)
412 * item 1
413 * item 2
414 )))
415 |Armenian list|(((
416 {{{
417 <ul style="list-style-type: armenian">
418 <li>item 1</li>
419 <li>item 2</li>
420 </ul>
421 }}}
422 )))|(((
423 {{{
424 (% style="list-style-type: armenian" %)
425 * item 1
426 * item 2
427 }}}
428 )))|(((
429 (% style="list-style-type: armenian" %)
430 * item 1
431 * item 2
432 )))
433 |Hebrew list|(((
434 {{{
435 j. item 1
436 j. item 2
437 }}}
438 )))|(((
439 {{{
440 (% style="list-style-type: hebrew" %)
441 * item 1
442 * item 2
443 }}}
444 )))|(((
445 (% style="list-style-type: hebrew" %)
446 * item 1
447 * item 2
448 )))
449 |Georgian list|(((
450 {{{
451 <ul style="list-style-type: georgian">
452 <li>item 1</li>
453 <li>item 2</li>
454 </ul>
455 }}}
456 )))|(((
457 {{{
458 (% style="list-style-type: georgian" %)
459 * item 1
460 * item 2
461 }}}
462 )))|(((
463 (% style="list-style-type: georgian" %)
464 * item 1
465 * item 2
466 )))
467 |CJK ideographic list|(((
468 {{{
469 <ul style="list-style-type: cjk-ideographic">
470 <li>item 1</li>
471 <li>item 2</li>
472 </ul>
473 }}}
474 )))|(((
475 {{{
476 (% style="list-style-type: cjk-ideographic" %)
477 * item 1
478 * item 2
479 }}}
480 )))|(((
481 (% style="list-style-type: cjk-ideographic" %)
482 * item 1
483 * item 2
484 )))
485
486 = Definition Lists =
487
488 (% style="width:100%" %)
489 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
490 |Standard definition|(((
491 {{{
492 <dl>
493 <dt>term</dt>
494 <dd>definition</dd>
495 </dl>
496 }}}
497 )))|(((
498 {{{
499 ; term
500 : definition
501 }}}
502 )))|(((
503 ; term
504 : definition
505 )))
506 |Nested definitions|(((
507 {{{
508 <dl>
509 <dt>term 1</dt>
510 <dd>definition 1
511 <dl>
512 <dt>term 2</dt>
513 <dd>definition 2</dd>
514 </dl>
515 </dd>
516 </dl>
517 }}}
518 )))|(((
519 {{{
520 ; term 1
521 : definition 1
522 :; term 2
523 :: definition 2
524 }}}
525 )))|(((
526 ; term 1
527 : definition 1
528 :; term 2
529 :: definition 2
530 )))
531 |Parametrized definition|(((
532 {{{
533 <dl style="color:blue">
534 <dt>term</dt>
535 <dd>definition</dd>
536 </dl>
537 }}}
538 )))|(((
539 {{{
540 (% style="color:blue" %)
541 ; term
542 : definition
543 }}}
544 )))|(((
545 (% style="color:blue" %)
546 ; term
547 : definition
548 )))
549
550 = New Line/Line breaks =
551
552 A new line is a carriage return. A line break is a forced new line that can appear anywhere in the text.
553
554 {{info}}
555 In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole Syntax.
556 {{/info}}
557
558 (% style="width:100%" %)
559 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
560 |Line break|{{{Line\\New line}}}|{{{Line\\New line}}}|Line
561 New line|Line
562 New line
563 |New line|Line
564 New line|Line
565 New line|Line New line|Line
566 New line
567
568 = Links =
569
570 (% style="width:100%;table-layout:fixed;overflow:hidden;word-wrap:break-word" %)
571 |=(% style="width:10%" %)Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=(% style="width:15%" %)Result XWiki Syntax 1.0|=(% style="width:15%" %)Result XWiki Syntax 2.0
572 |Link to a page in the current Space|{{{[WebHome]}}}|{{{[[WebHome]]}}}|[[Web Home>>WebHome]]|[[WebHome]]
573 |Link with a label|{{{[label>WebHome]}}}|(((
574 {{{[[label>>WebHome]]}}}
575 {{info}}XWiki Syntax is supported inside link labels.{{/info}}
576 )))|[[label>>WebHome]]|[[label>>WebHome]]
577 |Link with XWiki Syntax in the label|{{{<a href="$xwiki.getURL("WebHome")"><strong>bold label</strong></a>}}}|{{{[[**bold label**>>WebHome]]}}}|[[**bold label**>>WebHome]]|[[**bold label**>>WebHome]]
578 |Link to a page with the space specified|{{{[Main.WebHome]}}}|{{{[[Main.WebHome]]}}}|[[Web Home>>Main.WebHome]]|[[Main.WebHome]]
579 |Link to a subwiki|{{{[subwiki:Main.WebHome]}}}|{{{[[subwiki:Main.WebHome]]}}}|[[Web Home>>xwiki:Main.WebHome]]|[[xwiki:Main.WebHome]]
580 |Link that opens in a new window|{{{[label>WebHome>_blank]}}}|{{{[[label>>WebHome||rel="__blank"]]}}}|[[label>>WebHome||rel="__blank"]]|[[label>>WebHome||rel="__blank"]]
581 |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
582 |Link to a URL|{{{[http://xwiki.org]}}}|{{{[[http://xwiki.org]]}}}|[[http://xwiki.org]]|[[http://xwiki.org]]
583 |Link to a URL with a label|{{{[XWiki>http://xwiki.org]}}}|{{{[[XWiki>>http://xwiki.org]]}}}|[[XWiki>>http://xwiki.org]]|[[XWiki>>http://xwiki.org]]
584 |Link to an email address|{{{[[email protected]>mailto:[email protected]]}}}|{{{[[[email protected]>>mailto:[email protected]]]}}}|[[[email protected]>>mailto:[email protected]]]|[[[email protected]>>mailto:[email protected]]]
585 |Image Link|{{{<a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2}</a>}}}|{{{[[image:[email protected]>>Space1.Page1]]}}}|[[image:img.png>>Main.WebHome]]|[[image:img.png>>Main.WebHome]]
586 |Image Link with image parameters|{{{<a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2|width=26|height=26}</a>}}}|{{{[[[[image:[email protected]||width="26" height="26"]]>>Space1.Page1]]}}}|[[[[image:img.png||width="26" height="26"]]>>Main.WebHome]]|[[[[image:img.png||width="26" height="26"]]>>Main.WebHome]]
587 |Link to an attachment on the current page|(((
588 {{info}}See [[Attach Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Attach+Macro+%28Radeox%29]] for details{{/info}}
589 {{{{attach:text|file=img.png}}}}
590 )))|{{{[[text>>attach:img.png]]}}}|[[text>>attach:img.png]]|[[text>>attach:img.png]]
591 |Link to an attachment in a different page|(((
592 {{info}}See [[Attach Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Attach+Macro+%28Radeox%29]] for details{{/info}}
593 {{{{attach:text|document=Space.Page|file=img.png}}}}
594 )))|{{{[[text>>attach:[email protected]]]}}}|[[text>>attach:[email protected]]]|[[text>>attach:[email protected]]]
595
596 == XWiki Syntax 1.0 Link Specification ==
597
598 {{info}}
599 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.
600 {{/info}}
601
602 The full format of a link is **##[label {> or |}] (resource) [@interWikiAlias] [{> or |} target]##**
603
604 * **##label##**: An optional string which will be displayed to the user as the link name when rendered. Example: ##My Page##
605 * **##resource##**: The full link reference using the following syntax: **##(reference) [?queryString] [#anchor]##**
606 ** **##reference##**: The link reference. This can be either
607 *** **A URI** in the form **##protocol:path##** (examples: ##http:~/~/xwiki.org##, ##mailto~:[email protected]##), or
608 *** **A wiki page** reference in the form **##~[~[wikiName:] space.] (page)##**. Examples: ##WebHome##, ##Main.WebHome##, ##mywiki:Main.WebHome##
609 **** **##wikiName##**: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: ##mywiki##
610 **** **##space##**: An optional wiki Space name. If no space is specified the current space is used. Example: ##Main##
611 **** **##page##**: A required string containing the name of the linked wiki page. Example: ##WebHome##
612 ** **##queryString##**: An optional query string for specifying parameters that will be used in the rendered URL. Example: ##mydata1=5&mydata2=Hello##
613 ** **##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##
614 * **##interWikiAlias##**: An optional [[Inter Wiki>>http://en.wikipedia.org/wiki/InterWiki]] alias as defined in the InterWiki Map (see the [[Admin Guide>>platform:AdminGuide.WebHome]]). This is only valid for wiki page names. Example: ##wikipedia##
615 * **##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 window. Examples: ##_self##, ##_blank##
616
617 == XWiki Syntax 2.0 Link Specification ==
618
619 {{info}}
620 The part in ##( )## is required, while the parts in ##[ ]## are optional.
621 {{/info}}
622
623 The full format of a link is **##[label>>] (resource) [@interWikiAlias] [||parameters]##**
624
625 * **##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>>platform:AdminGuide.WebHome]]. Example: ##My Page##
626 * **##resource##**: The full link reference using the following syntax: **##(reference) [?queryString] [#anchor]##**
627 ** **##reference##**: The link reference in one of the following forms:
628 *** **URL**: Any URL in the form of **##protocol:~/~/path##**. Examples: ##http:~/~/xwiki.org##, ##https:~/~/svn.xwiki.org/##
629 *** **Wiki page name** reference in the form **##~[~[wikiName:] space.] (page)##**. Examples: ##WebHome##, ##Main.WebHome##, ##mywiki:Main.WebHome##
630 **** **##wikiName##**: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: ##mywiki##
631 **** **##space##**: An optional wiki Space name. If no space is specified the current space is used. Example: ##Main##
632 **** **##page##**: A required string containing the name of the linked wiki page. Example: ##WebHome##
633 *** **Attachment** reference in the form **##attach~: [[email protected]] (attachmentName)##** (###anchor## is not valid). Examples: ##attach~:img.png##, ##attach~:mywiki:[email protected]##
634 **** **##attach~:##**: A required string identifying the resource as attachment.
635 **** **##wikiPageName##**: An optional string referencing the document that holds the attachment, see "Wiki page name" above.
636 **** **##attachmentName##**: Name of the attachment as it is stored in the wiki.
637 *** **Email address** in the form **##mailto~: (emailAddress)##** (###anchor## is not valid). Example: ##mailto~:[email protected]##
638 **** **##mailto~:##**: A required string identifying the resource as email.
639 **** **##emailAddress##**: Targeted email address. Example: "##[email protected]##"
640 ** **##queryString##**: An optional query string for specifying parameters that will be used in the rendered URL. Example: ##mydata1=5&mydata2=Hello##
641 ** **##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##
642 * **##interWikiAlias##**: An optional [[Inter Wiki>>http://en.wikipedia.org/wiki/InterWiki]] alias as defined in the InterWiki Map (see the [[Admin Guide>>platform:AdminGuide.WebHome]]). This is only valid for wiki page names. Example: ##wikipedia##
643 * **##parameters##**: An optional list of parameters passed to the link. Example: ##rel="~_~_blank"## (open in new window)
644
645 == XWiki Syntax 2.1 Link Specification ==
646
647 {{info}}
648 The part in ##( )## is required, while the parts in ##[ ]## are optional.
649 {{/info}}
650
651 The full format of a link is **##[label>>] (resource) [||parameters]##**
652
653 * **##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>>platform:AdminGuide.WebHome]]. Example: ##My Page##
654 * **##resource##**: A required string with the link reference in one of the following forms
655 ** **URL**: Any URL in the form of **##[url:] (protocol:~/~/path)##**. Examples: ##http:~/~/xwiki.org##, ##url:https:~/~/svn.xwiki.org/##
656 *** **##url:##** An optional string identifying the resource as an URL.
657 ** **Wiki page name** reference in the form **##[doc:] ~[~[wikiName:] space.] (page)##**. Examples: ##WebHome##, ##Main.WebHome##, ##mywiki:Main.WebHome##
658 *** **##doc:##** An optional string identifying the resource as an XWiki document.
659 *** **##wikiName##**: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: ##mywiki##
660 *** **##space##**: An optional wiki Space name. If no space is specified the current space is used. Example: ##Main##
661 *** **##page##**: A required string containing the name of the linked wiki page. Example: ##WebHome##
662 ** **InterWiki page name** reference in the form **##interwiki: {{{(interWikiAlias:)}}} (page)##**. Example: ##interwiki:wikipedia:XWiki##
663 *** **##interwiki:##** A required string identifying the resource as an InterWiki link.
664 *** **##interWikiAlias##**: An optional [[Inter Wiki>>http://en.wikipedia.org/wiki/InterWiki]] alias as defined in the InterWiki Map (see the [[Admin Guide>>platform:AdminGuide.WebHome]]). Example: ##wikipedia##
665 *** **##page##**: A required string containing the name of the linked page. Example: ##XWiki##
666 ** **Attachment** reference in the form **##attach~: [[email protected]] (attachmentName)##** (###anchor## is not valid). Examples: ##attach~:img.png##, ##attach~:mywiki:[email protected]##
667 *** **##attach~:##**: A required string identifying the resource as attachment.
668 *** **##wikiPageName##**: An optional string referencing the document that holds the attachment, see "Wiki page name" above.
669 *** **##attachmentName##**: Name of the attachment as it is stored in the wiki.
670 ** **Email address** in the form **##mailto~: (emailAddress)##** (###anchor## is not valid). Example: ##mailto~:[email protected]##
671 *** **##mailto~:##**: A required string identifying the resource as email.
672 *** **##emailAddress##**: Targeted email address. Example: ##[email protected]##
673 ** **Relative path** reference on the server in the form **##path: (relPath)##**. Example: ##path:$doc.getURL('reset')## produces target address ##http:~/~/server.domain.com/xwiki/bin/reset/Space/Page## where ##/xwiki/bin/reset/Space/Page## is produced by ##$doc.getURL('reset')##.
674 *** **##path:##** A required string identifying the resource as a relative path.
675 *** **##relPath##**: A required string containing the relative path of the resource on the server that shall be linked.
676 ** **UNC (Windows Explorer)** reference in the form **##unc: (path)##**. The link is rendered as a ##file:~/~/## link. Examples: ##unc:C:\Windows\##, ##unc:~\~\myserver\path\img.png##, ##unc:home/user/somefile##
677 *** **##unc:##** A required string identifying the resource as a UNC (Windows Explorer) path.
678 *** **##path##**: A required string containing the local path of resource accessible by the user. Examples: ##C:\Windows\##, ##~\~\myserver\path\img.png##, ##home/user/somefile##
679 * **##parameters##**: An optional list of space-separated parameters passed to the link. Example: ##queryString="mydata1=5&mydata2=Hello" anchor="HTableOfContents" rel="~_~_blank"##
680 ** **##queryString##**: An optional query string for specifying parameters that will be appended to the link target address and used in the rendered URL. Example: ##url:http:~/~/domain.com/path||queryString="mydata1=5&mydata2=Hello"## produces target address ##http:~/~/domain.com/path?mydata1=5&mydata2=Hello##
681 ** **##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: ##url:http:~/~/domain.com/path||anchor="HTableOfContents"## produces target address ##http:~/~/domain.com/path#HTableOfContents##
682 ** **##rel##**: An optional parameter that allows to open link target in new window. Example: ##rel="~_~_blank"##
683
684 = Tables =
685
686 Allows to easily create content in table format. Parameters for table, row or cell are also supported in XWiki Syntax 2.0.
687
688 (% style="width:100%" %)
689 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
690 |Standard table|(((
691 {{{
692 {table}
693 Title 1 | Title 2
694 Word 1 | Word 2
695 {table}
696 }}}
697 )))|(((
698 {{{
699 |=Title 1|=Title 2
700 |Word 1|Word 2
701 }}}
702 )))or(((
703 {{{
704 !=Title 1!=Title 2
705 !!Word 1!!Word 2
706 }}}
707 )))|(((
708 |=Title 1|=Title 2
709 |Word 1|Word 2
710 )))
711 |Parametrized table|(((
712 <table style="background-color:red;align:center">
713 <tbody>
714 <tr>
715 <td>Title 1</td>
716 <td style="background-color:yellow">Title 2</td>
717 </tr>
718 <tr>
719 <td>Word 1</td>
720 <td>Word 2</td>
721 </tr>
722 </tbody>
723 </table>
724 )))|(((
725 {{{
726 (% style="background-color:red;align=center" %)
727 |=Title 1|=(% style="background-color:yellow" %)Title 2
728 |Word 1|Word 2
729 }}}
730 )))|(((
731 (% style="background-color:red;align=center" %)
732 |=Title 1|=(% style="background-color:yellow" %)Title 2
733 |Word 1|Word 2
734 )))
735 |Filterable Sortable table|(((
736 {{{
737 $xwiki.ssfx.use("js/xwiki/table/table.css")
738 $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
739 <table id="tableid" class="grid sortable filterable doOddEven">
740 <tr class="sortHeader">
741 <th>Title 1</th>
742 <th>Title 2</th>
743 </tr>
744 <tr>
745 <td>Cell 11</td>
746 <td>Cell 12</td>
747 </tr>
748 <tr>
749 <td>Cell 21</td>
750 <td>Cell 22</td>
751 </tr>
752 </table>
753 }}}
754
755 {{info}}
756 For improved features see the [[Livetable Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro]].
757 {{/info}}
758 )))|(((
759 {{{
760 {{velocity}}
761 $xwiki.ssfx.use("js/xwiki/table/table.css")
762 $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
763 {{/velocity}}
764
765 (% class="grid sortable filterable doOddEven" id="tableid" %)
766 (% class="sortHeader" %)|=Title 1|=Title 2
767 |Cell 11|Cell 12
768 |Cell 21|Cell 22
769 }}}
770
771 {{info}}
772 For improved features see the [[Livetable Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro]].
773 {{/info}}
774 )))|(((
775 {{velocity}}
776 $xwiki.ssfx.use("js/xwiki/table/table.css")
777 $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
778 {{/velocity}}
779
780 (% class="grid sortable filterable doOddEven" id="tableid" %)
781 (% class="sortHeader" %)|=Title 1|=Title 2
782 |Cell 11|Cell 12
783 |Cell 21|Cell 22
784 )))
785
786 = Images =
787
788 (% style="width:100%" %)
789 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
790 |Image from attachment on current page|(((
791 {{info}}See [[Image Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Image+Macro+%28Radeox%29]] for details{{/info}}
792 {{{{image:img.png}}}}
793 )))|{{{image:img.png}}}|[[image:img.png]]
794 |Image from attachment on another page|{{{{image:img.png|document=Space.Page}}}}|{{{image:[email protected]}}}|[[image:img.png]]
795 |Image with parameters|{{{{image:img.png|width=25|height=25}}}}|{{{[[image:img.png||width="25" height="25"]]}}}|[[image:img.png||width="25" height="25"]]
796 |Images located at URL|{{{http://some/url/img.png}}}|{{{image:http://some/url/img.png}}}|[[image:img.png]]
797
798 == Icon mappings ==
799
800 Below is a list of characters and icons which they are mapped to by default. Note that the administrator may modify these or add new mappings in the ##xwiki.properties## file.
801
802 |=Characters|=Result
803 |##{{{:)}}}##|:)
804 |##{{{:(}}}##|:(
805 |##{{{:P}}}##|:P
806 |##{{{:D}}}##|:D
807 |##{{{;)}}}##|;)
808 |##{{{(y)}}}##|(y)
809 |##{{{(n)}}}##|(n)
810 |##{{{(i)}}}##|(i)
811 |##{{{(/)}}}##|(/)
812 |##{{{(x)}}}##|(x)
813 |##{{{(!)}}}##|(!)
814 |##{{{(+)}}}##|(+)
815 |##{{{(-)}}}##|(-)
816 |##{{{(?)}}}##|(?)
817 |##{{{(on)}}}##|(on)
818 |##{{{(off)}}}##|(off)
819 |##{{{(*)}}}##|(*)
820
821 == XWiki Syntax 2.0 Image Specification ==
822
823 {{info}}
824 The part in ##( )## is required, while the parts in ##{ }## are optional.
825 {{/info}}
826
827 The full format of an image is either **##image~: (reference)##** or **##~[~[image~: (reference) {||parameters}]]##**
828
829 * **##image~:##** A required string identifying the resource as image.
830 * **##reference##**: The reference to the image that shall be displayed in one of the following forms:
831 ** **URL**: Any URL to an image in the form of **##http:~/~/path/imageName##**. Example: ##http:~/~/domain.org/path/img.png##
832 ** **Attachment** reference in the form **##~{~{~{wikiName:} space.} [email protected]} (imageName)##**
833 *** **##wikiName##**: An optional string containing the name of a virtual wiki. The image reference will point to an image attached to a page inside that virtual wiki. Example: mywiki
834 *** **##space##**: An optional wiki Space name. If no space is specified the current space is used. Example: Main
835 *** **##page##**: An optional string containing the name of the wiki page to which the referenced image is attached. Example: WebHome
836 *** **##imageName##**: A required string containing the name of the image attached to a page as it is stored in the wiki.
837 * **##parameters##**: An optional list of space-separated parameters passed to the image. Example: ##width="800" height="600" alt="img.png" title="My nice image"##
838 ** **HTML attributes**: All attributes defined by the HTML standard will be added to the rendered HTML ##<img>## tag.
839 *** **##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="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)
840 *** **##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%"##).
841 *** **##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%"##).
842 *** **##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"##
843 *** **##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"##
844 *** **More**: A more in depth explanation on the HTML ##<img>## tag including more attributes can be reviewed [[on w3.org>>http://www.w3.org/TR/html4/struct/objects.html#h-13.2]].
845
846 == XWiki Syntax 2.1 Image Specification ==
847
848 {{info}}
849 The part in ##( )## is required, while the parts in ##{ }## are optional.
850 {{/info}}
851
852 The full format of an image is either **##image~: (reference)##** or **##~[~[image~: (reference) {||parameters}]]##**
853
854 * **##image~:##** A required string identifying the resource as image.
855 * **##reference##**: The reference to the image that shall be displayed in one of the following forms:
856 ** **URL**: Any URL to an image in the form of **##protocol:~/~/path/imageName##**. Example: ##http:~/~/domain.org/path/img.png##
857 ** **Attachment** reference in the form **##~{~{~{wikiName:} space.} [email protected]} (imageName)##**
858 *** **##wikiName##**: An optional string containing the name of a virtual wiki. The image reference will point to an image attached to a page inside that virtual wiki. Example: mywiki
859 *** **##space##**: An optional wiki Space name. If no space is specified the current space is used. Example: Main
860 *** **##page##**: An optional string containing the name of the wiki page to which the referenced image is attached. Example: WebHome
861 *** **##imageName##**: A required string containing the name of the image attached to a page as it is stored in the wiki.
862 ** **Icon** reference in the form **##{{{(icon:)}}} (iconName)##**. Example: **##icon:accept##**
863 *** **##icon:##** A required string identifying the image reference as an icon from the [[XWiki Icon Set>>http://www.famfamfam.com/lab/icons/silk/previews/index_abc.png]].
864 *** **##iconName##**: A required string identifying the icon referenced. Example: ##accept##
865 * **##parameters##**: An optional list of space-separated parameters passed to the image. Example: ##width="800" height="600" alt="img.png" title="My nice image"##
866 ** **HTML attributes**: All attributes defined by the HTML standard will be added to the rendered HTML ##<img>## tag.
867 *** **##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="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)
868 *** **##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%"##).
869 *** **##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%"##).
870 *** **##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"##
871 *** **##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"##
872 *** **More**: A more in depth explanation on the HTML ##<img>## tag including more attributes can be reviewed [[on w3.org>>http://www.w3.org/TR/html4/struct/objects.html#h-13.2]].
873 ** **##queryString##**: Allows queries to be passed to the server when creating the download link for the referenced image. Example: ##queryString="width=100&height=800&keepAspectRatio=true"## (**##keepAspectRatio=true## will fail if the ##width## and ##height## parameters are specified in addition to ##queryString##!**)
874
875 = Verbatim =
876
877 Allow to enter content that will not be formatted (in other words the XWiki Syntax will not be taken into account).
878
879 {{info}}
880 In XWiki Syntax 1.0 the [[Pre macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Pre+Macro+%28Radeox%29]] only preserves XWiki Syntax and Radeox macros. However HTML snippets and Groovy/Velocity scripts are still executed.
881 {{/info}}
882
883 (% style="width:100%" %)
884 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
885 |Verbatim inline|{{{Some verbatim {pre}*[not rendered]*{/pre} content}}}|{{{Some verbatim {{{**[[not rendered]]**}}} content}}}|Some verbatim {{{*[not rendered]*}}} content|Some verbatim {{{**[[not rendered]]**}}} content
886 |Verbatim block|(((
887 {{{
888 {pre}
889 multi line
890 *verbatim*
891 content
892 {/pre}
893 }}}
894 {{info}}It's also possible to use the [[Code macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Code+Macro+%28Radeox%29]] but it displays its content in a box by default.{{/info}}
895 )))|(((
896 {{{
897 {{{
898 multi line
899 **verbatim**
900 content
901 }}}
902 }}}
903 )))|(((
904 {{{
905 multi line
906 *verbatim*
907 content
908 }}}
909 )))|(((
910 {{{
911 multi line
912 **verbatim**
913 content
914 }}}
915 )))
916
917 = Quotations =
918
919 Allows to quote some text.
920
921 (% style="width:100%" %)
922 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
923 |Simple quote|(((
924 <blockquote><p>john said this</p></blockquote>
925 I said ok
926 )))|(((
927 {{{
928 > john said this
929 I said ok
930 }}}
931 )))|(((
932 > john said this
933
934 I said ok
935 )))
936 |Nested quotes|(((
937 <blockquote><p>john said this</p>
938 <blockquote><p>marie answered that</p></blockquote>
939 </blockquote>
940 I said ok
941 )))|(((
942 {{{
943 > john said this
944 >> marie answered that
945 I said ok
946 }}}
947 )))|(((
948 > john said this
949 >> marie answered that
950
951 I said ok
952 )))
953
954 = Groups =
955
956 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.
957
958 (% style="width:100%" %)
959 |=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
960 |{{info}}This feature doesn't exist in XWiki Syntax 1.0. You'd have to use pure HTML to achieve the result.{{/info}}|(((
961 {{{
962 |=Header 1|=Header 2|=Header 3
963 |Cell One|(((
964 = Embedded document =
965
966 Some embedded paragraph.
967
968 * list item one
969 * list item two
970 ** sub-item 1
971 ** sub-item 2
972 ))) | Cell Three
973
974 Next paragraph in the top-level document
975 }}}
976 )))|(((
977 |=Header 1|=Header 2|=Header 3
978 |Cell One|(((
979 {{html}}
980 <h1 id="HEmbeddeddocument"><span>Embedded document</span></h1>
981 {{/html}}
982
983 Some embedded paragraph.
984
985 * list item one
986 * list item two
987 ** sub-item 1
988 ** sub-item 2
989 )))| Cell Three
990
991 Next paragraph in the top-level document
992 )))
993
994 = Escapes =
995
996 Allows to escape XWiki Syntax.
997
998 (% style="width:100%" %)
999 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
1000 |Escape a character|{{{This is not a \[link\]}}}|(((
1001 {{{This is not a ~[~[link~]~]}}}
1002 {{info}}To enter a ~~ character use a double escape: ~~~~{{/info}}
1003 )))|{{{This is not a [link]}}}|{{{This is not a [[link]]}}}
1004
1005 = Macros =
1006
1007 There are 2 kinds of macros in XWiki Syntax 1.0:
1008
1009 * Velocity macros (called using the ###macroname(param1 ... paramN)## syntax)
1010 * Radeox macros (called using the ##{macroname:param1=value1|...|paramN=valueN}## syntax)
1011
1012 There are also 2 kinds of macros in XWiki Syntax 2.0:
1013
1014 * Velocity macros (called using the ###macroname(param1 ... paramN)## syntax inside the Velocity Macro)
1015 * XWiki macros (called using the ##{{{{{macroname param1="value1" ... paramN="valueN"}}}}}## syntax)
1016
1017 {{info}}
1018 The Radeox macros cannot be used in XWiki Syntax 2.0. Thus they have been rewritten as XWiki macros.
1019 {{/info}}
1020
1021 {{info}}
1022 For the full list of available macros check the [[Extensions wiki>>http://extensions.xwiki.org/]].
1023 {{/info}}
1024
1025 (% style="width:100%" %)
1026 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0
1027 |Velocity Macro|(((
1028 {{{#info("Some text")}}}
1029 )))|(((
1030 {{{
1031 {{info}}
1032 Some text
1033 {{/info}}
1034 }}}
1035 )))
1036 |Radeox Macro/XWiki Macro|(((
1037 {{{
1038 {code:java}
1039 java content
1040 {code}
1041 }}}
1042 )))|(((
1043 {{{
1044 {{code language="java"}}
1045 java content
1046 {{/code}}
1047 }}}
1048 )))
1049
1050 = HTML =
1051
1052 {{info}}
1053 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.
1054 {{/info}}
1055
1056 (% style="width:100%" %)
1057 |=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
1058 |<b>bold</b>|{{{{{html}}<b>bold</b>{{/html}}}}}|{{html}}<b>bold</b>{{/html}}
1059
1060 {{info}}
1061 In XWiki Syntax 2.0, by default the HTML macro does not understands XWiki Syntax (other macros included since it's XWiki Syntax too). To enable it, use {{{{{html wiki="true"}}}}}.
1062 {{/info}}
1063
1064 = Velocity/Groovy Scripts =
1065
1066 {{info}}
1067 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.
1068 {{/info}}
1069
1070 (% style="width:100%" %)
1071 |=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0
1072 |Velocity script|(((
1073 {{{
1074 #set ($var = "whatever")
1075 }}}
1076 )))|(((
1077 {{{
1078 {{velocity}}
1079 #set ($var = "whatever")
1080 {{/velocity}}
1081 }}}
1082 )))
1083 |Groovy script|(((
1084 {{{
1085 <%
1086 def var = "whatever"
1087 %>
1088 }}}
1089 )))|(((
1090 {{{
1091 {{groovy}}
1092 def var = "whatever"
1093 {{/groovy}}
1094 }}}
1095 )))
1096
1097 = Parameters =
1098
1099 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.
1100
1101 (% style="width:100%" %)
1102 |=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Generated XHTML
1103 |(((
1104 {{{
1105 <h1 class="myClass" style="myStyle" id="myId">heading</h1>
1106 }}}
1107 )))|(((
1108 {{{
1109 (% class="myClass" style="myStyle" id="myId" %)
1110 = heading =
1111 }}}
1112 )))|(((
1113 {{{
1114 <h1 class="myClass" style="myStyle" id="myId">heading</h1>
1115 }}}
1116 )))
1117
1118 {{id name="syntaxes"/}}
1119
1120 = Other syntaxes =
1121
1122 The following other syntaxes are implemented in XWiki 1.6 and later:
1123
1124 * [[JSPWiki>>http://www.jspwiki.org/wiki/TextFormattingRules]]
1125 * [[MediaWiki>>http://en.wikipedia.org/wiki/Help:Editing]]
1126 * [[Confluence>>http://confluence.atlassian.com/display/CONF20/Confluence+Notation+Guide+Overview]]
1127 * [[TWiki>>http://twiki.org/cgi-bin/view/TWiki/WikiSyntax]]
1128 * [[Creole 1.0>>http://www.wikicreole.org/wiki/Creole1.0]]
1129 * [[XHTML 1.0>>http://www.w3.org/TR/xhtml1/]]
1130
1131 {{warning}}
1132 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.
1133 {{/warning}}

Get Connected