Wiki source code of XWikiSyntax

Version 29.1 by Vincent Massol on 2008/09/30

Show last authors
1 #* Temporarily comment this out. When the new content is stabilized commit it in SVN in XE
2 $context.setCacheDuration(100000)
3 #set ($content = $xwiki.getURLContent("http://svn.xwiki.org/svnroot/xwiki/enterprise/trunk/wiki/src/main/resources/XWiki/XWikiSyntax.xml"))
4
5 #set ($newdoc = $xwiki.getDocument("Dummy"))
6 #set ($newdocprivate = $newdoc.getDocument())
7 $newdocprivate.fromXML($content)
8
9 $xwiki.parseContent($newdoc.content)
10 *#
11
12 #startfloatingbox()
13 *Contents*
14 #toc ("2" "2" "")
15 #endfloatingbox()
16
17 1 XWiki Syntaxes
18
19 Starting with XWiki Enterprise version 1.6 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:
20 * Fix the deficiencies and ambiguities of the XWiki 1.0 syntax (which was inspired by both Radeox - the underlying rendering engine - and TWiki).
21 ** 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.
22 ** 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.
23 * 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.
24
25 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>#HOthersyntaxes]
26
27 1.1 General Remarks
28
29 XWiki Syntax v2.0 corrects some errors entered by the user as shown in the examples in the table below.
30
31 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
32 <tr>
33 <th>Example of invalid syntax</th>
34 <th>Fixed XWiki Syntax 2.0</th>
35 </tr>
36 <tr>
37 {pre}
38 <td>
39 **bold
40 </td>
41 <td>
42 **bold**
43 </td>
44 {/pre}
45 </tr>
46 <tr>
47 {pre}
48 <td>
49 || table cell<br/>
50 * list item
51 </td>
52 <td>
53 || table cell<br/>
54 <br/>
55 * list item
56 </td>
57 {/pre}
58 </tr>
59 <tr>
60 {pre}
61 <td>
62 paragraph<br/>
63 ----<br/>
64 paragraph
65 </td>
66 <td>
67 paragraph<br/>
68 <br/>
69 ----<br/>
70 <br/>
71 paragraph
72 </td>
73 {/pre}
74 </tr>
75 <tr>
76 {pre}
77 <td>
78 &lt;new line at beginning of document&gt;<br/>
79 paragraph
80 </td>
81 <td>
82 paragraph
83 </td>
84 {/pre}
85 </tr>
86 </table>
87
88 1.1 Paragraphs
89
90 Paragraphs are text elements separated by 2 or more new lines.
91
92 #info("In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole syntax.")
93
94 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
95 <tr>
96 <th>Feature</th>
97 <th>XWiki Syntax 1.0</th>
98 <th>XWiki Syntax 2.0</th>
99 <th>Result XWiki Syntax 1.0</th>
100 <th>Result XWiki Syntax 1.2</th>
101 </tr>
102 <tr>
103 {pre}
104 <td>Simple paragraph</td>
105 <td>This is a paragraph</td>
106 <td>This is a paragraph</td>
107 {/pre}
108 <td>This is a paragraph</td>
109 <td>This is a paragraph</td>
110 </tr>
111 <tr>
112 {pre}
113 <td>Paragraph on multiple lines</td>
114 <td>Paragraph on<br/>multiple lines</td>
115 <td>Paragraph on<br/>multiple lines</td>
116 {/pre}
117 <td>
118 Paragraph on
119 multiple lines
120 </td>
121 <td>
122 Paragraph on<br/>
123 multiple lines
124 </td>
125 </tr>
126 <tr>
127 {pre}
128 <td>Two paragraphs</td>
129 <td>Paragraph one<br/><br/>Paragraph two</td>
130 <td>Paragraph one<br/><br/>Paragraph two</td>
131 {/pre}
132 <td>
133 Paragraph one
134
135 Paragraph two
136 </td>
137 <td>
138 Paragraph one
139
140 Paragraph two
141 </td>
142 </tr>
143 <tr>
144 {pre}
145 <td>Parametrized paragraph</td>
146 <td>
147 &lt;p style="text-align:center;color:blue"&gt;Centered and blue paragraph&lt;/&gt;
148 </td>
149 <td>
150 (% style="text-align:center;color:blue" %)<br/>
151 Centered and blue paragraph
152 {/pre}
153 <td>
154 <p style="text-align:center;color:blue">Centered and blue paragraph</p>
155 </td>
156 <td>
157 <p style="text-align:center;color:blue">Centered and blue paragraph</p>
158 </td>
159 </tr>
160 </table>
161
162 1.1 Headers
163
164 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
165 <tr>
166 <th>Feature</th>
167 <th>XWiki Syntax 1.0</th>
168 <th>XWiki Syntax 2.0</th>
169 <th>Result</th>
170 </tr>
171 <tr>
172 {pre}
173 <td>Standard headers</td>
174 <td>
175 #set ($h1 = "1")
176 #set ($h2 = "1.1")
177 #set ($h3 = "1.1.1")
178 #set ($h4 = "1.1.1.1")
179 #set ($h5 = "1.1.1.1.1")
180 #set ($h6 = "1.1.1.1.1.1")
181 $h1 level 1<br/>
182 $h2 level 2<br/>
183 $h3 level 3<br/>
184 $h4 level 4<br/>
185 $h5 level 5<br/>
186 $h6 level 6
187 </td>
188 <td>
189 = level 1<br/>
190 == level 2<br/>
191 === level 3<br/>
192 ==== level 4<br/>
193 ===== level 5<br/>
194 ====== level 6
195 #info("Closing equal signs are optional.")
196 </td>
197 {/pre}
198 <td>
199 $h1 level 1
200 $h2 level 2
201 $h3 level 3
202 $h4 level 4
203 $h5 level 5
204 $h6 level 6
205 </td>
206 </tr>
207 <tr>
208 {pre}
209 <td>Parametrized headers</td>
210 <td>
211 &lt;h2 class="heading-1"&gt;&lt;span style="color:blue"&gt;header&lt;/span&gt;&lt;/h2&gt;
212 </td>
213 <td>
214 (% style="color:blue" %)<br/>
215 $h1 header
216 </td>
217 {/pre}
218 <td>
219 <h2 class="heading-1" id="Hlevel1"><span style="color:blue">header</span></h2>
220 </td>
221 </tr>
222 <tr>
223 {pre}
224 <td>Headers with wiki syntax</td>
225 <td>$h3 Header with *bold*</td>
226 <td>=== Header with **bold**</td>
227 {/pre}
228 <td>
229 $h3 Header with *bold*
230 </td>
231 </tr>
232 </table>
233
234 1.1 Text Formatting
235
236 #info("New in XWiki Syntax 2.0 over XWiki Syntax 1.0:
237 * Spaces are allowed just after the syntax symbols (for example in XWiki Syntax 1.0, this was not * bold *).
238 * 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.
239 * Ability to span several lines (wasn't the case in XWiki Syntax 1.0).")
240
241 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
242 <tr>
243 <th>Feature</th>
244 <th>XWiki Syntax 1.0</th>
245 <th>XWiki Syntax 2.0</th>
246 <th>Result</th>
247 </tr>
248 <tr>
249 {pre}
250 <td>Bold</td>
251 <td>*bold*</td>
252 <td>**bold**</td>
253 {/pre}
254 <td>*bold*</td>
255 </tr>
256 <tr>
257 {pre}
258 <td>Underline</td>
259 <td>__underline___</td>
260 <td>__underline__</td>
261 {/pre}
262 <td>__underline__</td>
263 </tr>
264 <tr>
265 {pre}
266 <td>Italics</td>
267 <td>~~italic~~</td>
268 <td>//italic//</td>
269 {/pre}
270 <td>~~italic~~</td>
271 </tr>
272 <tr>
273 {pre}
274 <td>Striked out</td>
275 <td>--strike--</td>
276 <td>--strike--</td>
277 {/pre}
278 <td>--strike--</td>
279 </tr>
280 <tr>
281 {pre}
282 <td>Monospace</td>
283 <td>&lt;tt&gt;monospace&lt;/tt&gt;</td>
284 #set($dash = "#")
285 <td>${dash}${dash}monospace${dash}${dash}</td>
286 {/pre}
287 <td><tt>monospace</tt></td>
288 </tr>
289 <tr>
290 {pre}
291 <td>Superscript</td>
292 <td>some &lt;sup&gt;superscript&lt;/sup&gt;</td>
293 <td>some ^^superscript^^</td>
294 {/pre}
295 <td>some <sup>superscript</sup></td>
296 </tr>
297 <tr>
298 {pre}
299 <td>Subscript</td>
300 <td>some &lt;sub&gt;subscript&lt;/sub&gt;</td>
301 <td>some ,,subscript,,</td>
302 {/pre}
303 <td>some <sub>subscript</sub></td>
304 </tr>
305 </table>
306
307 1.1 Horizontal Line
308
309 #info("There must be 4 or more dashes.")
310 #info("Note that this is different from Creole where exactly 4 dashes are required.")
311
312 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
313 <tr>
314 <th>Feature</th>
315 <th>XWiki Syntax 1.0</th>
316 <th>XWiki Syntax 2.0</th>
317 <th>Result</th>
318 </tr>
319 <tr>
320 {pre}
321 <td>Simple Horizontal Line</td>
322 <td>----</td>
323 <td>----</td>
324 {/pre}
325 <td><hr/></td>
326 </tr>
327 <tr>
328 {pre}
329 <td>Parametrized Horizontal Line</td>
330 <td>
331 &lt;hr style="color:blue"/&gt;
332 </td>
333 <td>
334 (% style="color:blue" %)<br/>
335 ----
336 </td>
337 {/pre}
338 <td><hr style="color:blue"/></td>
339 </tr>
340 </table>
341
342 1.1 Lists
343
344 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
345 <tr>
346 <th>Feature</th>
347 <th>XWiki Syntax 1.0</th>
348 <th>XWiki Syntax 2.0</th>
349 <th>Result</th>
350 </tr>
351 <tr>
352 {pre}
353 <td>Bulleted list</td>
354 <td>
355 * item 1<br/>
356 ** item 2<br/>
357 *** item 3<br/>
358 * item 4
359 </td>
360 <td>
361 * item 1<br/>
362 ** item 2<br/>
363 *** item 3<br/>
364 * item 4
365 </td>
366 {/pre}
367 <td>
368 * item 1
369 ** item 2
370 *** item 3
371 * item 4
372 </td>
373 </tr>
374 <tr>
375 {pre}
376 <td>Numbered list</td>
377 <td>
378 1. item 1<br/>
379 11. item 2<br/>
380 111. item 3<br/>
381 1. item 4
382 </td>
383 <td>
384 1. item 1<br/>
385 11. item 2<br/>
386 111. item 3<br/>
387 1. item 4
388 </td>
389 {/pre}
390 <td>
391 1. item 1
392 11. item 2
393 111. item 3
394 1. item 4
395 </td>
396 </tr>
397 <tr>
398 {pre}
399 <td>Mixed list</td>
400 <td>
401 1. item 1<br/>
402 1*. item 2<br/>
403 1*. item 3<br/>
404 1. item 4
405 </td>
406 <td>
407 1. item 1<br/>
408 1*. item 2<br/>
409 1*. item 3<br/>
410 1. item 4
411 </td>
412 {/pre}
413 <td>
414 1. item 1
415 1*. item 2
416 1*. item 3
417 1. item 4
418 </td>
419 </tr>
420 <tr>
421 {pre}
422 <td>Square list</td>
423 <td>
424 - item 1<br/>
425 - item 2<br/>
426 </td>
427 <td>
428 (% style="list-style-type: square" %)<br/>
429 * item 1<br/>
430 * item 2<br/>
431 </td>
432 {/pre}
433 <td>
434 - item 1
435 - item 2
436 </td>
437 </tr>
438 <tr>
439 {pre}
440 <td>Disc list</td>
441 <td>
442 &lt;ul style="list-style-type: disc"&gt;<br/>
443 &nbsp;&nbsp;&lt;li&gt;item1&lt;/li&gt;<br/>
444 &nbsp;&nbsp;&lt;li&gt;item2&lt;/li&gt;<br/>
445 &lt;/ul&gt;
446 </td>
447 <td>
448 (% style="list-style-type: disc" %)<br/>
449 * item 1<br/>
450 * item 2<br/>
451 </td>
452 {/pre}
453 <td>
454 <ul style="list-style-type: disc">
455 <li>item1</li>
456 <li>item2</li>
457 </ul>
458 </td>
459 </tr>
460 <tr>
461 {pre}
462 <td>Lowercase Alphabetical list</td>
463 <td>
464 a. item 1<br/>
465 a. item 2<br/>
466 </td>
467 <td>
468 (% style="list-style-type: lower-alpha" %)<br/>
469 * item1<br/>
470 * item2<br/>
471 </td>
472 {/pre}
473 <td>
474 a. item 1
475 a. item 2
476 </td>
477 </tr>
478 <tr>
479 {pre}
480 <td>Uppercase Alphabetical list</td>
481 <td>
482 A. item 1<br/>
483 A. item 2<br/>
484 </td>
485 <td>
486 (% style="list-style-type: upper-alpha" %)<br/>
487 * item1<br/>
488 * item2<br/>
489 </td>
490 {/pre}
491 <td>
492 A. item 1
493 A. item 2
494 </td>
495 </tr>
496 <tr>
497 {pre}
498 <td>Lowercase Roman list</td>
499 <td>
500 i. item 1<br/>
501 i. item 2<br/>
502 </td>
503 <td>
504 (% style="list-style-type: lower-roman" %)<br/>
505 * item1<br/>
506 * item2<br/>
507 </td>
508 {/pre}
509 <td>
510 i. item 1
511 i. item 2
512 </td>
513 </tr>
514 <tr>
515 {pre}
516 <td>Uppercase Roman list</td>
517 <td>
518 I. item 1<br/>
519 I. item 2<br/>
520 </td>
521 <td>
522 (% style="list-style-type: upper-roman" %)<br/>
523 * item1<br/>
524 * item2<br/>
525 </td>
526 {/pre}
527 <td>
528 I. item 1
529 I. item 2
530 </td>
531 </tr>
532 <tr>
533 {pre}
534 <td>Lowercase Greek list</td>
535 <td>
536 g. item 1<br/>
537 g. item 2<br/>
538 </td>
539 <td>
540 (% style="list-style-type: lower-greek" %)<br/>
541 * item1<br/>
542 * item2<br/>
543 </td>
544 {/pre}
545 <td>
546 g. item 1
547 g. item 2
548 </td>
549 </tr>
550 <tr>
551 {pre}
552 <td>Uppercase Greek list</td>
553 <td>
554 G. item 1<br/>
555 G. item 2<br/>
556 </td>
557 <td>
558 (% style="list-style-type: upper-greek" %)<br/>
559 * item1<br/>
560 * item2<br/>
561 </td>
562 {/pre}
563 <td>
564 <ul style="list-style-type: upper-greek">
565 <li>item1</li>
566 <li>item2</li>
567 </ul>
568 </td>
569 </tr>
570 <tr>
571 {pre}
572 <td>Hiragana list</td>
573 <td>
574 h. item 1<br/>
575 h. item 2<br/>
576 </td>
577 <td>
578 (% style="list-style-type: hiragana" %)<br/>
579 * item1<br/>
580 * item2<br/>
581 </td>
582 {/pre}
583 <td>
584 h. item 1
585 h. item 2
586 </td>
587 </tr>
588 <tr>
589 {pre}
590 <td>Hiragana Iroah list</td>
591 <td>
592 H. item 1<br/>
593 H. item 2<br/>
594 </td>
595 <td>
596 (% style="list-style-type: hiragana-iroha" %)<br/>
597 * item1<br/>
598 * item2<br/>
599 </td>
600 {/pre}
601 <td>
602 H. item 1
603 H. item 2
604 </td>
605 </tr>
606 <tr>
607 {pre}
608 <td>Katakana list</td>
609 <td>
610 k. item 1<br/>
611 k. item 2<br/>
612 </td>
613 <td>
614 (% style="list-style-type: katakana" %)<br/>
615 * item1<br/>
616 * item2<br/>
617 </td>
618 {/pre}
619 <td>
620 k. item 1
621 k. item 2
622 </td>
623 </tr>
624 <tr>
625 {pre}
626 <td>Katakana Iroha list</td>
627 <td>
628 K. item 1<br/>
629 K. item 2<br/>
630 </td>
631 <td>
632 (% style="list-style-type: katakana-iroha" %)<br/>
633 * item1<br/>
634 * item2<br/>
635 </td>
636 {/pre}
637 <td>
638 K. item 1
639 K. item 2
640 </td>
641 </tr>
642 <tr>
643 {pre}
644 <td>Armenian list</td>
645 <td>
646 &lt;ul style="list-style-type: armenian"&gt;<br/>
647 &nbsp;&nbsp;&lt;li&gt;item1&lt;/li&gt;<br/>
648 &nbsp;&nbsp;&lt;li&gt;item2&lt;/li&gt;<br/>
649 &lt;/ul&gt;
650 </td>
651 <td>
652 (% style="list-style-type: armenian" %)<br/>
653 * item1<br/>
654 * item2<br/>
655 </td>
656 {/pre}
657 <td>
658 <ul style="list-style-type: armenian">
659 <li>item1</li>
660 <li>item2</li>
661 </ul>
662 </td>
663 </tr>
664 <tr>
665 {pre}
666 <td>Hebrew list</td>
667 <td>
668 j. item1<br/>
669 j. item2<br/>
670 </td>
671 <td>
672 (% style="list-style-type: hebrew" %)<br/>
673 * item1<br/>
674 * item2<br/>
675 </td>
676 {/pre}
677 <td>
678 <ul style="list-style-type: hebrew">
679 <li>item1</li>
680 <li>item2</li>
681 </ul>
682 </td>
683 </tr>
684 <tr>
685 {pre}
686 <td>Georgian list</td>
687 <td>
688 &lt;ul style="list-style-type: georgian"&gt;<br/>
689 &nbsp;&nbsp;&lt;li&gt;item1&lt;/li&gt;<br/>
690 &nbsp;&nbsp;&lt;li&gt;item2&lt;/li&gt;<br/>
691 &lt;/ul&gt;
692 </td>
693 <td>
694 (% style="list-style-type: georgian" %)<br/>
695 * item1<br/>
696 * item2<br/>
697 </td>
698 {/pre}
699 <td>
700 <ul style="list-style-type: georgian">
701 <li>item1</li>
702 <li>item2</li>
703 </ul>
704 </td>
705 </tr>
706 <tr>
707 {pre}
708 <td>CJK ideographic list</td>
709 <td>
710 &lt;ul style="list-style-type: cjk-ideographic"&gt;<br/>
711 &nbsp;&nbsp;&lt;li&gt;item1&lt;/li&gt;<br/>
712 &nbsp;&nbsp;&lt;li&gt;item2&lt;/li&gt;<br/>
713 &lt;/ul&gt;
714 </td>
715 <td>
716 (% style="list-style-type: cjk-ideographic" %)<br/>
717 * item1<br/>
718 * item2<br/>
719 </td>
720 {/pre}
721 <td>
722 <ul style="list-style-type: cjk-ideographic">
723 <li>item1</li>
724 <li>item2</li>
725 </ul>
726 </td>
727 </tr>
728 </table>
729
730 1.1 Definition Lists
731
732 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
733 <tr>
734 <th>Feature</th>
735 <th>XWiki Syntax 1.0</th>
736 <th>XWiki Syntax 2.0</th>
737 <th>Result</th>
738 </tr>
739 <tr>
740 {pre}
741 <td>Standard definition</td>
742 <td>
743 &lt;dl&gt;<br/>
744 &nbsp;&nbsp;&lt;dt&gt;term&lt;/dt&gt;<br/>
745 &nbsp;&nbsp;&lt;dd&gt;definition&lt;/dd&gt;<br/>
746 &lt;/dl&gt;
747 </td>
748 <td>
749 ; term<br/>
750 : definition
751 </td>
752 {/pre}
753 <td>
754 <dl>
755 <dt>term</dt>
756 <dd>definition</dd>
757 </dl>
758 </td>
759 </tr>
760 <tr>
761 {pre}
762 <td>Nested definitions</td>
763 <td>
764 &lt;dl&gt;<br/>
765 &nbsp;&nbsp;&lt;dt&gt;term1&lt;/dt&gt;<br/>
766 &nbsp;&nbsp;&lt;dd&gt;definition1<br/>
767 &nbsp;&nbsp;&nbsp;&nbsp;&lt;dl&gt;<br/>
768 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;dt&gt;term2&lt;/dt&gt;<br/>
769 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;dd&gt;definition2&lt;/dd&gt;<br/>
770 &nbsp;&nbsp;&nbsp;&nbsp;&lt;/dl&gt;<br/>
771 &nbsp;&nbsp;&lt;/dd&gt;<br/>
772 &lt;/dl&gt;
773 </td>
774 <td>
775 ; term1<br/>
776 : definition1<br/>
777 :; term2<br/>
778 :: definition2
779 </td>
780 {/pre}
781 <td>
782 <dl>
783 <dt>term1</dt>
784 <dd>definition1
785 <dl>
786 <dt>term2</dt>
787 <dd>definition2</dd>
788 </dl>
789 </dd>
790 </dl>
791 </td>
792 </tr>
793 <tr>
794 {pre}
795 <td>Parametrized definition</td>
796 <td>
797 &lt;dl style="color:blue"&gt;<br/>
798 &nbsp;&nbsp;&lt;dt&gt;term&lt;/dt&gt;<br/>
799 &nbsp;&nbsp;&lt;dd&gt;definition&lt;/dd&gt;<br/>
800 &lt;/dl&gt;
801 </td>
802 </td>
803 <td>
804 (% style="color:blue" %)<br/>
805 ; term<br/>
806 : definition
807 </td>
808 {/pre}
809 <td>
810 <dl style="color:blue">
811 <dt>term</dt>
812 <dd>definition</dd>
813 </dl>
814 </td>
815 </tr>
816 </table>
817
818 1.1 New Line/Line breaks
819
820 A new line is a carriage return. A line break is a forced new line that can appear anywhere in the text.
821
822 #info("In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole syntax.")
823
824 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
825 <tr>
826 <th>Feature</th>
827 <th>XWiki Syntax 1.0</th>
828 <th>XWiki Syntax 2.0</th>
829 <th>Result XWiki Syntax 1.0</th>
830 <th>Result XWiki Syntax 2.0</th>
831 </tr>
832 <tr>
833 {pre}
834 <td>Line break</td>
835 <td>Line&#92;&#92New line</td>
836 <td>Line&#92;&#92New line</td>
837 {/pre}
838 <td>Line\\New line</td>
839 <td>Line\\New line</td>
840 </tr>
841 <tr>
842
843 {pre}
844 <td>New line</td>
845 <td>Line<br/>New line</td>
846 <td>Line<br/>New line</td>
847 {/pre}
848 <td>Line New line</td>
849 <td>Line<br/>New line</td>
850 </tr>
851 </table>
852
853 1.1 Links
854
855
856
857
858 #*
859 TODO: In XWiki Syntax 2.0 it's possible to configure how links are displayed when they don't have an explicit label specified.
860 Give a link to how to configure this feature
861 *#
862
863 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
864 <tr>
865 <th>Feature</th>
866 <th>XWiki Syntax 1.0</th>
867 <th>XWiki Syntax 2.0</th>
868 <th>Result XWiki Syntax 1.0</th>
869 <th>Result XWiki Syntax 2.0</th>
870 </tr>
871 <tr>
872 {pre}
873 <td>Link to a page in the current Space</td>
874 <td>[WebHome]</td>
875 <td>[[WebHome]]</td>
876 {/pre}
877 <td>
878 <span class="wikilink"><a href="/xwiki/bin/view/Main/">Web Home</a></span>
879 </td>
880 <td>
881 <span class="wikilink"><a href="/xwiki/bin/view/Main/">WebHome</a></span>
882 </td>
883 </tr>
884 <tr>
885 {pre}
886 <td>Link with a label</td>
887 <td>[label>WebHome]</td>
888 <td>[[label>WebHome]]</td>
889 {/pre}
890 <td>
891 <span class="wikilink"><a href="/xwiki/bin/view/Main/">label</a></span>
892 </td>
893 <td>
894 <span class="wikilink"><a href="/xwiki/bin/view/Main/">label</a></span>
895 </td>
896 </tr>
897 <tr>
898 {pre}
899 <td>Link to a page with the space specified</td>
900 <td>[Main.WebHome]</td>
901 <td>[[Main.WebHome]]</td>
902 {/pre}
903 <td>
904 <span class="wikilink"><a href="/xwiki/bin/view/Main/">Web Home</a></span>
905 </td>
906 <td>
907 <span class="wikilink"><a href="/xwiki/bin/view/Main/">WebHome</a></span>
908 </td>
909 </tr>
910 <tr>
911 {pre}
912 <td>Link to a subwiki</td>
913 <td>[subwiki:Main.WebHome]</td>
914 <td>[[subwiki:Main.WebHome]]</td>
915 {/pre}
916 <td>
917 <span class="wikilink"><a href="/xwiki/bin/view/Main/">Web Home</a></span>
918 </td>
919 <td>
920 <span class="wikilink"><a href="/xwiki/bin/view/Main/">WebHome</a></span>
921 </td>
922 </tr>
923 <tr>
924 {pre}
925 <td>Link that opens in a new page</td>
926 <td>[WebHome>_blank]</td>
927 <td>[[WebHome>target="_blank"]]</td>
928 {/pre}
929 <td>
930 <span class="wikilink"><a href="/xwiki/bin/view/Main/" rel="__blank">Web Home</a></span>
931 </td>
932 <td>
933 <span class="wikilink"><a href="/xwiki/bin/view/Main/" rel="__blank">WebHome</a></span>
934 </td>
935 </tr>
936 <tr>
937 {pre}
938 <td>Link to a URL directly in the text</td>
939 <td>This is a URL: http://xwiki.org</td>
940 <td>This is a URL: http://xwiki.org</td>
941 {/pre}
942 <td>
943 This is a URL: <span class="wikiexternallink"><a href="http://www.xwiki.org">&#104;ttp://www.xwiki.org</a></span>
944 </td>
945 <td>
946 This is a URL: <span class="wikiexternallink"><a href="http://www.xwiki.org">&#104;ttp://www.xwiki.org</a></span>
947 </td>
948 </tr>
949 <tr>
950 {pre}
951 <td>Link to a URL</td>
952 <td>[http://xwiki.org]</td>
953 <td>[[http://xwiki.org]]</td>
954 {/pre}
955 <td>
956 <span class="wikiexternallink"><a href="http://www.xwiki.org">&#104;ttp://www.xwiki.org</a></span>
957 </td>
958 <td>
959 <span class="wikiexternallink"><a href="http://www.xwiki.org">&#104;ttp://www.xwiki.org</a></span>
960 </td>
961 </tr>
962 <tr>
963 {pre}
964 <td>Link to a URL with a label</td>
965 <td>[XWiki>http://xwiki.org]</td>
966 <td>[[XWiki>http://xwiki.org]]</td>
967 {/pre}
968 <td>
969 <span class="wikiexternallink"><a href="http://www.xwiki.org">XWiki</a></span>
970 </td>
971 <td>
972 <span class="wikiexternallink"><a href="http://www.xwiki.org">XWiki</a></span>
973 </td>
974 </tr>
975 <tr>
976 {pre}
977 <td>Link to an email</td>
978 <td>[email>mailto:john@smith.net]</td>
979 <td>[[email>mailto:john@smith.net]]</td>
980 {/pre}
981 <td>
982 <span class="wikiexternallink"><a href="mailto:john&@smith.com">email</a></span>
983 </td>
984 <td>
985 <span class="wikiexternallink"><a href="mailto:john&@smith.com">email</a></span>
986 </td>
987 </tr>
988 <tr>
989 {pre}
990 <td>Image Link with image attached in the current page</td>
991 <td>&lt;a href="\$xwiki.getURL("Main.WebHome")"&gt;{image:img.png}&lt;/a&gt;</td>
992 <td>
993 #warning("Not implemented yet")
994 [[Main.WebHome>image=img.png]]
995 </td>
996 {/pre}
997 <td>
998 <a href="/xwiki/bin/view/Main/">{image:img.png}</a>
999 </td>
1000 <td>
1001 <a href="/xwiki/bin/view/Main/">{image:img.png}</a>
1002 </td>
1003 </tr>
1004 </table>
1005
1006 1.1.1 XWiki Syntax 1.0 Link Specification
1007
1008 The full format of a link is {code}(alias[|&gt;])+(link)(@interWikiAlias)+([|&gt;]target)+{code}
1009 * <tt>alias</tt>: An optional string which will be displayed to the user as the link name when rendered. Example: "My Page".
1010 * <tt>link</tt>: The full link reference using the following syntax: {code}(virtualWikiAlias:)+(space.)+(reference)(?queryString)+(#anchor)+{code}
1011 * Note that either the <tt>link</tt> or the <tt>alias</tt> must be specified.
1012 ** <tt>virtualWikiAlias</tt>: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: "mywiki".
1013 ** <tt>space</tt>: An optional Wiki Space name. If not space is specified the current space is used. Example: "Main".
1014 ** <tt>reference</tt>: The link reference. This can be either a URI in the form <tt>protocol:path</tt> (example: "http://xwiki.org", "mailto:john@smith.com") or a wiki page name (example: "WebHome").
1015 ** <tt>queryString</tt>: An optional query string for specifying parameters that will be used in the rendered URL. Example: "mydata1=5&mydata2=Hello".
1016 ** <tt>anchor</tt>: 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".
1017 * <tt>interWikiAlias</tt>: 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"
1018 * <tt>target</tt>: An optional string corresponding to the HTML <tt>target</tt> attribute for a HTML <tt>a</tt> link element. This element is used when rendering the link. It defaults to opening the link in the current page. Examples: "_self", "_blank"
1019
1020 1.1.1 XWiki Syntax 2.0 Link Specification
1021
1022 The full format of a link is {code}(alias[|&gt;])+(link)([|&gt;]parameters)*{code}
1023 * <tt>alias</tt> and <tt>link</tt> are the same in XWiki Syntax 1.0
1024 * <tt>parameters</tt>: An optional list of parameters passed to the link. For example the <tt>target</tt> element from XWiki Syntax 1.0 can be passed as a parameter.
1025
1026 #warning("This is not final yet. For example we need to add parameter support for passing an image to create a link to an image.")
1027
1028 1.1 Tables
1029
1030 Allows to easily create content in table format. It also support parameters for table, row or cell in XWiki Syntax 2.0.
1031
1032 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
1033 <tr>
1034 <th>Feature</th>
1035 <th>XWiki Syntax 1.0</th>
1036 <th>XWiki Syntax 2.0</th>
1037 <th>Result XWiki Syntax 1.0</th>
1038 <th>Result XWiki Syntax 2.0</th>
1039 </tr>
1040 <tr>
1041 {pre}
1042 <td>Standard table</td>
1043 <td>
1044 {table}<br/>
1045 Title 1 | Title 2<br/>
1046 Word 1 | Word 2<br/>
1047 {table}
1048 </td>
1049 <td>
1050 ||Title 1||Title 2<br/>
1051 |Word 1|Word 2<br/>
1052 </td>
1053 {/pre}
1054 <td>
1055 <table class="wiki-table" border="0" cellpadding="0" cellspacing="0"><tbody><tr><th>Title 1</th><th>Title 2</th></tr><tr class="table-odd"><td>Word 1</td><td>Word 2</td></tr></tbody></table>
1056 </td>
1057 <td>
1058 <table><tbody><tr><th>Title 1</th><th>Title 2</th></tr><tr><td>Word 1</td><td>Word 2</td></tr></tbody></table>
1059 </td>
1060 </tr>
1061 <tr>
1062 {pre}
1063 <td>Parametrized table</td>
1064 <td>
1065 &lt;table&nbsp;style=&quot;background-color:red;align:center&quot;&gt;<br/>
1066 &nbsp;&nbsp;&lt;tbody&gt;<br/>
1067 &nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>
1068 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&gt;Title&nbsp;1&lt;/th&gt;<br/>
1069 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th&nbsp;style=&quot;background-color:yellow&quot;&gt;Title&nbsp;2&lt;/th&gt;<br/>
1070 &nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>
1071 &nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br/>
1072 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;Word&nbsp;1&lt;/td&gt;<br/>
1073 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;Word&nbsp;2&lt;/td&gt;<br/>
1074 &nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br/>
1075 &nbsp;&nbsp;&lt;/tbody&gt;<br/>
1076 &lt;/table&gt;
1077 </td>
1078 <td>
1079 (% style="background-color:red;align=center" %)<br/>
1080 ||Title 1||(% style="background-color:yellow" %)Title 2<br/>
1081 |Word 1|Word 2<br/>
1082 </td>
1083 {/pre}
1084 <td>
1085 <table style="background-color:red;align:center"><tbody><tr><th>Title 1</th><th style="background-color:yellow">Title 2</th></tr><tr><td>Word 1</td><td>Word 2</td></tr></tbody></table>
1086 </td>
1087 <td>
1088 <table style="background-color:red;align:center"><tbody><tr><th>Title 1</th><th style="background-color:yellow">Title 2</th></tr><tr><td>Word 1</td><td>Word 2</td></tr></tbody></table>
1089 </td>
1090 </tr>
1091 </table>
1092
1093 1.1 Images
1094
1095 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
1096 <tr>
1097 <th>Feature</th>
1098 <th>XWiki Syntax 1.0</th>
1099 <th>XWiki Syntax 2.0</th>
1100 <th>Result</th>
1101 </tr>
1102 <tr>
1103 <td>Display image from attachment</td>
1104 <td>
1105 #info("See [Image Macro>code:Macros.ImageMacro] for details")
1106 {pre}
1107 {image:img.png}
1108 </td>
1109 <td>
1110 #warning("Not implemented yet")
1111 image:img.png
1112 </td>
1113 {/pre}
1114 <td>
1115 {image:img.png}
1116 </td>
1117 </tr>
1118 </table>
1119
1120 1.1 Verbatim
1121
1122 Allow to enter content that will not be formatted (in other words the wiki syntax will not be taken into account).
1123
1124 #info("In XWiki Syntax 1.0 the [Pre macro>code:Macros.PreMacro] only preserves wiki syntax and Radeox macros. However HTML snippets and Groovy/Velocity scripts are still executed.")
1125
1126 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
1127 <tr>
1128 <th>Feature</th>
1129 <th>XWiki Syntax 1.0</th>
1130 <th>XWiki Syntax 2.0</th>
1131 <th>Result XWiki Syntax 1.0</th>
1132 <th>Result XWiki Syntax 2.0</th>
1133 </tr>
1134 <tr>
1135 <td>Verbatim inline</td>
1136 <td>
1137 Some verbatim \{pre\}\*\[not rendered\]\*\{/pre\} content
1138 </td>
1139 {pre}
1140 <td>
1141 Some verbatim {{{**[[not rendered]]**}}} content
1142 </td>
1143 {/pre}
1144 <td>
1145 Some verbatim \*\[not rendered\]\* content
1146 </td>
1147 <td>
1148 Some verbatim \*\*\[\[not rendered\]\]\*\* content
1149 </td>
1150 </tr>
1151 <tr>
1152 <td>Verbatim block</td>
1153 <td>
1154 \{pre\}
1155 multi line<br/>
1156 \*verbatim\*<br/>
1157 content<br/>
1158 \{/pre\}
1159 #info("It's also possible to use the [Code macro>code:Macros.CodeMacro] but it displays its content in a box by default.")
1160 </td>
1161 <td>
1162 {{{<br/>
1163 multi line<br/>
1164 \*\*verbatim\*\*<br/>
1165 content<br/>
1166 }}}
1167 </td>
1168 <td>
1169 multi line<br/>
1170 \*verbatim\*<br/>
1171 content
1172 </td>
1173 <td>
1174 multi line<br/>
1175 \*\*verbatim\*\*<br/>
1176 content
1177 </td>
1178 </tr>
1179 </table>
1180
1181 1.1 Quotations
1182
1183 Allows to quote some text.
1184
1185 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
1186 <tr>
1187 <th>Feature</th>
1188 <th>XWiki Syntax 1.0</th>
1189 <th>XWiki Syntax 2.0</th>
1190 <th>Result</th>
1191 </tr>
1192 <tr>
1193 {pre}
1194 <td>Simple quote</td>
1195 <td>
1196 &lt;blockquote&gt;john said this&lt;/blockquote&gt;<br/>
1197 I said ok
1198 </td>
1199 <td>
1200 > john said this<br/>
1201 I said ok
1202 </td>
1203 {/pre}
1204 <td>
1205 <blockquote>john said this</blockquote>
1206 I said ok
1207 </td>
1208 </tr>
1209 <tr>
1210 {pre}
1211 <td>Nested quotes</td>
1212 <td>
1213 &lt;blockquote&gt;john said this<br/>
1214 &nbsp;&nbsp;&lt;blockquote&gt;marie answered that&lt;/blockquote&gt;<br/>
1215 &lt;/blockquote&gt;
1216 </td>
1217 <td>
1218 > john said this<br/>
1219 >> marie answered that<br/>
1220 I said ok
1221 </td>
1222 {/pre}
1223 <td>
1224 <blockquote>john said this<blockquote>marie answered that</blockquote></blockquote>
1225 I said ok
1226 </td>
1227 </tr>
1228 </table>
1229
1230 1.1 Escapes
1231
1232 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
1233 <tr>
1234 <th>Feature</th>
1235 <th>XWiki Syntax 1.0</th>
1236 <th>XWiki Syntax 2.0</th>
1237 <th>Result XWiki Syntax 1.0</th>
1238 <th>Result XWiki Syntax 2.0</th>
1239 </tr>
1240 <tr>
1241 {pre}
1242 <td>Escape a character</td>
1243 <td>This is not a \[link\]</td>
1244 <td>
1245 This is not a ~[~[link~]~]
1246 #info("To enter a ~ character use a double escape: ~~")
1247 </td>
1248 {/pre}
1249 <td>This is not a \[link\]</td>
1250 <td>This is not a \[\[link\]\]</td>
1251 </tr>
1252 </table>
1253
1254 1.1 Macros
1255
1256 There are 2 kinds of macros in XWiki syntax 1.0:
1257 * Velocity macros (called using the <tt>\#macroname(param1 ... paramN)</tt> syntax)
1258 * Radeox macros (called using the <tt>\{macroname:param1=value1|...|paramN=valueN\}</tt> syntax)
1259
1260 There are also 2 kinds of macros in XWiki Syntax 2.0:
1261 * Velocity macros (called using the <tt>\#macroname(param1 ... paramN)</tt> syntax)
1262 * XWiki macros (called using the <tt>\{\{macroname param1="value1" ... paramN="valueN"\}\}</tt> syntax)
1263
1264 #info("The Radeox macros cannot be used in XWiki Syntax 2.0. Thus they have been rewritten as XWiki macros.")
1265
1266 #info("For the full list of available macros check the [Macro Reference page>code:Macros.WebHome].")
1267
1268 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
1269 <tr>
1270 <th>Feature</th>
1271 <th>XWiki Syntax 1.0</th>
1272 <th>XWiki Syntax 2.0</th>
1273 <th>Result</th>
1274 </tr>
1275 <tr>
1276 <td>Velocity Macro</td>
1277 <td>
1278 \#info("Some info text")
1279 </td>
1280 <td>
1281 \{\{velocity\}\}
1282 \#info("Some info text")
1283 \{\{/velocity\}\}
1284 </td>
1285 <td>#info("Some info text")</td>
1286 </tr>
1287 <tr>
1288 <td>Radeox Macro/XWiki Macros</td>
1289 <td>
1290 \{code:java\}
1291 content
1292 \{code\}
1293 </td>
1294 <td>
1295 \{\{velocity context="new"\}\}
1296 content
1297 \{\{/velocity\}\}
1298 </td>
1299 <td>N/A (depends on the macro)</td>
1300 </tr>
1301 </table>
1302
1303 1.1 HTML
1304
1305 #info("In XWiki Syntax 2.0 HTML must be entered by using either the HTML or XHTML macros whereas in XWiki Syntax 1.0 it's possible to enter HTML directly in the text")
1306
1307 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
1308 <tr>
1309 <th>XWiki Syntax 1.0</th>
1310 <th>XWiki Syntax 2.0</th>
1311 <th>Result</th>
1312 </tr>
1313 <tr>
1314 {pre}
1315 <td>&lt;b&gt;bold&lt;/b&gt;</td>
1316 <td>
1317 {{html}}<br/>
1318 &lt;b&gt;bold&lt;/b&gt;<br/>
1319 {{/html}}
1320 #info("The {{xhtml}} macro can also be used provided you enter valid XHTML.")
1321 </td>
1322 {/pre}
1323 <td><b>bold</b></td>
1324 </tr>
1325 </table>
1326
1327 1.1 Velocity/Groovy Scripts
1328
1329 #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 <tt>velocity</tt> macro. Same goes for entering Groovy scripts.")
1330
1331 <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%">
1332 <tr>
1333 <th>Feature</th>
1334 <th>XWiki Syntax 1.0</th>
1335 <th>XWiki Syntax 2.0</th>
1336 </tr>
1337 <tr>
1338 <td>Velocity script</td>
1339 <td>\#set (\$var = "whatever")</td>
1340 <td>
1341 \{\{velocity\}\}<br/>
1342 \#set (\$var = "whatever")<br/>
1343 \{\{/velocity\}\}
1344 </td>
1345 </tr>
1346 <tr>
1347 <td>Groovy script</td>
1348 <td>
1349 \<\%<br/>
1350 def var = "whatever"<br/>
1351 \%\>
1352 </td>
1353 <td>
1354 #warning("Not implemented yet")
1355 \{\{groovy\}\}<br/>
1356 def var = "whatever"<br/>
1357 \{\{/groovy\}\}
1358 </td>
1359 </tr>
1360 </table>
1361
1362 1.1 Other syntaxes
1363
1364 The following other syntaxes are implemented in XWiki Enterprise 1.6 and above:
1365 * [JSPWiki>http://www.jspwiki.org/wiki/TextFormattingRules]
1366 * [MediaWiki>http://en.wikipedia.org/wiki/Help:Editing]
1367 * [Confluence>http://confluence.atlassian.com/display/CONF20/Confluence+Notation+Guide+Overview]
1368 * [TWiki>http://twiki.org/cgi-bin/view/TWiki/WikiSyntax]
1369 * [Creole 1.0>http://www.wikicreole.org/wiki/Creole1.0]
1370 * [XHTML 1.0>http://www.w3.org/TR/xhtml1/]
1371
1372 #warning("The implementation for these syntaxes is not fully finished yet. For example support for links is not working 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. This is planned for XWiki Enterprise 1.7 and 1.8.")

Get Connected