Wiki source code of XWikiSyntax
Version 45.2 by Vincent Massol on 2009/07/03
Show last authors
author | version | line-number | content |
---|---|---|---|
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.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: | ||
20 | * Fix the limitations 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 | <new line at beginning of document><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 | |||
136 | |||
137 | |||
138 | |||
139 | |||
140 | |||
141 | |||
142 | |||
143 | |||
144 | |||
145 | |||
146 | |||
147 | |||
148 | |||
149 | |||
150 | |||
151 | |||
152 | |||
153 | |||
154 | |||
155 | |||
156 | |||
157 | |||
158 | |||
159 | |||
160 | Paragraph two | ||
161 | </td> | ||
162 | <td> | ||
163 | Paragraph one | ||
164 | |||
165 | Paragraph two | ||
166 | </td> | ||
167 | </tr> | ||
168 | <tr> | ||
169 | {pre} | ||
170 | <td>Parametrized paragraph</td> | ||
171 | <td> | ||
172 | <p style="text-align:center;color:blue">Centered and blue paragraph</> | ||
173 | </td> | ||
174 | <td> | ||
175 | (% style="text-align:center;color:blue" %)<br/> | ||
176 | Centered and blue paragraph | ||
177 | {/pre} | ||
178 | <td> | ||
179 | <p style="text-align:center;color:blue">Centered and blue paragraph</p> | ||
180 | </td> | ||
181 | <td> | ||
182 | <p style="text-align:center;color:blue">Centered and blue paragraph</p> | ||
183 | </td> | ||
184 | </tr> | ||
185 | </table> | ||
186 | |||
187 | 1.1 Headers | ||
188 | |||
189 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
190 | <tr> | ||
191 | <th>Feature</th> | ||
192 | <th>XWiki Syntax 1.0</th> | ||
193 | <th>XWiki Syntax 2.0</th> | ||
194 | <th>Result</th> | ||
195 | </tr> | ||
196 | <tr> | ||
197 | {pre} | ||
198 | <td>Standard headers</td> | ||
199 | <td> | ||
200 | #set ($h1 = "1") | ||
201 | #set ($h2 = "1.1") | ||
202 | #set ($h3 = "1.1.1") | ||
203 | #set ($h4 = "1.1.1.1") | ||
204 | #set ($h5 = "1.1.1.1.1") | ||
205 | #set ($h6 = "1.1.1.1.1.1") | ||
206 | $h1 level 1<br/> | ||
207 | $h2 level 2<br/> | ||
208 | $h3 level 3<br/> | ||
209 | $h4 level 4<br/> | ||
210 | $h5 level 5<br/> | ||
211 | $h6 level 6 | ||
212 | </td> | ||
213 | <td> | ||
214 | = level 1<br/> | ||
215 | == level 2<br/> | ||
216 | === level 3<br/> | ||
217 | ==== level 4<br/> | ||
218 | ===== level 5<br/> | ||
219 | ====== level 6 | ||
220 | #info("Closing equal signs are optional.") | ||
221 | </td> | ||
222 | {/pre} | ||
223 | <td> | ||
224 | $h1 level 1 | ||
225 | $h2 level 2 | ||
226 | $h3 level 3 | ||
227 | $h4 level 4 | ||
228 | $h5 level 5 | ||
229 | $h6 level 6 | ||
230 | </td> | ||
231 | </tr> | ||
232 | <tr> | ||
233 | {pre} | ||
234 | <td>Parametrized headers</td> | ||
235 | <td> | ||
236 | <h2 class="heading-1"><span style="color:blue">header</span></h2> | ||
237 | </td> | ||
238 | <td> | ||
239 | (% style="color:blue" %)<br/> | ||
240 | = header | ||
241 | </td> | ||
242 | {/pre} | ||
243 | <td> | ||
244 | <h2 class="heading-1" id="Hlevel1"><span style="color:blue">header</span></h2> | ||
245 | </td> | ||
246 | </tr> | ||
247 | <tr> | ||
248 | {pre} | ||
249 | <td>Headers with wiki syntax</td> | ||
250 | <td>$h3 Header with *bold*</td> | ||
251 | <td>=== Header with **bold**</td> | ||
252 | {/pre} | ||
253 | <td> | ||
254 | $h3 Header with *bold* | ||
255 | </td> | ||
256 | </tr> | ||
257 | </table> | ||
258 | |||
259 | 1.1 Text Formatting | ||
260 | |||
261 | #info("New in XWiki Syntax 2.0 over XWiki Syntax 1.0: | ||
262 | * Spaces are allowed just after the syntax symbols (for example in XWiki Syntax 1.0, this was not * bold *). | ||
263 | * 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. | ||
264 | * Ability to span several lines (wasn't the case in XWiki Syntax 1.0).") | ||
265 | |||
266 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
267 | <tr> | ||
268 | <th>Feature</th> | ||
269 | <th>XWiki Syntax 1.0</th> | ||
270 | <th>XWiki Syntax 2.0</th> | ||
271 | <th>Result</th> | ||
272 | </tr> | ||
273 | <tr> | ||
274 | {pre} | ||
275 | <td>Bold</td> | ||
276 | <td>*bold*</td> | ||
277 | <td>**bold**</td> | ||
278 | {/pre} | ||
279 | <td>*bold*</td> | ||
280 | </tr> | ||
281 | <tr> | ||
282 | {pre} | ||
283 | <td>Underline</td> | ||
284 | <td>__underline___</td> | ||
285 | <td>__underline__</td> | ||
286 | {/pre} | ||
287 | <td>__underline__</td> | ||
288 | </tr> | ||
289 | <tr> | ||
290 | {pre} | ||
291 | <td>Italics</td> | ||
292 | <td>~~italic~~</td> | ||
293 | <td>//italic//</td> | ||
294 | {/pre} | ||
295 | <td>~~italic~~</td> | ||
296 | </tr> | ||
297 | <tr> | ||
298 | {pre} | ||
299 | <td>Striked out</td> | ||
300 | <td>--strike--</td> | ||
301 | <td>--strike--</td> | ||
302 | {/pre} | ||
303 | <td>--strike--</td> | ||
304 | </tr> | ||
305 | <tr> | ||
306 | {pre} | ||
307 | <td>Monospace</td> | ||
308 | <td><tt>monospace</tt></td> | ||
309 | #set($dash = "#") | ||
310 | <td>${dash}${dash}monospace${dash}${dash}</td> | ||
311 | {/pre} | ||
312 | <td><tt>monospace</tt></td> | ||
313 | </tr> | ||
314 | <tr> | ||
315 | {pre} | ||
316 | <td>Superscript</td> | ||
317 | <td>some <sup>superscript</sup></td> | ||
318 | <td>some ^^superscript^^</td> | ||
319 | {/pre} | ||
320 | <td>some <sup>superscript</sup></td> | ||
321 | </tr> | ||
322 | <tr> | ||
323 | {pre} | ||
324 | <td>Subscript</td> | ||
325 | <td>some <sub>subscript</sub></td> | ||
326 | <td>some ,,subscript,,</td> | ||
327 | {/pre} | ||
328 | <td>some <sub>subscript</sub></td> | ||
329 | </tr> | ||
330 | </table> | ||
331 | |||
332 | 1.1 Horizontal Line | ||
333 | |||
334 | #info("There must be 4 or more dashes.") | ||
335 | #info("Note that this is different from Creole where exactly 4 dashes are required.") | ||
336 | |||
337 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
338 | <tr> | ||
339 | <th>Feature</th> | ||
340 | <th>XWiki Syntax 1.0</th> | ||
341 | <th>XWiki Syntax 2.0</th> | ||
342 | <th>Result</th> | ||
343 | </tr> | ||
344 | <tr> | ||
345 | {pre} | ||
346 | <td>Simple Horizontal Line</td> | ||
347 | <td>----</td> | ||
348 | <td>----</td> | ||
349 | {/pre} | ||
350 | <td><hr/></td> | ||
351 | </tr> | ||
352 | <tr> | ||
353 | {pre} | ||
354 | <td>Parametrized Horizontal Line</td> | ||
355 | <td> | ||
356 | <hr style="color:blue"/> | ||
357 | </td> | ||
358 | <td> | ||
359 | (% style="color:blue" %)<br/> | ||
360 | ---- | ||
361 | </td> | ||
362 | {/pre} | ||
363 | <td><hr style="color:blue"/></td> | ||
364 | </tr> | ||
365 | </table> | ||
366 | |||
367 | 1.1 Lists | ||
368 | |||
369 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
370 | <tr> | ||
371 | <th>Feature</th> | ||
372 | <th>XWiki Syntax 1.0</th> | ||
373 | <th>XWiki Syntax 2.0</th> | ||
374 | <th>Result</th> | ||
375 | </tr> | ||
376 | <tr> | ||
377 | {pre} | ||
378 | <td>Bulleted list</td> | ||
379 | <td> | ||
380 | * item 1<br/> | ||
381 | ** item 2<br/> | ||
382 | *** item 3<br/> | ||
383 | * item 4 | ||
384 | </td> | ||
385 | <td> | ||
386 | * item 1<br/> | ||
387 | ** item 2<br/> | ||
388 | *** item 3<br/> | ||
389 | * item 4 | ||
390 | </td> | ||
391 | {/pre} | ||
392 | <td> | ||
393 | * item 1 | ||
394 | ** item 2 | ||
395 | *** item 3 | ||
396 | * item 4 | ||
397 | </td> | ||
398 | </tr> | ||
399 | <tr> | ||
400 | {pre} | ||
401 | <td>Numbered list</td> | ||
402 | <td> | ||
403 | 1. item 1<br/> | ||
404 | 11. item 2<br/> | ||
405 | 111. item 3<br/> | ||
406 | 1. item 4 | ||
407 | </td> | ||
408 | <td> | ||
409 | 1. item 1<br/> | ||
410 | 11. item 2<br/> | ||
411 | 111. item 3<br/> | ||
412 | 1. item 4 | ||
413 | </td> | ||
414 | {/pre} | ||
415 | <td> | ||
416 | 1. item 1 | ||
417 | 11. item 2 | ||
418 | 111. item 3 | ||
419 | 1. item 4 | ||
420 | </td> | ||
421 | </tr> | ||
422 | <tr> | ||
423 | {pre} | ||
424 | <td>Mixed list</td> | ||
425 | <td> | ||
426 | 1. item 1<br/> | ||
427 | 1*. item 2<br/> | ||
428 | 1*. item 3<br/> | ||
429 | 1. item 4 | ||
430 | </td> | ||
431 | <td> | ||
432 | 1. item 1<br/> | ||
433 | 1*. item 2<br/> | ||
434 | 1*. item 3<br/> | ||
435 | 1. item 4 | ||
436 | </td> | ||
437 | {/pre} | ||
438 | <td> | ||
439 | 1. item 1 | ||
440 | 1*. item 2 | ||
441 | 1*. item 3 | ||
442 | 1. item 4 | ||
443 | </td> | ||
444 | </tr> | ||
445 | <tr> | ||
446 | {pre} | ||
447 | <td>Square list</td> | ||
448 | <td> | ||
449 | - item 1<br/> | ||
450 | - item 2<br/> | ||
451 | </td> | ||
452 | <td> | ||
453 | (% style="list-style-type: square" %)<br/> | ||
454 | * item 1<br/> | ||
455 | * item 2<br/> | ||
456 | </td> | ||
457 | {/pre} | ||
458 | <td> | ||
459 | - item 1 | ||
460 | - item 2 | ||
461 | </td> | ||
462 | </tr> | ||
463 | <tr> | ||
464 | {pre} | ||
465 | <td>Disc list</td> | ||
466 | <td> | ||
467 | <ul style="list-style-type: disc"><br/> | ||
468 | <li>item1</li><br/> | ||
469 | <li>item2</li><br/> | ||
470 | </ul> | ||
471 | </td> | ||
472 | <td> | ||
473 | (% style="list-style-type: disc" %)<br/> | ||
474 | * item 1<br/> | ||
475 | * item 2<br/> | ||
476 | </td> | ||
477 | {/pre} | ||
478 | <td> | ||
479 | <ul style="list-style-type: disc"> | ||
480 | <li>item1</li> | ||
481 | <li>item2</li> | ||
482 | </ul> | ||
483 | </td> | ||
484 | </tr> | ||
485 | <tr> | ||
486 | {pre} | ||
487 | <td>Lowercase Alphabetical list</td> | ||
488 | <td> | ||
489 | a. item 1<br/> | ||
490 | a. item 2<br/> | ||
491 | </td> | ||
492 | <td> | ||
493 | (% style="list-style-type: lower-alpha" %)<br/> | ||
494 | * item1<br/> | ||
495 | * item2<br/> | ||
496 | </td> | ||
497 | {/pre} | ||
498 | <td> | ||
499 | a. item 1 | ||
500 | a. item 2 | ||
501 | </td> | ||
502 | </tr> | ||
503 | <tr> | ||
504 | {pre} | ||
505 | <td>Uppercase Alphabetical list</td> | ||
506 | <td> | ||
507 | A. item 1<br/> | ||
508 | A. item 2<br/> | ||
509 | </td> | ||
510 | <td> | ||
511 | (% style="list-style-type: upper-alpha" %)<br/> | ||
512 | * item1<br/> | ||
513 | * item2<br/> | ||
514 | </td> | ||
515 | {/pre} | ||
516 | <td> | ||
517 | A. item 1 | ||
518 | A. item 2 | ||
519 | </td> | ||
520 | </tr> | ||
521 | <tr> | ||
522 | {pre} | ||
523 | <td>Lowercase Roman list</td> | ||
524 | <td> | ||
525 | i. item 1<br/> | ||
526 | i. item 2<br/> | ||
527 | </td> | ||
528 | <td> | ||
529 | (% style="list-style-type: lower-roman" %)<br/> | ||
530 | * item1<br/> | ||
531 | * item2<br/> | ||
532 | </td> | ||
533 | {/pre} | ||
534 | <td> | ||
535 | i. item 1 | ||
536 | i. item 2 | ||
537 | </td> | ||
538 | </tr> | ||
539 | <tr> | ||
540 | {pre} | ||
541 | <td>Uppercase Roman list</td> | ||
542 | <td> | ||
543 | I. item 1<br/> | ||
544 | I. item 2<br/> | ||
545 | </td> | ||
546 | <td> | ||
547 | (% style="list-style-type: upper-roman" %)<br/> | ||
548 | * item1<br/> | ||
549 | * item2<br/> | ||
550 | </td> | ||
551 | {/pre} | ||
552 | <td> | ||
553 | I. item 1 | ||
554 | I. item 2 | ||
555 | </td> | ||
556 | </tr> | ||
557 | <tr> | ||
558 | {pre} | ||
559 | <td>Lowercase Greek list</td> | ||
560 | <td> | ||
561 | g. item 1<br/> | ||
562 | g. item 2<br/> | ||
563 | </td> | ||
564 | <td> | ||
565 | (% style="list-style-type: lower-greek" %)<br/> | ||
566 | * item1<br/> | ||
567 | * item2<br/> | ||
568 | </td> | ||
569 | {/pre} | ||
570 | <td> | ||
571 | g. item 1 | ||
572 | g. item 2 | ||
573 | </td> | ||
574 | </tr> | ||
575 | <tr> | ||
576 | {pre} | ||
577 | <td>Uppercase Greek list</td> | ||
578 | <td> | ||
579 | G. item 1<br/> | ||
580 | G. item 2<br/> | ||
581 | </td> | ||
582 | <td> | ||
583 | (% style="list-style-type: upper-greek" %)<br/> | ||
584 | * item1<br/> | ||
585 | * item2<br/> | ||
586 | </td> | ||
587 | {/pre} | ||
588 | <td> | ||
589 | <ul style="list-style-type: upper-greek"> | ||
590 | <li>item1</li> | ||
591 | <li>item2</li> | ||
592 | </ul> | ||
593 | </td> | ||
594 | </tr> | ||
595 | <tr> | ||
596 | {pre} | ||
597 | <td>Hiragana list</td> | ||
598 | <td> | ||
599 | h. item 1<br/> | ||
600 | h. item 2<br/> | ||
601 | </td> | ||
602 | <td> | ||
603 | (% style="list-style-type: hiragana" %)<br/> | ||
604 | * item1<br/> | ||
605 | * item2<br/> | ||
606 | </td> | ||
607 | {/pre} | ||
608 | <td> | ||
609 | h. item 1 | ||
610 | h. item 2 | ||
611 | </td> | ||
612 | </tr> | ||
613 | <tr> | ||
614 | {pre} | ||
615 | <td>Hiragana Iroah list</td> | ||
616 | <td> | ||
617 | H. item 1<br/> | ||
618 | H. item 2<br/> | ||
619 | </td> | ||
620 | <td> | ||
621 | (% style="list-style-type: hiragana-iroha" %)<br/> | ||
622 | * item1<br/> | ||
623 | * item2<br/> | ||
624 | </td> | ||
625 | {/pre} | ||
626 | <td> | ||
627 | H. item 1 | ||
628 | H. item 2 | ||
629 | </td> | ||
630 | </tr> | ||
631 | <tr> | ||
632 | {pre} | ||
633 | <td>Katakana list</td> | ||
634 | <td> | ||
635 | k. item 1<br/> | ||
636 | k. item 2<br/> | ||
637 | </td> | ||
638 | |||
639 | <td> | ||
640 | |||
641 | |||
642 | |||
643 | (% style="list-style-type: katakana" %)<br/> | ||
644 | * item1<br/> | ||
645 | * item2<br/> | ||
646 | </td> | ||
647 | {/pre} | ||
648 | <td> | ||
649 | k. item 1 | ||
650 | k. item 2 | ||
651 | </td> | ||
652 | </tr> | ||
653 | <tr> | ||
654 | {pre} | ||
655 | <td>Katakana Iroha list</td> | ||
656 | <td> | ||
657 | K. item 1<br/> | ||
658 | K. item 2<br/> | ||
659 | </td> | ||
660 | <td> | ||
661 | (% style="list-style-type: katakana-iroha" %)<br/> | ||
662 | * item1<br/> | ||
663 | * item2<br/> | ||
664 | </td> | ||
665 | {/pre} | ||
666 | <td> | ||
667 | K. item 1 | ||
668 | K. item 2 | ||
669 | </td> | ||
670 | </tr> | ||
671 | <tr> | ||
672 | {pre} | ||
673 | <td>Armenian list</td> | ||
674 | <td> | ||
675 | <ul style="list-style-type: armenian"><br/> | ||
676 | <li>item1</li><br/> | ||
677 | <li>item2</li><br/> | ||
678 | </ul> | ||
679 | </td> | ||
680 | <td> | ||
681 | (% style="list-style-type: armenian" %)<br/> | ||
682 | * item1<br/> | ||
683 | * item2<br/> | ||
684 | </td> | ||
685 | {/pre} | ||
686 | <td> | ||
687 | <ul style="list-style-type: armenian"> | ||
688 | <li>item1</li> | ||
689 | <li>item2</li> | ||
690 | </ul> | ||
691 | </td> | ||
692 | </tr> | ||
693 | <tr> | ||
694 | {pre} | ||
695 | <td>Hebrew list</td> | ||
696 | <td> | ||
697 | j. item1<br/> | ||
698 | j. item2<br/> | ||
699 | </td> | ||
700 | <td> | ||
701 | (% style="list-style-type: hebrew" %)<br/> | ||
702 | * item1<br/> | ||
703 | * item2<br/> | ||
704 | </td> | ||
705 | {/pre} | ||
706 | <td> | ||
707 | <ul style="list-style-type: hebrew"> | ||
708 | <li>item1</li> | ||
709 | <li>item2</li> | ||
710 | </ul> | ||
711 | </td> | ||
712 | </tr> | ||
713 | <tr> | ||
714 | {pre} | ||
715 | <td>Georgian list</td> | ||
716 | <td> | ||
717 | <ul style="list-style-type: georgian"><br/> | ||
718 | <li>item1</li><br/> | ||
719 | <li>item2</li><br/> | ||
720 | </ul> | ||
721 | </td> | ||
722 | <td> | ||
723 | (% style="list-style-type: georgian" %)<br/> | ||
724 | * item1<br/> | ||
725 | * item2<br/> | ||
726 | </td> | ||
727 | {/pre} | ||
728 | <td> | ||
729 | <ul style="list-style-type: georgian"> | ||
730 | <li>item1</li> | ||
731 | <li>item2</li> | ||
732 | </ul> | ||
733 | </td> | ||
734 | </tr> | ||
735 | <tr> | ||
736 | {pre} | ||
737 | <td>CJK ideographic list</td> | ||
738 | <td> | ||
739 | <ul style="list-style-type: cjk-ideographic"><br/> | ||
740 | <li>item1</li><br/> | ||
741 | <li>item2</li><br/> | ||
742 | </ul> | ||
743 | </td> | ||
744 | <td> | ||
745 | (% style="list-style-type: cjk-ideographic" %)<br/> | ||
746 | * item1<br/> | ||
747 | * item2<br/> | ||
748 | </td> | ||
749 | {/pre} | ||
750 | <td> | ||
751 | <ul style="list-style-type: cjk-ideographic"> | ||
752 | <li>item1</li> | ||
753 | <li>item2</li> | ||
754 | </ul> | ||
755 | </td> | ||
756 | </tr> | ||
757 | </table> | ||
758 | |||
759 | 1.1 Definition Lists | ||
760 | |||
761 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
762 | <tr> | ||
763 | <th>Feature</th> | ||
764 | <th>XWiki Syntax 1.0</th> | ||
765 | <th>XWiki Syntax 2.0</th> | ||
766 | <th>Result</th> | ||
767 | </tr> | ||
768 | <tr> | ||
769 | {pre} | ||
770 | <td>Standard definition</td> | ||
771 | <td> | ||
772 | <dl><br/> | ||
773 | <dt>term</dt><br/> | ||
774 | <dd>definition</dd><br/> | ||
775 | </dl> | ||
776 | </td> | ||
777 | <td> | ||
778 | ; term<br/> | ||
779 | : definition | ||
780 | </td> | ||
781 | {/pre} | ||
782 | <td> | ||
783 | <dl> | ||
784 | <dt>term</dt> | ||
785 | <dd>definition</dd> | ||
786 | </dl> | ||
787 | </td> | ||
788 | </tr> | ||
789 | <tr> | ||
790 | {pre} | ||
791 | <td>Nested definitions</td> | ||
792 | <td> | ||
793 | <dl><br/> | ||
794 | <dt>term1</dt><br/> | ||
795 | <dd>definition1<br/> | ||
796 | <dl><br/> | ||
797 | <dt>term2</dt><br/> | ||
798 | <dd>definition2</dd><br/> | ||
799 | </dl><br/> | ||
800 | </dd><br/> | ||
801 | </dl> | ||
802 | </td> | ||
803 | <td> | ||
804 | ; term1<br/> | ||
805 | : definition1<br/> | ||
806 | :; term2<br/> | ||
807 | :: definition2 | ||
808 | </td> | ||
809 | {/pre} | ||
810 | <td> | ||
811 | <dl> | ||
812 | <dt>term1</dt> | ||
813 | <dd>definition1 | ||
814 | <dl> | ||
815 | <dt>term2</dt> | ||
816 | <dd>definition2</dd> | ||
817 | </dl> | ||
818 | </dd> | ||
819 | </dl> | ||
820 | </td> | ||
821 | </tr> | ||
822 | <tr> | ||
823 | {pre} | ||
824 | <td>Parametrized definition</td> | ||
825 | <td> | ||
826 | <dl style="color:blue"><br/> | ||
827 | <dt>term</dt><br/> | ||
828 | <dd>definition</dd><br/> | ||
829 | </dl> | ||
830 | </td> | ||
831 | </td> | ||
832 | <td> | ||
833 | (% style="color:blue" %)<br/> | ||
834 | ; term<br/> | ||
835 | : definition | ||
836 | </td> | ||
837 | {/pre} | ||
838 | <td> | ||
839 | <dl style="color:blue"> | ||
840 | <dt>term</dt> | ||
841 | <dd>definition</dd> | ||
842 | </dl> | ||
843 | </td> | ||
844 | </tr> | ||
845 | </table> | ||
846 | |||
847 | 1.1 New Line/Line breaks | ||
848 | |||
849 | A new line is a carriage return. A line break is a forced new line that can appear anywhere in the text. | ||
850 | |||
851 | #info("In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole syntax.") | ||
852 | |||
853 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
854 | <tr> | ||
855 | <th>Feature</th> | ||
856 | <th>XWiki Syntax 1.0</th> | ||
857 | <th>XWiki Syntax 2.0</th> | ||
858 | <th>Result XWiki Syntax 1.0</th> | ||
859 | |||
860 | |||
861 | <th>Result XWiki Syntax 2.0</th> | ||
862 | </tr> | ||
863 | <tr> | ||
864 | {pre} | ||
865 | <td>Line break</td> | ||
866 | <td>Line\\New line</td> | ||
867 | <td>Line\\New line</td> | ||
868 | {/pre} | ||
869 | <td>Line\\New line</td> | ||
870 | <td>Line\\New line</td> | ||
871 | </tr> | ||
872 | <tr> | ||
873 | |||
874 | {pre} | ||
875 | <td>New line</td> | ||
876 | <td>Line<br/>New line</td> | ||
877 | <td>Line<br/>New line</td> | ||
878 | {/pre} | ||
879 | <td>Line New line</td> | ||
880 | <td>Line<br/>New line</td> | ||
881 | </tr> | ||
882 | </table> | ||
883 | |||
884 | 1.1 Links | ||
885 | |||
886 | #* | ||
887 | TODO: In XWiki Syntax 2.0 it's possible to configure how links are displayed when they don't have an explicit label specified. | ||
888 | Give a link to how to configure this feature | ||
889 | *# | ||
890 | |||
891 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
892 | <tr> | ||
893 | <th>Feature</th> | ||
894 | <th>XWiki Syntax 1.0</th> | ||
895 | <th>XWiki Syntax 2.0</th> | ||
896 | <th>Result XWiki Syntax 1.0</th> | ||
897 | <th>Result XWiki Syntax 2.0</th> | ||
898 | </tr> | ||
899 | <tr> | ||
900 | {pre} | ||
901 | <td>Link to a page in the current Space</td> | ||
902 | <td>[WebHome]</td> | ||
903 | <td>[[WebHome]]</td> | ||
904 | {/pre} | ||
905 | <td> | ||
906 | <span class="wikilink"><a href="/xwiki/bin/view/Main/">Web Home</a></span> | ||
907 | </td> | ||
908 | <td> | ||
909 | <span class="wikilink"><a href="/xwiki/bin/view/Main/">WebHome</a></span> | ||
910 | </td> | ||
911 | </tr> | ||
912 | <tr> | ||
913 | {pre} | ||
914 | <td>Link with a label</td> | ||
915 | <td>[label>WebHome]</td> | ||
916 | <td>[[label>>WebHome]]</td> | ||
917 | {/pre} | ||
918 | <td> | ||
919 | <span class="wikilink"><a href="/xwiki/bin/view/Main/">label</a></span> | ||
920 | </td> | ||
921 | <td> | ||
922 | <span class="wikilink"><a href="/xwiki/bin/view/Main/">label</a></span> | ||
923 | </td> | ||
924 | </tr> | ||
925 | <tr> | ||
926 | {pre} | ||
927 | <td>Link to a page with the space specified</td> | ||
928 | <td>[Main.WebHome]</td> | ||
929 | <td>[[Main.WebHome]]</td> | ||
930 | {/pre} | ||
931 | <td> | ||
932 | <span class="wikilink"><a href="/xwiki/bin/view/Main/">Web Home</a></span> | ||
933 | </td> | ||
934 | <td> | ||
935 | <span class="wikilink"><a href="/xwiki/bin/view/Main/">WebHome</a></span> | ||
936 | </td> | ||
937 | </tr> | ||
938 | <tr> | ||
939 | {pre} | ||
940 | <td>Link to a subwiki</td> | ||
941 | <td>[subwiki:Main.WebHome]</td> | ||
942 | <td>[[subwiki:Main.WebHome]]</td> | ||
943 | {/pre} | ||
944 | <td> | ||
945 | <span class="wikilink"><a href="/xwiki/bin/view/Main/">Web Home</a></span> | ||
946 | </td> | ||
947 | <td> | ||
948 | <span class="wikilink"><a href="/xwiki/bin/view/Main/">WebHome</a></span> | ||
949 | </td> | ||
950 | </tr> | ||
951 | <tr> | ||
952 | {pre} | ||
953 | <td>Link that opens in a new page</td> | ||
954 | <td>[label>WebHome>_blank]</td> | ||
955 | <td>[[label>>WebHome||target="_blank"]]</td> | ||
956 | {/pre} | ||
957 | <td> | ||
958 | <span class="wikilink"><a href="/xwiki/bin/view/Main/" rel="__blank">label</a></span> | ||
959 | </td> | ||
960 | <td> | ||
961 | <span class="wikilink"><a href="/xwiki/bin/view/Main/" rel="__blank">label</a></span> | ||
962 | </td> | ||
963 | </tr> | ||
964 | <tr> | ||
965 | {pre} | ||
966 | <td>Link to a URL directly in the text</td> | ||
967 | <td>This is a URL: http://xwiki.org</td> | ||
968 | <td>This is a URL: http://xwiki.org</td> | ||
969 | {/pre} | ||
970 | <td> | ||
971 | This is a URL: <span class="wikiexternallink"><a href="http://www.xwiki.org">http://www.xwiki.org</a></span> | ||
972 | </td> | ||
973 | <td> | ||
974 | This is a URL: <span class="wikiexternallink"><a href="http://www.xwiki.org">http://www.xwiki.org</a></span> | ||
975 | </td> | ||
976 | </tr> | ||
977 | <tr> | ||
978 | {pre} | ||
979 | <td>Link to a URL</td> | ||
980 | <td>[http://xwiki.org]</td> | ||
981 | <td>[[http://xwiki.org]]</td> | ||
982 | {/pre} | ||
983 | <td> | ||
984 | <span class="wikiexternallink"><a href="http://www.xwiki.org">http://www.xwiki.org</a></span> | ||
985 | </td> | ||
986 | <td> | ||
987 | <span class="wikiexternallink"><a href="http://www.xwiki.org">http://www.xwiki.org</a></span> | ||
988 | </td> | ||
989 | </tr> | ||
990 | <tr> | ||
991 | {pre} | ||
992 | <td>Link to a URL with a label</td> | ||
993 | <td>[XWiki>http://xwiki.org]</td> | ||
994 | <td>[[XWiki>>http://xwiki.org]]</td> | ||
995 | {/pre} | ||
996 | <td> | ||
997 | <span class="wikiexternallink"><a href="http://www.xwiki.org">XWiki</a></span> | ||
998 | </td> | ||
999 | <td> | ||
1000 | <span class="wikiexternallink"><a href="http://www.xwiki.org">XWiki</a></span> | ||
1001 | </td> | ||
1002 | </tr> | ||
1003 | <tr> | ||
1004 | {pre} | ||
1005 | <td>Link to an email</td> | ||
1006 | <td>[email>mailto:john@smith.net]</td> | ||
1007 | <td>[[email>>mailto:john@smith.net]]</td> | ||
1008 | {/pre} | ||
1009 | <td> | ||
1010 | <span class="wikiexternallink"><a href="mailto:john&@smith.com">email</a></span> | ||
1011 | </td> | ||
1012 | <td> | ||
1013 | <span class="wikiexternallink"><a href="mailto:john&@smith.com">email</a></span> | ||
1014 | |||
1015 | </td> | ||
1016 | </tr> | ||
1017 | <tr> | ||
1018 | {pre} | ||
1019 | <td>Image Link</td> | ||
1020 | <td><a href="\$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2}</a></td> | ||
1021 | <td>[[image:Space2.Page2@img.png>>Space1.Page1]] #info("Wiki syntax is supported inside link labels")</td> | ||
1022 | {/pre} | ||
1023 | <td> | ||
1024 | <a href="/xwiki/bin/view/Main/">{image:img.png}</a> | ||
1025 | </td> | ||
1026 | <td> | ||
1027 | <a href="/xwiki/bin/view/Main/">{image:img.png}</a> | ||
1028 | </td> | ||
1029 | </tr> | ||
1030 | <tr> | ||
1031 | <td>Link to attachment</td> | ||
1032 | <td>#info("See [Attach Macro>code:Macros.AttachMacro] for details") | ||
1033 | {pre} | ||
1034 | {attach:text|file=img.png}</td> | ||
1035 | <td>[[text>>attach:img.png]]</td> | ||
1036 | {/pre} | ||
1037 | <td> | ||
1038 | {attach:text|file=img.png}</td> | ||
1039 | </td> | ||
1040 | <td> | ||
1041 | {attach:text|file=img.png}</td> | ||
1042 | </td> | ||
1043 | </tr> | ||
1044 | </table> | ||
1045 | |||
1046 | 1.1.1 XWiki Syntax 1.0 Link Specification | ||
1047 | |||
1048 | The full format of a link is {code}(alias[|>])+(link)(@interWikiAlias)+([|>]target)+{code} | ||
1049 | * <tt>alias</tt>: An optional string which will be displayed to the user as the link name when rendered. Example: "My Page". | ||
1050 | * <tt>link</tt>: The full link reference using the following syntax: {code}(virtualWikiAlias:)+(space.)+(reference)(?queryString)+(#anchor)+{code} | ||
1051 | * Note that either the <tt>link</tt> or the <tt>alias</tt> must be specified. | ||
1052 | ** <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". | ||
1053 | ** <tt>space</tt>: An optional Wiki Space name. If not space is specified the current space is used. Example: "Main". | ||
1054 | ** <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"). | ||
1055 | ** <tt>queryString</tt>: An optional query string for specifying parameters that will be used in the rendered URL. Example: "mydata1=5&mydata2=Hello". | ||
1056 | ** <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". | ||
1057 | * <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" | ||
1058 | * <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" | ||
1059 | |||
1060 | 1.1.1 XWiki Syntax 2.0 Link Specification | ||
1061 | |||
1062 | The full format of a link is {code}(label>>)?(link)(||parameters)*{code} | ||
1063 | * <tt>label</tt>: the link label, can contain wiki syntax | ||
1064 | * <tt>link</tt>: 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: <tt>mailto:</tt> and <tt>attach:</tt> for linking to an email and linking to an attachment respectively. | ||
1065 | * <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. | ||
1066 | |||
1067 | 1.1 Tables | ||
1068 | |||
1069 | Allows to easily create content in table format. It also support parameters for table, row or cell in XWiki Syntax 2.0. | ||
1070 | |||
1071 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
1072 | <tr> | ||
1073 | <th>Feature</th> | ||
1074 | <th>XWiki Syntax 1.0</th> | ||
1075 | <th>XWiki Syntax 2.0</th> | ||
1076 | <th>Result XWiki Syntax 1.0</th> | ||
1077 | <th>Result XWiki Syntax 2.0</th> | ||
1078 | </tr> | ||
1079 | <tr> | ||
1080 | {pre} | ||
1081 | <td>Standard table</td> | ||
1082 | <td> | ||
1083 | {table}<br/> | ||
1084 | Title 1 | Title 2<br/> | ||
1085 | Word 1 | Word 2<br/> | ||
1086 | {table} | ||
1087 | </td> | ||
1088 | <td> | ||
1089 | |=Title 1|=Title 2<br/> | ||
1090 | |Word 1|Word 2<br/> | ||
1091 | </td> | ||
1092 | {/pre} | ||
1093 | <td> | ||
1094 | <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> | ||
1095 | </td> | ||
1096 | <td> | ||
1097 | <table><tbody><tr><th>Title 1</th><th>Title 2</th></tr><tr><td>Word 1</td><td>Word 2</td></tr></tbody></table> | ||
1098 | </td> | ||
1099 | </tr> | ||
1100 | <tr> | ||
1101 | {pre} | ||
1102 | <td>Parametrized table</td> | ||
1103 | <td> | ||
1104 | <table style="background-color:red;align:center"><br/> | ||
1105 | <tbody><br/> | ||
1106 | <tr><br/> | ||
1107 | <th>Title 1</th><br/> | ||
1108 | <th style="background-color:yellow">Title 2</th><br/> | ||
1109 | |||
1110 | </tr><br/> | ||
1111 | <tr><br/> | ||
1112 | <td>Word 1</td><br/> | ||
1113 | <td>Word 2</td><br/> | ||
1114 | </tr><br/> | ||
1115 | </tbody><br/> | ||
1116 | </table> | ||
1117 | </td> | ||
1118 | <td> | ||
1119 | (% style="background-color:red;align=center" %)<br/> | ||
1120 | |=Title 1|=(% style="background-color:yellow" %)Title 2<br/> | ||
1121 | |Word 1|Word 2<br/> | ||
1122 | </td> | ||
1123 | {/pre} | ||
1124 | <td> | ||
1125 | <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> | ||
1126 | </td> | ||
1127 | <td> | ||
1128 | <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> | ||
1129 | </td> | ||
1130 | </tr> | ||
1131 | <tr> | ||
1132 | {pre} | ||
1133 | <td>Filterable Sortable table</td> | ||
1134 | <td> | ||
1135 | <table id="tableid" class="grid sortable filterable doOddEven"><br/> | ||
1136 | <tr class="sortHeader"><br/> | ||
1137 | <th>Title1</th><br/> | ||
1138 | <th>Title2</th><br/> | ||
1139 | </tr><br/> | ||
1140 | <tr><br/> | ||
1141 | <td>Cell11</td><br/> | ||
1142 | <td>Cell12</td><br/> | ||
1143 | </tr><br/> | ||
1144 | <tr><br/> | ||
1145 | <td>Cell21</td><br/> | ||
1146 | <td>Cell22</td><br/> | ||
1147 | </tr><br/> | ||
1148 | </table><br/> | ||
1149 | </td> | ||
1150 | <td> | ||
1151 | #warning("Not implemented yet") | ||
1152 | </td> | ||
1153 | <td> | ||
1154 | <table id="MovieTable" class="grid sortable filterable doOddEven"> | ||
1155 | <tr class="sortHeader"> | ||
1156 | <th>Title1</th> | ||
1157 | <th>Title2</th> | ||
1158 | </tr> | ||
1159 | <tr> | ||
1160 | <td>Cell11</td> | ||
1161 | <td>Cell12</td> | ||
1162 | </tr> | ||
1163 | <tr> | ||
1164 | <td>Cell21</td> | ||
1165 | <td>Cell22</td> | ||
1166 | </tr> | ||
1167 | </table> | ||
1168 | </td> | ||
1169 | <td> | ||
1170 | #warning("Not implemented yet") | ||
1171 | </td> | ||
1172 | {/pre} | ||
1173 | </tr> | ||
1174 | </table> | ||
1175 | |||
1176 | 1.1 Images | ||
1177 | |||
1178 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
1179 | <tr> | ||
1180 | <th>Feature</th> | ||
1181 | <th>XWiki Syntax 1.0</th> | ||
1182 | <th>XWiki Syntax 2.0</th> | ||
1183 | <th>Result</th> | ||
1184 | </tr> | ||
1185 | <tr> | ||
1186 | <td>Image from attachment in current page</td> | ||
1187 | <td> | ||
1188 | #info("See [Image Macro>code:Macros.ImageMacro] for details") | ||
1189 | {pre} | ||
1190 | {image:img.png} | ||
1191 | </td> | ||
1192 | <td>image:img.png</td> | ||
1193 | {/pre} | ||
1194 | <td> | ||
1195 | {image:img.png} | ||
1196 | </td> | ||
1197 | </tr> | ||
1198 | <tr> | ||
1199 | <td>Image from attachment in another document</td> | ||
1200 | <td> | ||
1201 | {pre} | ||
1202 | {image:img.png|document=Space.Page} | ||
1203 | </td> | ||
1204 | <td>image:Space.Page@img.png</td> | ||
1205 | {/pre} | ||
1206 | <td> | ||
1207 | {image:img.png} | ||
1208 | </td> | ||
1209 | </tr> | ||
1210 | <tr> | ||
1211 | <td>Image with parameters</td> | ||
1212 | <td> | ||
1213 | {pre} | ||
1214 | {image:img.png|width=25|height=25} | ||
1215 | </td> | ||
1216 | <td>[[image:img.png||width="25" height="25"]]</td> | ||
1217 | {/pre} | ||
1218 | <td> | ||
1219 | {image:img.png|width=25|height=25} | ||
1220 | </td> | ||
1221 | </tr> | ||
1222 | <tr> | ||
1223 | <td>Images located at URL</td> | ||
1224 | <td> | ||
1225 | {pre} | ||
1226 | http://some/url/img.png | ||
1227 | </td> | ||
1228 | <td>image:http://some/url/img.png</td> | ||
1229 | {/pre} | ||
1230 | <td> | ||
1231 | {image:img.png} | ||
1232 | </td> | ||
1233 | </tr> | ||
1234 | </table> | ||
1235 | |||
1236 | 1.1 Verbatim | ||
1237 | |||
1238 | Allow to enter content that will not be formatted (in other words the wiki syntax will not be taken into account). | ||
1239 | |||
1240 | #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.") | ||
1241 | |||
1242 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
1243 | <tr> | ||
1244 | <th>Feature</th> | ||
1245 | <th>XWiki Syntax 1.0</th> | ||
1246 | <th>XWiki Syntax 2.0</th> | ||
1247 | <th>Result XWiki Syntax 1.0</th> | ||
1248 | <th>Result XWiki Syntax 2.0</th> | ||
1249 | </tr> | ||
1250 | <tr> | ||
1251 | <td>Verbatim inline</td> | ||
1252 | <td> | ||
1253 | Some verbatim \{pre\}\*\[not rendered\]\*\{/pre\} content | ||
1254 | </td> | ||
1255 | {pre} | ||
1256 | <td> | ||
1257 | Some verbatim {{{**[[not rendered]]**}}} content | ||
1258 | </td> | ||
1259 | {/pre} | ||
1260 | <td> | ||
1261 | Some verbatim \*\[not rendered\]\* content | ||
1262 | </td> | ||
1263 | <td> | ||
1264 | Some verbatim \*\*\[\[not rendered\]\]\*\* content | ||
1265 | </td> | ||
1266 | </tr> | ||
1267 | <tr> | ||
1268 | <td>Verbatim block</td> | ||
1269 | <td> | ||
1270 | \{pre\} | ||
1271 | multi line<br/> | ||
1272 | \*verbatim\*<br/> | ||
1273 | content<br/> | ||
1274 | \{/pre\} | ||
1275 | #info("It's also possible to use the [Code macro>code:Macros.CodeMacro] but it displays its content in a box by default.") | ||
1276 | </td> | ||
1277 | <td> | ||
1278 | {{{<br/> | ||
1279 | multi line<br/> | ||
1280 | \*\*verbatim\*\*<br/> | ||
1281 | content<br/> | ||
1282 | }}} | ||
1283 | </td> | ||
1284 | <td> | ||
1285 | multi line<br/> | ||
1286 | \*verbatim\*<br/> | ||
1287 | content | ||
1288 | </td> | ||
1289 | <td> | ||
1290 | multi line<br/> | ||
1291 | \*\*verbatim\*\*<br/> | ||
1292 | content | ||
1293 | </td> | ||
1294 | </tr> | ||
1295 | </table> | ||
1296 | |||
1297 | 1.1 Quotations | ||
1298 | |||
1299 | Allows to quote some text. | ||
1300 | |||
1301 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
1302 | <tr> | ||
1303 | <th>Feature</th> | ||
1304 | <th>XWiki Syntax 1.0</th> | ||
1305 | <th>XWiki Syntax 2.0</th> | ||
1306 | <th>Result</th> | ||
1307 | </tr> | ||
1308 | <tr> | ||
1309 | {pre} | ||
1310 | <td>Simple quote</td> | ||
1311 | <td> | ||
1312 | <blockquote>john said this</blockquote><br/> | ||
1313 | I said ok | ||
1314 | </td> | ||
1315 | <td> | ||
1316 | > john said this<br/> | ||
1317 | I said ok | ||
1318 | </td> | ||
1319 | {/pre} | ||
1320 | <td> | ||
1321 | <blockquote>john said this</blockquote> | ||
1322 | I said ok | ||
1323 | </td> | ||
1324 | </tr> | ||
1325 | <tr> | ||
1326 | {pre} | ||
1327 | <td>Nested quotes</td> | ||
1328 | <td> | ||
1329 | <blockquote>john said this<br/> | ||
1330 | <blockquote>marie answered that</blockquote><br/> | ||
1331 | </blockquote><br/> | ||
1332 | I said ok | ||
1333 | </td> | ||
1334 | <td> | ||
1335 | > john said this<br/> | ||
1336 | >> marie answered that<br/> | ||
1337 | I said ok | ||
1338 | </td> | ||
1339 | {/pre} | ||
1340 | <td> | ||
1341 | <blockquote>john said this<blockquote>marie answered that</blockquote></blockquote> | ||
1342 | I said ok | ||
1343 | </td> | ||
1344 | </tr> | ||
1345 | </table> | ||
1346 | |||
1347 | 1.1 Embedded documents | ||
1348 | |||
1349 | This feature allows inserting 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. Embedded documents are delimited by the following syntactic elements: <tt>(((...)))</tt>. One embedded document can contain its own embedded documents and there is no limit of imbrication. | ||
1350 | |||
1351 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
1352 | <tr> | ||
1353 | <th>XWiki Syntax 1.0</th> | ||
1354 | <th>XWiki Syntax 2.0</th> | ||
1355 | <th>Result</th> | ||
1356 | </tr> | ||
1357 | <tr> | ||
1358 | <td>This feature doesn't exist in XWiki syntax 1.0. You'd have to use pure HTML to achieve the result.</td> | ||
1359 | <td> | ||
1360 | {code:none} | ||
1361 | |=Header 1|=Header 2|=Header 3 | ||
1362 | |Cell One|((( | ||
1363 | = Embedded document | ||
1364 | |||
1365 | Some embedded paragraph. | ||
1366 | |||
1367 | * list item one | ||
1368 | * list item two | ||
1369 | ** sub-item 1 | ||
1370 | ** sub-item 2 | ||
1371 | ))) | Cell Three | ||
1372 | |||
1373 | Next paragraph in the top-level document | ||
1374 | {code} | ||
1375 | </td> | ||
1376 | <td> | ||
1377 | <table> | ||
1378 | <tr> | ||
1379 | <th>Header 1</th> | ||
1380 | <th>Header 2</th> | ||
1381 | <th>Header 3</th> | ||
1382 | </tr> | ||
1383 | <tr> | ||
1384 | <td>Cell One</td> | ||
1385 | <td> | ||
1386 | <div class="xwiki-document"> | ||
1387 | <h1 id="HEmbeddeddocument"> | ||
1388 | <span>Embedded document</span> | ||
1389 | </h1> | ||
1390 | <p>Some embedded paragraph</p> | ||
1391 | <ul> | ||
1392 | <li>list item one</li> | ||
1393 | <li>list item two | ||
1394 | <ul> | ||
1395 | <li>sub-item 1</li> | ||
1396 | <li>sub-item 2</li> | ||
1397 | </ul> | ||
1398 | </li> | ||
1399 | </ul> | ||
1400 | </div> | ||
1401 | </td> | ||
1402 | <td> Cell Three</td> | ||
1403 | </tr> | ||
1404 | </table> | ||
1405 | <p>Next paragraph in the top-level document</p></td> | ||
1406 | </td> | ||
1407 | </tr> | ||
1408 | </table> | ||
1409 | |||
1410 | 1.1 Escapes | ||
1411 | |||
1412 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
1413 | <tr> | ||
1414 | <th>Feature</th> | ||
1415 | <th>XWiki Syntax 1.0</th> | ||
1416 | <th>XWiki Syntax 2.0</th> | ||
1417 | <th>Result XWiki Syntax 1.0</th> | ||
1418 | <th>Result XWiki Syntax 2.0</th> | ||
1419 | </tr> | ||
1420 | <tr> | ||
1421 | {pre} | ||
1422 | <td>Escape a character</td> | ||
1423 | <td>This is not a \[link\]</td> | ||
1424 | <td> | ||
1425 | This is not a ~[~[link~]~] | ||
1426 | #info("To enter a ~ character use a double escape: ~~") | ||
1427 | </td> | ||
1428 | {/pre} | ||
1429 | <td>This is not a \[link\]</td> | ||
1430 | <td>This is not a \[\[link\]\]</td> | ||
1431 | </tr> | ||
1432 | </table> | ||
1433 | |||
1434 | 1.1 Macros | ||
1435 | |||
1436 | There are 2 kinds of macros in XWiki syntax 1.0: | ||
1437 | * Velocity macros (called using the <tt>\#macroname(param1 ... paramN)</tt> syntax) | ||
1438 | * Radeox macros (called using the <tt>\{macroname:param1=value1|...|paramN=valueN\}</tt> syntax) | ||
1439 | |||
1440 | There are also 2 kinds of macros in XWiki Syntax 2.0: | ||
1441 | * Velocity macros (called using the <tt>\#macroname(param1 ... paramN)</tt> syntax) | ||
1442 | * XWiki macros (called using the <tt>\{\{macroname param1="value1" ... paramN="valueN"\}\}</tt> syntax) | ||
1443 | |||
1444 | #info("The Radeox macros cannot be used in XWiki Syntax 2.0. Thus they have been rewritten as XWiki macros.") | ||
1445 | |||
1446 | #info("For the full list of available macros check the [Macro Reference page>code:Macros.WebHome].") | ||
1447 | |||
1448 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
1449 | <tr> | ||
1450 | <th>Feature</th> | ||
1451 | <th>XWiki Syntax 1.0</th> | ||
1452 | <th>XWiki Syntax 2.0</th> | ||
1453 | <th>Result</th> | ||
1454 | </tr> | ||
1455 | <tr> | ||
1456 | <td>Velocity Macro</td> | ||
1457 | <td> | ||
1458 | \#info("Some info text") | ||
1459 | </td> | ||
1460 | <td> | ||
1461 | \{\{velocity\}\}\{\{html\}\} | ||
1462 | \#info("Some info text") | ||
1463 | \{\{/html\}\}\{\{/velocity\}\} | ||
1464 | </td> | ||
1465 | <td>#info("Some info text")</td> | ||
1466 | </tr> | ||
1467 | <tr> | ||
1468 | <td>Radeox Macro/XWiki Macros</td> | ||
1469 | <td> | ||
1470 | \{code:java\} | ||
1471 | content | ||
1472 | \{code\} | ||
1473 | </td> | ||
1474 | <td> | ||
1475 | \{\{velocity context="new"\}\} | ||
1476 | content | ||
1477 | \{\{/velocity\}\} | ||
1478 | </td> | ||
1479 | <td>N/A (depends on the macro)</td> | ||
1480 | </tr> | ||
1481 | </table> | ||
1482 | |||
1483 | 1.1 HTML | ||
1484 | |||
1485 | #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") | ||
1486 | |||
1487 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
1488 | <tr> | ||
1489 | <th>XWiki Syntax 1.0</th> | ||
1490 | <th>XWiki Syntax 2.0</th> | ||
1491 | <th>Result</th> | ||
1492 | </tr> | ||
1493 | <tr> | ||
1494 | {pre} | ||
1495 | <td><b>bold</b></td> | ||
1496 | <td> | ||
1497 | {{html}}<br/> | ||
1498 | <b>bold</b><br/> | ||
1499 | {{/html}} | ||
1500 | </td> | ||
1501 | {/pre} | ||
1502 | <td><b>bold</b></td> | ||
1503 | </tr> | ||
1504 | </table> | ||
1505 | |||
1506 | #info("In XWiki Syntax 2.0, by default the HTML macro understands wiki syntax. To prevent this, use {{html wiki=\"false\"}}") | ||
1507 | |||
1508 | 1.1 Velocity/Groovy Scripts | ||
1509 | |||
1510 | #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.") | ||
1511 | |||
1512 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
1513 | <tr> | ||
1514 | <th>Feature</th> | ||
1515 | <th>XWiki Syntax 1.0</th> | ||
1516 | <th>XWiki Syntax 2.0</th> | ||
1517 | </tr> | ||
1518 | <tr> | ||
1519 | <td>Velocity script</td> | ||
1520 | <td>\#set (\$var = "whatever")</td> | ||
1521 | <td> | ||
1522 | \{\{velocity\}\}<br/> | ||
1523 | \#set (\$var = "whatever")<br/> | ||
1524 | \{\{/velocity\}\} | ||
1525 | </td> | ||
1526 | </tr> | ||
1527 | <tr> | ||
1528 | <td>Groovy script</td> | ||
1529 | <td> | ||
1530 | \<\%<br/> | ||
1531 | def var = "whatever"<br/> | ||
1532 | \%\> | ||
1533 | </td> | ||
1534 | <td> | ||
1535 | \{\{groovy\}\}<br/> | ||
1536 | def var = "whatever"<br/> | ||
1537 | \{\{/groovy\}\} | ||
1538 | </td> | ||
1539 | </tr> | ||
1540 | </table> | ||
1541 | |||
1542 | 1.1 Parameters | ||
1543 | |||
1544 | 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. | ||
1545 | |||
1546 | <table class="wiki-table" border="1" cellspacing="0" cellpadding="2" width="80%"> | ||
1547 | <tr> | ||
1548 | <th>XWiki Syntax 1.0</th> | ||
1549 | <th>XWiki Syntax 2.0</th> | ||
1550 | <th>Generated XHTML</th> | ||
1551 | </tr> | ||
1552 | <tr> | ||
1553 | <td> | ||
1554 | <h1 class="myClass" style="myStyle" id="myId">header</h1> | ||
1555 | </td> | ||
1556 | <td> | ||
1557 | (% class="myClass" style="myStyle" id="myId" %)<br/> | ||
1558 | = header = | ||
1559 | <td> | ||
1560 | <h1 class="myClass" style="myStyle" id="myId">header</h1> | ||
1561 | </td> | ||
1562 | </tr> | ||
1563 | </table> | ||
1564 | |||
1565 | 1.1 Other syntaxes | ||
1566 | |||
1567 | The following other syntaxes are implemented in XWiki Enterprise 1.6 and above: | ||
1568 | * [JSPWiki>http://www.jspwiki.org/wiki/TextFormattingRules] | ||
1569 | * [MediaWiki>http://en.wikipedia.org/wiki/Help:Editing] | ||
1570 | * [Confluence>http://confluence.atlassian.com/display/CONF20/Confluence+Notation+Guide+Overview] | ||
1571 | * [TWiki>http://twiki.org/cgi-bin/view/TWiki/WikiSyntax] | ||
1572 | * [Creole 1.0>http://www.wikicreole.org/wiki/Creole1.0] | ||
1573 | * [XHTML 1.0>http://www.w3.org/TR/xhtml1/] | ||
1574 | |||
1575 | #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.8 and beyond.") |