<
From version < 10.4 >
edited by Vincent Massol
on 2013/10/15
To version < 12.1 >
edited by Vincent Massol
on 2014/10/21
>
Change comment: Install extension [org.xwiki.platform:xwiki-platform-help-ui-6.2.2]

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -XWiki Syntaxes
1 +$services.localization.render("help.syntaxpage.title")
Parent
... ... @@ -1,1 +1,1 @@
1 -XWiki.WebHome
1 +Main.WebHome
Syntax
... ... @@ -1,1 +1,1 @@
1 -XWiki 2.0
1 +XWiki 2.1
Content
... ... @@ -1,910 +1,295 @@
1 -{{velocity}}$xwiki.get('ssx').use($doc.getFullName()){{/velocity}}
1 +{{velocity output="false"}}
2 +#set($SUPPORTED_SYNTAXES = {})
3 +#set($void = $SUPPORTED_SYNTAXES.put(1.0, 'XWiki Syntax 1.0'))
4 +#set($void = $SUPPORTED_SYNTAXES.put(2.0, 'XWiki Syntax 2.0'))
5 +#set($void = $SUPPORTED_SYNTAXES.put(2.1, 'XWiki Syntax 2.1'))
2 2  
3 -{{box cssClass="floatinginfobox" title="**Contents**"}}
4 -{{toc depth="1"/}}
5 -{{/box}}
7 +#if ($request.xaction == 'switchContext')
8 + $response.sendRedirect($request.target)
9 + #stop
10 +#end
6 6  
7 -Starting with XWiki Enterprise 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:
8 -* Fix the limitations and ambiguities of the XWiki Syntax 1.0 (which was inspired by both Radeox - the underlying rendering engine - and TWiki).
9 -** 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.
10 -** 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.
11 -* 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.
12 +#set ($crtCategoryId = "$!{request.category}")
13 +#if ($crtCategoryId != '')
14 + #set ($crtCategoryId = $mathtool.toInteger($crtCategoryId))
15 +#end
16 +#set ($crtSectionId = "$!{request.section}")
17 +#set ($crtSyntaxVer = $mathtool.toDouble($request.syntax))
18 +#if ($crtSyntaxVer && $SUPPORTED_SYNTAXES.containsKey($crtSyntaxVer))
19 + #set ($crtSyntaxVer = $mathtool.toDouble($crtSyntaxVer))
12 12  
13 -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 Enterprise version 3.0. Some reason for the development of this new syntax are:
14 -* Homogenize the link and image syntax for better clarity, consistency and extensibility.
15 -* Added ability to display icons, to link to files using the UNC notation and to link to relative URLs.
21 +#else
22 + #set ($crtSyntaxVer = 2.1) ## Default to Syntax 2.1
23 +#end
16 16  
17 -{{info}}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.{{/info}}
25 +#set ($extraParamList = [])
26 +#if ($request.language)
27 + #set ($discard = $extraParamList.add("language=$escapetool.url($request.language)"))
28 +#end
29 +#if ($request.xpage)
30 + #set ($discard = $extraParamList.add("xpage=$escapetool.url($request.xpage)"))
31 +#end
32 +#if ($extraParamList.isEmpty())
33 + #set ($extraParams = '')
34 +#else
35 + #set ($extraParams = '&'+$stringtool.join($extraParamList,'&'))
36 +#end
18 18  
19 -In addition to these XWiki-specific syntaxes we've also changed our underlying rendering engine in XWiki Enterprise 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]].
38 +##
39 +## Syntax menu map
40 +##
41 +#set($syntaxMenu = [])
42 +#set($catCount = -1)
43 +#set($catName = "")
44 +#set($catChildren = [])
45 +#set($results = $services.query.xwql('from doc.object(XWiki.XWikiSyntaxClass) as syntax order by syntax.category, syntax.section').addFilter('currentlanguage').addFilter('unique').execute())
20 20  
21 -= General Remarks =
47 +#if($results.empty)
48 + No syntax sections found!
49 +#else
50 + #foreach ($item in $results)
51 + #set($sectionDoc = $xwiki.getDocument($item))
52 + #set($obj = $sectionDoc.getObject("XWiki.XWikiSyntaxClass"))
22 22  
23 -XWiki Syntax 2.0 corrects some errors or ambiguous syntax entered by the user as shown in the examples in the table below.
54 + ## detect if we entered a new category
55 + #if($catCount < $obj.getProperty("category").value))
56 + ## Put previous category into map (if existing), and reset children map
57 + #if($catId)
58 + #set($cat = { 'id' : $catId, 'name' : $catName, 'children' : $catChildren })
59 + $syntaxMenu.add($cat)
60 + #set($catChildren = [])
61 + #end
62 + ## extract new catId and catName values, and sectionTitle as we are already traveling the DOM
63 + #foreach($headerBlock in $sectionDoc.getDocument().getXDOM().getBlocks('class:HeaderBlock', 'DESCENDANT'))
64 + #if($headerBlock.getLevel().getAsInt() == 1)
65 + #set($catId = $headerBlock.getId().substring(1))
66 + #set($catName = $services.rendering.render($headerBlock, 'plain/1.0'))
67 + #elseif($headerBlock.getLevel().getAsInt() == 2)
68 + #set($sectionTitle = $services.rendering.render($headerBlock, 'plain/1.0'))
69 + #break
70 + #end
71 + #end
72 + #foreach($headerBlock in $sectionDoc.getTranslatedDocument().getDocument().getXDOM().getBlocks('class:HeaderBlock', 'DESCENDANT'))
73 + #if($headerBlock.getLevel().getAsInt() == 1)
74 + #set($catName = $services.rendering.render($headerBlock, 'plain/1.0'))
75 + #elseif($headerBlock.getLevel().getAsInt() == 2)
76 + #set($sectionTitle = $services.rendering.render($headerBlock, 'plain/1.0'))
77 + #break ## otherwise finds nested example headlines
78 + #end
79 + #end
80 + #set($catCount = $obj.getProperty("category").value)
81 + #else
82 + ## still in same category, only need new section title
83 + #foreach($headerBlock in $sectionDoc.getTranslatedDocument().getDocument().getXDOM().getBlocks('class:HeaderBlock', 'DESCENDANT'))
84 + #if($headerBlock.getLevel().getAsInt() == 2)
85 + #set($sectionTitle = $services.rendering.render($headerBlock, 'plain/1.0'))
86 + #break
87 + #end
88 + #end
89 + #end
24 24  
25 -|=Description|=Example of invalid or ambiguous syntax|=Fixed XWiki Syntax 2.0
26 -|Unclosed text styles|{{{**bold}}}|{{{**bold**}}}
27 -|Two standalone elements not separated by 2 new lines|{{{| table cell}}}\\{{{* list item}}}|{{{| table cell}}}\\\\{{{* list item}}}
28 -|Two standalone elements not separated by 2 new lines|{{{paragraph}}}\\{{{----}}}\\{{{paragraph}}}|{{{paragraph}}}\\\\{{{----}}}\\\\{{{paragraph}}}
29 -|Ignored new line at beginning of document|<new line at beginning of document>\\paragraph|paragraph
30 -|Not closed heading syntax|{{{=== heading}}}|{{{=== heading ===}}}
91 + ## Add new sections to category children map
92 + #set($child = {'id' : $sectionDoc.getName().substring(11), 'minSyntax' : $obj.getProperty("minSyntaxVersion").value, 'maxSyntax' : $obj.getProperty("maxSyntaxVersion").value, 'name' : $sectionTitle})
93 + $catChildren.add($child)
94 + #end
95 +#end
96 +#set($cat = { 'id' : $catId, 'name' : $catName, 'children' : $catChildren })
97 +$syntaxMenu.add($cat)
31 31  
32 -= Paragraphs =
33 33  
34 -Paragraphs are text elements separated by 2 or more new lines.
100 +##
101 +## Filter only the sections that are valid for a Syntax
102 +##
103 +#set ($categoriesToRemove = [])
104 +#foreach ($category in $syntaxMenu)
105 + #set ($sectionsToRemove = [])
106 + #foreach ($section on $category.children)
107 + #if ($section.minSyntax > $crtSyntaxVer)
108 + #set ($discard = $sectionsToRemove.add($section))
109 + #if ($section.id == $crtSectionId)
110 + #set ($crtSectionId = '') ## clear section if it doesn't exist (can happen when switching from 2.0 to 2.1 syntax)
111 + #end
112 + #end
113 + #end
114 + #set ($discard = $category.children.removeAll($sectionsToRemove))
115 + #if ($category.children.size() == 0)
116 + #set ($discard = $categoriesToRemove.add($category))
117 + #end
118 +#end
119 +#set ($discard = $syntaxMenu.removeAll($categoriesToRemove))
120 +#if ("$!crtCategoryId" != '' && $crtCategoryId >= $syntaxMenu.size())
121 + #set ($crtCategoryId = '')
122 +#end
35 35  
36 -{{info}}
37 -In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole Syntax.
38 -{{/info}}
124 +#if ($crtSectionId != '')
125 + #set ($crtItemId = $crtSectionId)
126 +#elseif ($crtCategoryId != '')
127 + #set ($crtItemId = $syntaxMenu.get($crtCategoryId).id)
128 +#end
129 +#set ($crtSection = $util.null)
130 +#set ($crtCategory = $util.null)
39 39  
40 -(% style="width:100%" %)
41 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
42 -|Simple paragraph|This is a paragraph|This is a paragraph|This is a paragraph|This is a paragraph
43 -|Paragraph on multiple lines|Paragraph on{{{\\}}}\\multiple lines|Paragraph on\\multiple lines|Paragraph on\\multiple lines|Paragraph on\\multiple lines
44 -|Two paragraphs|Paragraph one\\\\Paragraph two|Paragraph one\\\\Paragraph two|Paragraph one\\\\Paragraph two|Paragraph one\\\\Paragraph two
45 -|Parametrized paragraph|<p style="text-align:center;color:blue">Centered and blue paragraph</p>|{{{(% style="text-align:center;color:blue" %)}}}\\Centered and blue paragraph|(% style="text-align:center;color:blue" %)\\Centered and blue paragraph|(% style="text-align:center;color:blue" %)\\Centered and blue paragraph
46 46  
47 -= Headings =
133 +##
134 +## Prepare the Syntax menu map for processing
135 +##
136 +#foreach ($category in $syntaxMenu)
137 + ## "Standard" URLs and icons for categories
138 + #set ($category.url = "?syntax=$escapetool.url(${crtSyntaxVer})&category=${mathtool.sub($velocityCount, 1)}${extraParams}")
139 + #set ($category.cssClass = "${category.id}Icon")
140 + #if ("$!{crtCategoryId}" != '' && $velocityCount == $mathtool.add($crtCategoryId, 1))
141 + #set ($crtCategory = $category)
142 + #end
143 + ##
144 + ## Process each syntax section
145 + #foreach ($section in $category.children)
146 + #if ($xwiki.exists("XWiki.XWikiSyntax${section.id}"))
147 + #if ($crtSectionId == $section.id)
148 + #set ($crtSection = $section)
149 + #set ($crtCategory = $category)
150 + #end
151 + #set ($section.url = "?syntax=$escapetool.url(${crtSyntaxVer})&section=$escapetool.url(${section.id})${extraParams}")
152 + #end
153 + #end
154 +#end
48 48  
49 -(% style="width:100%" %)
50 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
51 -|Standard headings|(((
52 -1 level 1
53 -1.1 level 2
54 -1.1.1 level 3
55 -1.1.1.1 level 4
56 -1.1.1.1.1 level 5
57 -1.1.1.1.1.1 level 6
58 -)))|((({{{
59 -= level 1 =
60 -== level 2 ==
61 -=== level 3 ===
62 -==== level 4 ====
63 -===== level 5 =====
64 -====== level 6 ======
65 -}}})))|(((
66 -{{html}}
67 -<!-- Note: replace this with wiki syntax when http://jira.xwiki.org/jira/browse/XWIKI-4358 is implemented -->
68 -<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>
69 -{{/html}})))
70 -|Parametrized headings|<h1><span style="color:blue">heading</span></h1>|{{{(% style="color:blue" %)}}}\\= heading =|(((
71 -{{html}}
72 -<h1 id="Hheading" style="color:blue"><span>heading</span></h1>
73 -{{/html}})))
74 -|Headings with XWiki Syntax|1.1.1 Heading with *bold*|{{{=== Heading with **bold** ===}}}|(((=== Heading with **bold** ===)))
156 +#**
157 + * Displays the sections from a syntax category
158 + *
159 + * Expected format:
160 + * sections = vector of items
161 + * item = map with the following fields:
162 + * 'id' : mandatory
163 + * 'name' : the text displayed for the corresponding menu item;
164 + * optional, defaults to
165 + * $services.localization.render("$!{translationPrefix}${item.id}")
166 + *
167 + * @param $sections the sections list, in the format described above
168 + * @param $translationPrefix the translation prefix added to the id of each
169 + * item, in order to generate the name and description; ignored when
170 + * name or description are specified
171 + * @param $heading the heading syntax
172 + *#
173 +#macro(syntax_displayCategory $sections $translationPrefix $heading)
174 + #foreach ($section in $sections)
175 + #set ($displayVersion = $crtSyntaxVer)
176 + #if ($crtSyntaxVer > $section.maxSyntax)
177 + #set ($displayVersion = $section.maxSyntax)
178 + #end
179 + (% class="sectionheader" %)
180 + $heading $section.name $heading
75 75  
76 -= Text Formatting =
182 + {{include reference="XWiki.XWikiSyntax${section.id}" section="H${displayVersion}${section.id}"/}}
183 + #end
184 +#end
77 77  
78 -{{info}}
79 -New in XWiki Syntax 2.0 over XWiki Syntax 1.0:
80 -* Spaces are allowed just after the syntax symbols (for example in XWiki Syntax 1.0, this was not possible: * bold *).
81 -* 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.
82 -* Ability to span several lines (wasn't possible in XWiki Syntax 1.0).
83 -{{/info}}
84 84  
85 -(% style="width:100%" %)
86 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
87 -|Bold|{{{*bold*}}}|{{{**bold**}}}|**bold**
88 -|Underline|{{{__underline___}}}|{{{__underline__}}}|__underline__
89 -|Italics|{{{~~italic~~}}}|{{{//italic//}}}|//italic//
90 -|Striked out|{{{--strike--}}}|{{{--strike--}}}|--strike--
91 -|Monospace|<tt>monospace</tt>|{{{##monospace##}}}|##monospace##
92 -|Superscript|some <sup>superscript</sup>|{{{some ^^superscript^^}}}|some ^^superscript^^
93 -|Subscript|some <sub>subscript</sub>|{{{some ,,subscript,,}}}|some ,,subscript,,
187 +#**
188 + * Displays the syntax categories
189 + *
190 + * Expected format:
191 + * sections = vector of items
192 + * item = map with the following fields:
193 + * 'id' : mandatory
194 + * 'name' : the text displayed for the corresponding menu item;
195 + * optional, defaults to
196 + * $services.localization.render("$!{translationPrefix}${item.id}")
197 + *
198 + * @param $sections the sections list, in the format described above
199 + * @param $translationPrefix the translation prefix added to the id of each
200 + * item, in order to generate the name and description; ignored when
201 + * name or description are specified
202 + *#
203 +#macro(syntax_displayCategories $syntaxMenu $translationPrefix)
204 + #set ($subHeading = '====')
205 + #foreach ($category in $syntaxMenu)
206 + == $category.name ==
94 94  
95 -= Horizontal Line =
208 + #syntax_displayCategory($category.children 'syntax.' '===')
209 + #end
210 +#end
96 96  
97 -{{info}}There must be 4 or more dashes.{{/info}}
98 -
99 -{{info}}Note that this is different from Creole where exactly 4 dashes are required.{{/info}}
100 -
101 -(% style="width:100%" %)
102 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
103 -|Simple horizontal line|{{{----}}}|{{{----}}}|(((----)))
104 -|Parametrized horizontal line|<hr style="color:blue"/>|((({{{
105 -(% style="color:blue" %)
106 -----
107 -}}})))|(((
108 -(% style="color:blue" %)
109 -----
110 -)))
111 -
112 -= Lists =
113 -
114 -{{info}}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]].{{/info}}
115 -
116 -(% style="width:100%" %)
117 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
118 -|Bulleted list|((({{{
119 -* item 1
120 -** item 2
121 -*** item 3
122 -* item 4
123 -}}})))|((({{{
124 -* item 1
125 -** item 2
126 -*** item 3
127 -* item 4
128 -}}})))|(((
129 -* item 1
130 -** item 2
131 -*** item 3
132 -* item 4
133 -)))
134 -|Numbered list|((({{{
135 -1. item 1
136 -11. item 2
137 -111. item 3
138 -1. item 4
139 -}}})))|((({{{
140 -1. item 1
141 -11. item 2
142 -111. item 3
143 -1. item 4
144 -}}})))|(((
145 -1. item 1
146 -11. item 2
147 -111. item 3
148 -1. item 4
149 -)))
150 -|Mixed list|((({{{
151 -1. item 1
152 -1*. item 2
153 -1*. item 3
154 -1. item 4
155 -}}})))|((({{{
156 -1. item 1
157 -1*. item 2
158 -1*. item 3
159 -1. item 4
160 -}}})))|(((
161 -1. item 1
162 -1*. item 2
163 -1*. item 3
164 -1. item 4
165 -)))
166 -|Square list|((({{{
167 -- item 1
168 -- item 2
169 -}}})))|((({{{
170 -(% style="list-style-type: square" %)
171 -* item 1
172 -* item 2
173 -}}})))|(((
174 -(% style="list-style-type: square" %)
175 -* item 1
176 -* item 2
177 -)))
178 -|Disc list|(((
179 -<ul style="list-style-type: disc">
180 - <li>item 1</li>
181 - <li>item 2</li>
182 -</ul>
183 -)))|((({{{
184 -(% style="list-style-type: disc" %)
185 -* item 1
186 -* item 2
187 -}}})))|(((
188 -(% style="list-style-type: disc" %)
189 -* item 1
190 -* item 2
191 -)))
192 -|Lowercase Alphabetical list|((({{{
193 -a. item 1
194 -a. item 2
195 -}}})))|((({{{
196 -(% style="list-style-type: lower-alpha" %)
197 -* item 1
198 -* item 2
199 -}}})))|(((
200 -(% style="list-style-type: lower-alpha" %)
201 -* item 1
202 -* item 2
203 -)))
204 -|Uppercase Alphabetical list|((({{{
205 -A. item 1
206 -A. item 2
207 -}}})))|((({{{
208 -(% style="list-style-type: upper-alpha" %)
209 -* item 1
210 -* item 2
211 -}}})))|(((
212 -(% style="list-style-type: upper-alpha" %)
213 -* item 1
214 -* item 2
215 -)))
216 -|Lowercase Roman list|((({{{
217 -i. item 1
218 -i. item 2
219 -}}})))|((({{{
220 -(% style="list-style-type: lower-roman" %)
221 -* item 1
222 -* item 2
223 -}}})))|(((
224 -(% style="list-style-type: lower-roman" %)
225 -* item 1
226 -* item 2
227 -)))
228 -|Uppercase Roman list|((({{{
229 -I. item 1
230 -I. item 2
231 -}}})))|((({{{
232 -(% style="list-style-type: upper-roman" %)
233 -* item 1
234 -* item 2
235 -}}})))|(((
236 -(% style="list-style-type: upper-roman" %)
237 -* item 1
238 -* item 2
239 -)))
240 -|Lowercase Greek list|((({{{
241 -g. item 1
242 -g. item 2
243 -}}})))|((({{{
244 -(% style="list-style-type: lower-greek" %)
245 -* item 1
246 -* item 2
247 -}}})))|(((
248 -(% style="list-style-type: lower-greek" %)
249 -* item 1
250 -* item 2
251 -)))
252 -|Uppercase Greek list|((({{{
253 -G. item 1
254 -G. item 2
255 -}}})))|((({{{
256 -(% style="list-style-type: upper-greek" %)
257 -* item 1
258 -* item 2
259 -}}})))|(((
260 -(% style="list-style-type: upper-greek" %)
261 -* item 1
262 -* item 2
263 -)))
264 -|Hiragana list|((({{{
265 -h. item 1
266 -h. item 2
267 -}}})))|((({{{
268 -(% style="list-style-type: hiragana" %)
269 -* item 1
270 -* item 2
271 -}}})))|(((
272 -(% style="list-style-type: hiragana" %)
273 -* item 1
274 -* item 2
275 -)))
276 -|Hiragana Iroah list|((({{{
277 -H. item 1
278 -H. item 2
279 -}}})))|((({{{
280 -(% style="list-style-type: hiragana-iroha" %)
281 -* item 1
282 -* item 2
283 -}}})))|(((
284 -(% style="list-style-type: hiragana-iroha" %)
285 -* item 1
286 -* item 2
287 -)))
288 -|Katakana list|((({{{
289 -k. item 1
290 -k. item 2
291 -}}})))|((({{{
292 -(% style="list-style-type: katakana" %)
293 -* item 1
294 -* item 2
295 -}}})))|(((
296 -(% style="list-style-type: katakana" %)
297 -* item 1
298 -* item 2
299 -)))
300 -|Katakana Iroha list|((({{{
301 -K. item 1
302 -K. item 2
303 -}}})))|((({{{
304 -(% style="list-style-type: katakana-iroha" %)
305 -* item 1
306 -* item 2
307 -}}})))|(((
308 -(% style="list-style-type: katakana-iroha" %)
309 -* item 1
310 -* item 2
311 -)))
312 -|Armenian list|((({{{
313 -<ul style="list-style-type: armenian">
314 - <li>item 1</li>
315 - <li>item 2</li>
316 -</ul>
317 -}}})))|((({{{
318 -(% style="list-style-type: armenian" %)
319 -* item 1
320 -* item 2
321 -}}})))|(((
322 -(% style="list-style-type: armenian" %)
323 -* item 1
324 -* item 2
325 -)))
326 -|Hebrew list|((({{{
327 -j. item 1
328 -j. item 2
329 -}}})))|((({{{
330 -(% style="list-style-type: hebrew" %)
331 -* item 1
332 -* item 2
333 -}}})))|(((
334 -(% style="list-style-type: hebrew" %)
335 -* item 1
336 -* item 2
337 -)))
338 -|Georgian list|((({{{
339 -<ul style="list-style-type: georgian">
340 - <li>item 1</li>
341 - <li>item 2</li>
342 -</ul>
343 -}}})))|((({{{
344 -(% style="list-style-type: georgian" %)
345 -* item 1
346 -* item 2
347 -}}})))|(((
348 -(% style="list-style-type: georgian" %)
349 -* item 1
350 -* item 2
351 -)))
352 -|CJK ideographic list|((({{{
353 -<ul style="list-style-type: cjk-ideographic">
354 - <li>item 1</li>
355 - <li>item 2</li>
356 -</ul>
357 -}}})))|((({{{
358 -(% style="list-style-type: cjk-ideographic" %)
359 -* item 1
360 -* item 2
361 -}}})))|(((
362 -(% style="list-style-type: cjk-ideographic" %)
363 -* item 1
364 -* item 2
365 -)))
366 -
367 -= Definition Lists =
368 -
369 -(% style="width:100%" %)
370 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
371 -|Standard definition|((({{{
372 -<dl>
373 - <dt>term</dt>
374 - <dd>definition</dd>
375 -</dl>
376 -}}})))|((({{{
377 -; term
378 -: definition
379 -}}})))|(((
380 -; term
381 -: definition
382 -)))
383 -|Nested definitions|((({{{
384 -<dl>
385 - <dt>term 1</dt>
386 - <dd>definition 1
387 - <dl>
388 - <dt>term 2</dt>
389 - <dd>definition 2</dd>
390 - </dl>
391 - </dd>
392 -</dl>
393 -}}})))|((({{{
394 -; term 1
395 -: definition 1
396 -:; term 2
397 -:: definition 2
398 -}}})))|(((
399 -; term 1
400 -: definition 1
401 -:; term 2
402 -:: definition 2
403 -)))
404 -|Parametrized definition|((({{{
405 -<dl style="color:blue">
406 - <dt>term</dt>
407 - <dd>definition</dd>
408 -</dl>
409 -}}})))|((({{{
410 -(% style="color:blue" %)
411 -; term
412 -: definition
413 -}}})))|(((
414 -(% style="color:blue" %)
415 -; term
416 -: definition
417 -)))
418 -
419 -= New Line/Line breaks =
420 -
421 -A new line is a carriage return. A line break is a forced new line that can appear anywhere in the text.
422 -
423 -{{info}}
424 -In XWiki Syntax 2.0 new lines are honored which is not the case in XWiki Syntax 1.0 and in Creole Syntax.
425 -{{/info}}
426 -
427 -(% style="width:100%" %)
428 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
429 -|Line break|{{{Line\\New line}}}|{{{Line\\New line}}}|Line\\New line|Line\\New line
430 -|New line|Line\\New line|Line\\New line|Line New line|Line\\New line
431 -
432 -= Links =
433 -
434 -(% style="width:100%;table-layout:fixed;overflow:hidden;word-wrap:break-word" %)
435 -|=(% 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
436 -|Link to a page in the current Space|{{{[WebHome]}}}|{{{[[WebHome]]}}}|[[Web Home>>WebHome]]|[[WebHome]]
437 -|Link with a label|{{{[label>WebHome]}}}|(((
438 -{{{[[label>>WebHome]]}}}
439 -{{info}}XWiki Syntax is supported inside link labels.{{/info}}
440 -)))|[[label>>WebHome]]|[[label>>WebHome]]
441 -|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]]
442 -|Link to a page with the space specified|{{{[Main.WebHome]}}}|{{{[[Main.WebHome]]}}}|[[Web Home>>Main.WebHome]]|[[Main.WebHome]]
443 -|Link to a subwiki|{{{[subwiki:Main.WebHome]}}}|{{{[[subwiki:Main.WebHome]]}}}|[[Web Home>>xwiki:Main.WebHome]]|[[xwiki:Main.WebHome]]
444 -|Link that opens in a new window|{{{[label>WebHome>_blank]}}}|{{{[[label>>WebHome||rel="__blank"]]}}}|[[label>>WebHome||rel="__blank"]]|[[label>>WebHome||rel="__blank"]]
445 -|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
446 -|Link to a URL|{{{[http://xwiki.org]}}}|{{{[[http://xwiki.org]]}}}|[[http://xwiki.org]]|[[http://xwiki.org]]
447 -|Link to a URL with a label|{{{[XWiki>http://xwiki.org]}}}|{{{[[XWiki>>http://xwiki.org]]}}}|[[XWiki>>http://xwiki.org]]|[[XWiki>>http://xwiki.org]]
448 -|Link to an email address|{{{[john@smith.net>mailto:john@smith.net]}}}|{{{[[john@smith.net>>mailto:john@smith.net]]}}}|[[john@smith.net>>mailto:john@smith.net]]|[[john@smith.net>>mailto:john@smith.net]]
449 -|Image Link|{{{<a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2}</a>}}}|{{{[[image:Space2.Page2@img.png>>Space1.Page1]]}}}|[[image:img.png>>Main.WebHome]]|[[image:img.png>>Main.WebHome]]
450 -|Image Link with image parameters|{{{<a href="$xwiki.getURL("Space1.Page1")">{image:img.png|document=Space2.Page2|width=26|height=26}</a>}}}|{{{[[[[image:Space2.Page2@img.png||width="26" height="26"]]>>Space1.Page1]]}}}|[[[[image:img.png||width="26" height="26"]]>>Main.WebHome]]|[[[[image:img.png||width="26" height="26"]]>>Main.WebHome]]
451 -|Link to an attachment on the current page|(((
452 -{{info}}See [[Attach Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Attach+Macro+%28Radeox%29]] for details{{/info}}
453 -{{{{attach:text|file=img.png}}}}
454 -)))|{{{[[text>>attach:img.png]]}}}|[[text>>attach:img.png]]|[[text>>attach:img.png]]
455 -|Link to an attachment in a different page|(((
456 -{{info}}See [[Attach Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Attach+Macro+%28Radeox%29]] for details{{/info}}
457 -{{{{attach:text|document=Space.Page|file=img.png}}}}
458 -)))|{{{[[text>>attach:Space.Page@img.png]]}}}|[[text>>attach:XWiki.XWikiSyntax@img.png]]|[[text>>attach:XWiki.XWikiSyntax@img.png]]
459 -|Link to an Anchor in a page|{{{[label>Space.Page#anchor]}}}|{{{[[label>>Space.Page#anchor]]}}}|[[label>>XWiki.XWikiSyntax#HLinks]]|[[label>>XWiki.XWikiSyntax#HLinks]]
460 -|Link to a Heading in a page|(((
461 -{{info}}When you add a Heading, an anchor named "H" followed by the heading title with only alpha characters is created. For example, for a Heading named "My heading", the generated anchor will be "HMyheading".{{/info}}
462 -{{{[label>Space.Page#HMyheading]}}}
463 -)))|{{{[[label>>Space.Page#HMyheading]]}}}|[[label>>XWiki.XWikiSyntax#HLinks]]|[[label>>XWiki.XWikiSyntax#HLinks]]
464 -
465 -== XWiki Syntax 1.0 Link Specification ==
466 -
467 -{{info}}
468 -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.
469 -{{/info}}
470 -
471 -The full format of a link is **##[label {> or |}] (resource) [@interWikiAlias] [{> or |} target]##**
472 -
473 -* **##label##**: An optional string which will be displayed to the user as the link name when rendered. Example: ##My Page##
474 -* **##resource##**: The full link reference using the following syntax: **##(reference) [?queryString] [#anchor]##**
475 -** **##reference##**: The link reference. This can be either
476 -*** **A URI** in the form **##protocol:path##** (examples: ##http:~/~/xwiki.org##, ##mailto~:john@smith.com##), or
477 -*** **A wiki page** reference in the form **##~[~[wikiName:] space.] (page)##**. Examples: ##WebHome##, ##Main.WebHome##, ##mywiki:Main.WebHome##
478 -**** **##wikiName##**: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: ##mywiki##
479 -**** **##space##**: An optional wiki Space name. If no space is specified the current space is used. Example: ##Main##
480 -**** **##page##**: A required string containing the name of the linked wiki page. Example: ##WebHome##
481 -** **##queryString##**: An optional query string for specifying parameters that will be used in the rendered URL. Example: ##mydata1=5&mydata2=Hello##
482 -** **##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##
483 -* **##interWikiAlias##**: An optional [[Inter Wiki>>http://en.wikipedia.org/wiki/InterWiki]] alias as defined in the InterWiki Map (see the [[Admin Guide>>http://platform.xwiki.org/xwiki/bin/view/AdminGuide/]]). This is only valid for wiki page names. Example: ##wikipedia##
484 -* **##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##
485 -
486 -== XWiki Syntax 2.0 Link Specification ==
487 -
488 -{{info}}
489 -The part in ##( )## is required, while the parts in ##[ ]## are optional.
490 -{{/info}}
491 -
492 -The full format of a link is **##[label>>] (resource) [@interWikiAlias] [||parameters]##**
493 -
494 -* **##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>>http://platform.xwiki.org/xwiki/bin/view/AdminGuide/]]. Example: ##My Page##
495 -* **##resource##**: The full link reference using the following syntax: **##(reference) [?queryString] [#anchor]##**
496 -** **##reference##**: The link reference in one of the following forms:
497 -*** **URL**: Any URL in the form of **##protocol:~/~/path##**. Examples: ##http:~/~/xwiki.org##, ##https:~/~/svn.xwiki.org/##
498 -*** **Wiki page name** reference in the form **##~[~[wikiName:] space.] (page)##**. Examples: ##WebHome##, ##Main.WebHome##, ##mywiki:Main.WebHome##
499 -**** **##wikiName##**: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: ##mywiki##
500 -**** **##space##**: An optional wiki Space name. If no space is specified the current space is used. Example: ##Main##
501 -**** **##page##**: A required string containing the name of the linked wiki page. Example: ##WebHome##
502 -*** **Attachment** reference in the form **##attach~: [wikiPageName@] (attachmentName)##**. Examples: ##attach~:img.png##, ##attach~:mywiki:Main.WebHome@img.png##
503 -**** **##attach~:##**: A required string identifying the resource as attachment.
504 -**** **##wikiPageName##**: An optional string referencing the document that holds the attachment, see "Wiki page name" above.
505 -**** **##attachmentName##**: Name of the attachment as it is stored in the wiki.
506 -*** **Email address** in the form **##mailto~: (emailAddress)##** (###anchor## is not valid). Example: ##mailto~:john@smith.com##
507 -**** **##mailto~:##**: A required string identifying the resource as email.
508 -**** **##emailAddress##**: Targeted email address. Example: "##john@smith.com##"
509 -** **##queryString##**: An optional query string for specifying parameters that will be used in the rendered URL. Example: ##mydata1=5&mydata2=Hello##
510 -** **##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##
511 -* **##interWikiAlias##**: An optional [[Inter Wiki>>http://en.wikipedia.org/wiki/InterWiki]] alias as defined in the InterWiki Map (see the [[Admin Guide>>http://platform.xwiki.org/xwiki/bin/view/AdminGuide/]]). This is only valid for wiki page names. Example: ##wikipedia##
512 -* **##parameters##**: An optional list of parameters passed to the link. Example: ##rel="~_~_blank"## (open in new window)
513 -
514 -== XWiki Syntax 2.1 Link Specification ==
515 -
516 -{{info}}
517 -The part in ##( )## is required, while the parts in ##[ ]## are optional.
518 -{{/info}}
519 -
520 -The full format of a link is **##[label>>] (resource) [||parameters]##**
521 -
522 -* **##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>>http://platform.xwiki.org/xwiki/bin/view/AdminGuide/]]. Example: ##My Page##
523 -* **##resource##**: A required string with the link reference in one of the following forms
524 -** **URL**: Any URL in the form of **##[url:] (protocol:~/~/path)##**. Examples: ##http:~/~/xwiki.org##, ##url:https:~/~/svn.xwiki.org/##
525 -*** **##url:##** An optional string identifying the resource as an URL.
526 -** **Wiki page name** reference in the form **##[doc:] ~[~[wikiName:] space.] (page)##**. Examples: ##WebHome##, ##Main.WebHome##, ##mywiki:Main.WebHome##
527 -*** **##doc:##** An optional string identifying the resource as an XWiki document.
528 -*** **##wikiName##**: An optional string containing the name of a virtual wiki. The link will point to a page inside that virtual wiki. Example: ##mywiki##
529 -*** **##space##**: An optional wiki Space name. If no space is specified the current space is used. Example: ##Main##
530 -*** **##page##**: A required string containing the name of the linked wiki page. Example: ##WebHome##
531 -** **InterWiki page name** reference in the form **##interwiki: {{{(interWikiAlias:)}}} (page)##**. Example: ##interwiki:wikipedia:XWiki##
532 -*** **##interwiki:##** A required string identifying the resource as an InterWiki link.
533 -*** **##interWikiAlias##**: An optional [[Inter Wiki>>http://en.wikipedia.org/wiki/InterWiki]] alias as defined in the InterWiki Map (see the [[Admin Guide>>http://platform.xwiki.org/xwiki/bin/view/AdminGuide/]]). Example: ##wikipedia##
534 -*** **##page##**: A required string containing the name of the linked page. Example: ##XWiki##
535 -** **Attachment** reference in the form **##attach~: [wikiPageName@] (attachmentName)##**. Examples: ##attach~:img.png##, ##attach~:mywiki:Main.WebHome@img.png##
536 -*** **##attach~:##**: A required string identifying the resource as attachment.
537 -*** **##wikiPageName##**: An optional string referencing the document that holds the attachment, see "Wiki page name" above.
538 -*** **##attachmentName##**: Name of the attachment as it is stored in the wiki.
539 -** **Email address** in the form **##mailto~: (emailAddress)##** (###anchor## is not valid). Example: ##mailto~:john@smith.com##
540 -*** **##mailto~:##**: A required string identifying the resource as email.
541 -*** **##emailAddress##**: Targeted email address. Example: ##john@smith.com##
542 -** **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')##.
543 -*** **##path:##** A required string identifying the resource as a relative path.
544 -*** **##relPath##**: A required string containing the relative path of the resource on the server that shall be linked.
545 -** **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##
546 -*** **##unc:##** A required string identifying the resource as a UNC (Windows Explorer) path.
547 -*** **##path##**: A required string containing the local path of resource accessible by the user. Examples: ##C:\Windows\##, ##~\~\myserver\path\img.png##, ##home/user/somefile##
548 -* **##parameters##**: An optional list of space-separated parameters passed to the link. Example: ##queryString="mydata1=5&mydata2=Hello" anchor="HTableOfContents" rel="~_~_blank"##
549 -** **##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##
550 -** **##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##
551 -** **##rel##**: An optional parameter that allows to open link target in new window. Example: ##rel="~_~_blank"##
552 -
553 -= Tables =
554 -
555 -Allows to easily create content in table format. Parameters for table, row or cell are also supported in XWiki Syntax 2.0.
556 -
557 -(% style="width:100%" %)
558 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
559 -|Standard table|((({{{
560 -{table}
561 -Title 1 | Title 2
562 -Word 1 | Word 2
563 -{table}
564 -}}})))|((({{{
565 -|=Title 1|=Title 2
566 -|Word 1|Word 2
567 -}}}))) or ((({{{
568 -!=Title 1!=Title 2
569 -!!Word 1!!Word 2
570 -}}})))|(((
571 -|=Title 1|=Title 2
572 -|Word 1|Word 2
573 -)))
574 -|Parametrized table|(((
575 -<table style="background-color:red;align:center">
576 - <tbody>
577 - <tr>
578 - <td>Title 1</td>
579 - <td style="background-color:yellow">Title 2</td>
580 - </tr>
581 - <tr>
582 - <td>Word 1</td>
583 - <td>Word 2</td>
584 - </tr>
585 - </tbody>
586 -</table>
587 -)))|((({{{
588 -(% style="background-color:red;align=center" %)
589 -|=Title 1|=(% style="background-color:yellow" %)Title 2
590 -|Word 1|Word 2
591 -}}})))|(((
592 -(% style="background-color:red;align=center" %)
593 -|=Title 1|=(% style="background-color:yellow" %)Title 2
594 -|Word 1|Word 2
595 -)))
596 -|Filterable Sortable table|((({{{
597 -$xwiki.ssfx.use("js/xwiki/table/table.css")
598 -$xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
599 -<table id="tableid" class="grid sortable filterable doOddEven">
600 - <tr class="sortHeader">
601 - <th>Title 1</th>
602 - <th>Title 2</th>
603 - </tr>
604 - <tr>
605 - <td>Cell 11</td>
606 - <td>Cell 12</td>
607 - </tr>
608 - <tr>
609 - <td>Cell 21</td>
610 - <td>Cell 22</td>
611 - </tr>
612 -</table>
613 -}}}
614 -
615 -{{info}}For improved features see the [[Livetable Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro]].{{/info}}
616 -)))|((({{{
617 -{{velocity}}
618 -$xwiki.ssfx.use("js/xwiki/table/table.css")
619 -$xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
212 +#**
213 + * Displays the drop down allowing to switch the syntax.
214 + *#
215 +#macro (syntaxSwitch)
216 + #set ($crtSelection = "")
217 + #if ("$!{crtCategoryId}" != '')
218 + #set ($crtSelection = "category=$escapetool.url($!{crtCategoryId})")
219 + #elseif ($crtSectionId != '')
220 + #set ($crtSelection = "section=$escapetool.url($!{crtSectionId})")
221 + #end
222 + #if ($crtSelection != "")
223 + #set ($crtSelection = "${crtSelection}${extraParams}")
224 + #else
225 + #set ($crtSelection = "$extraParams")
226 + #end
227 +{{html}}
228 + <form id="change-context" class="xformInline" action="">
229 + <div>
230 + <input type="hidden" name="xaction" value="switchContext" />
231 + #if ($request.language)
232 + <input type="hidden" name="language" value="$escapetool.xml($request.language)" />
233 + #end
234 + #if ($request.xpage)
235 + <input type="hidden" name="xpage" value="$escapetool.xml($request.xpage)" />
236 + #end
237 + <select id="goto-select" name="target" title="$escapetool.xml($services.localization.render("help.changesyntax"))">
238 + <optgroup label="$services.localization.render('help.choose_syntax')">
239 + #set ($query = "syntax=1.0&${crtSelection}")
240 + <option value="$doc.getURL('view', $query)" #if($crtSyntaxVer==1.0)selected="selected"#end>$SUPPORTED_SYNTAXES.get(1.0)</option>
241 + #set ($query = "syntax=2.0&${crtSelection}")
242 + <option value="$doc.getURL('view', $query)" #if($crtSyntaxVer==2.0)selected="selected"#end>$SUPPORTED_SYNTAXES.get(2.0)</option>
243 + #set ($query = "syntax=2.1&${crtSelection}")
244 + <option value="$doc.getURL('view', $query)" #if($crtSyntaxVer==2.1)selected="selected"#end>$SUPPORTED_SYNTAXES.get(2.1)</option>
245 + </optgroup>
246 + </select>
247 + <span class="buttonwrapper"><input type="submit" value="$escapetool.xml($services.localization.render('admin.switchContext'))" class="button" /></span>
248 + </div>
249 + </form>
250 +{{/html}}
251 +#end
620 620  {{/velocity}}
621 621  
622 -(% class="grid sortable filterable doOddEven" id="tableid" %)
623 -(% class="sortHeader" %)|=Title 1|=Title 2
624 -|Cell 11|Cell 12
625 -|Cell 21|Cell 22
626 -}}}
627 -
628 -{{info}}For improved features see the [[Livetable Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro]].{{/info}}
629 -)))|(((
630 630  {{velocity}}
631 -$xwiki.ssfx.use("js/xwiki/table/table.css")
632 -$xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true)
633 -{{/velocity}}
634 -
635 -(% class="grid sortable filterable doOddEven" id="tableid" %)
636 -(% class="sortHeader" %)|=Title 1|=Title 2
637 -|Cell 11|Cell 12
638 -|Cell 21|Cell 22
255 +##**************************************************************************************************
256 +## From the Administration Sheet, used to display a common UI for some wiki features
257 +## here used to display all categories / sections of the syntax guide
258 +##**************************************************************************************************
259 +$xwiki.get('jsx').use($doc.getFullName())##
260 +$xwiki.get('ssx').use($doc.getFullName())##
261 +#if ($crtSectionId != '')
262 + #set ($sectionName = ${crtSection.name})
263 +#elseif ($crtCategoryId != '')
264 + #set ($sectionName = ${crtCategory.name})
265 +#else
266 + #set ($sectionName = $services.localization.render("help.syntaxall"))
267 +#end
268 +#set ($syntaxTitle = $services.localization.render("help.syntaxtitle", ["${crtSyntaxVer}"]))
269 +#syntaxSwitch()
270 +(((
271 +#set ($query = "syntax=$escapetool.url(${crtSyntaxVer})${extraParams}")
272 +#if ($crtCategory){{html}}<a href="${doc.getURL('view', ${query})}">$syntaxTitle</a>{{/html}}#{else}(% class="current" %)$syntaxTitle#{end}#if ($crtCategory) (% class="separator" %)» #if ($crtSection){{html}}<a href="${crtCategory.url}">${crtCategory.name}</a>{{/html}}#{else}(% class="current" %)${crtCategory.name}#{end}#if ($crtSection) (% class="separator" %)» (% class="current" %)${crtSection.name}#end#end
639 639  )))
274 +== $syntaxTitle: $sectionName ==
640 640  
641 -= Images =
642 -
643 -(% style="width:100%" %)
644 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
645 -|Image from attachment on current page|(((
646 -{{info}}See [[Image Macro>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Image+Macro+%28Radeox%29]] for details{{/info}}
647 -{{{{image:img.png}}}}
648 -)))|{{{image:img.png}}}|image:img.png
649 -|Image from attachment on another page|{{{{image:img.png|document=Space.Page}}}}|{{{image:Space.Page@img.png}}}|image:img.png
650 -|Image with parameters|{{{{image:img.png|width=25|height=25}}}}|{{{[[image:img.png||width="25" height="25"]]}}}|[[image:img.png||width="25" height="25"]]
651 -|Images located at URL|{{{http://some/url/img.png}}}|{{{image:http://some/url/img.png}}}|image:img.png
652 -
653 -== XWiki Syntax 2.0 Image Specification ==
654 -
655 -{{info}}
656 -The part in ##( )## is required, while the parts in ##{ }## are optional.
657 -{{/info}}
658 -
659 -The full format of an image is either **##image~: (reference)##** or **##~[~[image~: (reference) {||parameters}]]##**
660 -
661 -* **##image~:##** A required string identifying the resource as image.
662 -* **##reference##**: The reference to the image that shall be displayed in one of the following forms:
663 -** **URL**: Any URL to an image in the form of **##http:~/~/path/imageName##**. Example: ##http:~/~/domain.org/path/img.png##
664 -** **Attachment** reference in the form **##~{~{~{wikiName:} space.} page@} (imageName)##**
665 -*** **##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
666 -*** **##space##**: An optional wiki Space name. If no space is specified the current space is used. Example: Main
667 -*** **##page##**: An optional string containing the name of the wiki page to which the referenced image is attached. Example: WebHome
668 -*** **##imageName##**: A required string containing the name of the image attached to a page as it is stored in the wiki.
669 -* **##parameters##**: An optional list of space-separated parameters passed to the image. Example: ##width="800" height="600" alt="img.png" title="My nice image"##
670 -** **HTML attributes**: All attributes defined by the HTML standard will be added to the rendered HTML ##<img>## tag.
671 -*** **##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)
672 -*** **##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%"##).
673 -*** **##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%"##).
674 -*** **##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"##
675 -*** **##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"##
676 -*** **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]].
677 -
678 -== XWiki Syntax 2.1 Image Specification ==
679 -
680 -{{info}}
681 -The part in ##( )## is required, while the parts in ##{ }## are optional.
682 -{{/info}}
683 -
684 -The full format of an image is either **##image~: (reference)##** or **##~[~[image~: (reference) {||parameters}]]##**
685 -
686 -* **##image~:##** A required string identifying the resource as image.
687 -* **##reference##**: The reference to the image that shall be displayed in one of the following forms:
688 -** **URL**: Any URL to an image in the form of **##protocol:~/~/path/imageName##**. Example: ##http:~/~/domain.org/path/img.png##
689 -** **Attachment** reference in the form **##~{~{~{wikiName:} space.} page@} (imageName)##**
690 -*** **##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
691 -*** **##space##**: An optional wiki Space name. If no space is specified the current space is used. Example: Main
692 -*** **##page##**: An optional string containing the name of the wiki page to which the referenced image is attached. Example: WebHome
693 -*** **##imageName##**: A required string containing the name of the image attached to a page as it is stored in the wiki.
694 -** **Icon** reference in the form **##{{{(icon:)}}} (iconName)##**. Example: **##icon:accept##**
695 -*** **##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]].
696 -*** **##iconName##**: A required string identifying the icon referenced. Example: ##accept##
697 -* **##parameters##**: An optional list of space-separated parameters passed to the image. Example: ##width="800" height="600" alt="img.png" title="My nice image"##
698 -** **HTML attributes**: All attributes defined by the HTML standard will be added to the rendered HTML ##<img>## tag.
699 -*** **##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)
700 -*** **##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%"##).
701 -*** **##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%"##).
702 -*** **##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"##
703 -*** **##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"##
704 -*** **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]].
705 -** **##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##!**)
706 -
707 -= Verbatim =
708 -
709 -Allow to enter content that will not be formatted (in other words the XWiki Syntax will not be taken into account).
710 -
711 -{{info}}
712 -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.
713 -{{/info}}
714 -
715 -(% style="width:100%" %)
716 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
717 -|Verbatim inline|{{{Some verbatim {pre}*[not rendered]*{/pre} content}}}|{{{Some verbatim {{{**[[not rendered]]**}}} content}}}|Some verbatim {{{*[not rendered]*}}} content|Some verbatim {{{**[[not rendered]]**}}} content
718 -|Verbatim block|((({{{
719 -{pre}
720 -multi line
721 -*verbatim*
722 -content
723 -{/pre}
724 -}}}
725 -{{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}}
726 -)))|((({{{
727 -{{{
728 -multi line
729 -**verbatim**
730 -content
731 -}}}
732 -}}})))|((({{{
733 -multi line
734 -*verbatim*
735 -content
736 -}}})))|((({{{
737 -multi line
738 -**verbatim**
739 -content
740 -}}})))
741 -
742 -= Quotations =
743 -
744 -Allows to quote some text.
745 -
746 -(% style="width:100%" %)
747 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
748 -|Simple quote|(((
749 -<blockquote><p>john said this</p></blockquote>
750 -I said ok
751 -)))|((({{{
752 -> john said this
753 -I said ok
754 -}}})))|(((
755 -> john said this
756 -I said ok
757 -)))
758 -|Nested quotes|(((
759 -<blockquote><p>john said this</p>
760 - <blockquote><p>marie answered that</p></blockquote>
761 -</blockquote>
762 -I said ok
763 -)))|((({{{
764 -> john said this
765 ->> marie answered that
766 -I said ok
767 -}}})))|(((
768 -> john said this
769 ->> marie answered that
770 -I said ok
771 -)))
772 -
773 -= Groups =
774 -
775 -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.
776 -
777 -(% style="width:100%" %)
778 -|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
779 -|{{info}}This feature doesn't exist in XWiki Syntax 1.0. You'd have to use pure HTML to achieve the result.{{/info}}|((({{{
780 -|=Header 1|=Header 2|=Header 3
781 -|Cell One|(((
782 -= Embedded document =
783 -
784 -Some embedded paragraph.
785 -
786 -* list item one
787 -* list item two
788 - ** sub-item 1
789 - ** sub-item 2
790 -))) | Cell Three
791 -
792 -Next paragraph in the top-level document
793 -}}})))|(((
794 -|=Header 1|=Header 2|=Header 3
795 -|Cell One|(((
796 -{{html}}<h1 id="HEmbeddeddocument"><span>Embedded document</span></h1>{{/html}}
797 -
798 -Some embedded paragraph.
799 -
800 -* list item one
801 -* list item two
802 - ** sub-item 1
803 - ** sub-item 2
804 -))) | Cell Three
805 -
806 -Next paragraph in the top-level document
807 -)))
808 -
809 -= Escapes =
810 -
811 -Allows to escape XWiki Syntax.
812 -
813 -(% style="width:100%" %)
814 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result XWiki Syntax 1.0|=Result XWiki Syntax 2.0
815 -|Escape a character|{{{This is not a \[link\]}}}|(((
816 -{{{This is not a ~[~[link~]~]}}}
817 -{{info}}To enter a ~~ character use a double escape: ~~~~{{/info}}
818 -)))|{{{This is not a [link]}}}|{{{This is not a [[link]]}}}
819 -
820 -= Macros =
821 -
822 -There are 2 kinds of macros in XWiki Syntax 1.0:
823 -* Velocity macros (called using the ###macroname(param1 ... paramN)## syntax)
824 -* Radeox macros (called using the ##{macroname:param1=value1|...|paramN=valueN}## syntax)
825 -
826 -There are also 2 kinds of macros in XWiki Syntax 2.0:
827 -* Velocity macros (called using the ###macroname(param1 ... paramN)## syntax inside the Velocity Macro)
828 -* XWiki macros (called using the ##{{{{{macroname param1="value1" ... paramN="valueN"}}}}}## syntax)
829 -
830 -{{info}}The Radeox macros cannot be used in XWiki Syntax 2.0. Thus they have been rewritten as XWiki macros.{{/info}}
831 -
832 -{{info}}For the full list of available macros check the [[Extensions wiki>>http://extensions.xwiki.org/]].{{/info}}
833 -
834 -(% style="width:100%" %)
835 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0
836 -|Velocity Macro|((({{{#info("Some text")}}})))|((({{{
837 -{{info}}
838 -Some text
839 -{{/info}}
840 -}}})))
841 -|Radeox Macro/XWiki Macro|((({{{
842 -{code:java}
843 -java content
844 -{code}
845 -}}})))|((({{{
846 -{{code language="java"}}
847 -java content
848 -{{/code}}
849 -}}})))
850 -
851 -= HTML =
852 -
853 -{{info}}In XWiki Syntax 2.0 HTML or XHTML must be entered by using the HTML macro whereas in XWiki Syntax 1.0 it's possible to enter HTML directly in the text.{{/info}}
854 -
855 -(% style="width:100%" %)
856 -|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Result
857 -|<b>bold</b>|{{{{{html}}<b>bold</b>{{/html}}}}}|{{html}}<b>bold</b>{{/html}}
858 -
859 -{{info}}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"}}}}}.{{/info}}
860 -
861 -= Velocity/Groovy Scripts =
862 -
863 -{{info}}In XWiki Syntax 1.0 it was possible to enter Velocity scripts anywhere directly in the page. This lead to issues for example when the user was involuntarily entering Velocity content. It was also performance hungry for pages not requiring Velocity content. There were several other technical limitations. Thus in XWiki Syntax 2.0 Velocity scripts must be entered using the ##velocity## macro. Same goes for entering Groovy scripts.{{/info}}
864 -
865 -(% style="width:100%" %)
866 -|=Feature|=XWiki Syntax 1.0|=XWiki Syntax 2.0
867 -|Velocity script|((({{{
868 -#set ($var = "whatever")
869 -}}})))|((({{{
870 -{{velocity}}
871 -#set ($var = "whatever")
276 +#verticalNavigation($syntaxMenu {'translationPrefix' : 'syntax.', 'crtItemId' : "$!crtItemId", 'cssClass' : 'syntax-menu'})
277 +##-----------------------------------------
278 +## syntax-page display
279 +##-----------------------------------------
280 + (% id="syntax-page-content" %)(((
281 + #if(!$crtSection && !$crtCategory)
282 + #syntax_displayCategories($syntaxMenu 'syntax.')
283 + #elseif (!$crtSection)
284 + #set ($subHeading = '===')
285 + #syntax_displayCategory($crtCategory.children 'syntax.' '==')
286 + #else
287 + #set ($displayVersion = $crtSyntaxVer)
288 + #if ($crtSyntaxVer > $crtSection.maxSyntax)
289 + #set ($displayVersion = $crtSection.maxSyntax)
290 + #end
291 + #set ($subHeading = '==')
292 + {{include reference="XWiki.XWikiSyntax${crtSection.id}" section="H${displayVersion}${crtSection.id}"/}}
293 + #end
294 + ))) ## syntax-page-content
872 872  {{/velocity}}
873 -}}})))
874 -|Groovy script|((({{{
875 -<%
876 -def var = "whatever"
877 -%>
878 -}}})))|((({{{
879 -{{groovy}}
880 -def var = "whatever"
881 -{{/groovy}}
882 -}}})))
883 -
884 -= Parameters =
885 -
886 -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.
887 -
888 -(% style="width:100%" %)
889 -|=XWiki Syntax 1.0|=XWiki Syntax 2.0|=Generated XHTML
890 -|((({{{
891 -<h1 class="myClass" style="myStyle" id="myId">heading</h1>
892 -}}})))|((({{{
893 -(% class="myClass" style="myStyle" id="myId" %)
894 -= heading =
895 -}}})))|((({{{
896 -<h1 class="myClass" style="myStyle" id="myId">heading</h1>
897 -}}})))
898 -
899 -{{id name="syntaxes"/}}
900 -= Other syntaxes =
901 -
902 -The following other syntaxes are implemented in XWiki Enterprise 1.6 and later:
903 -* [[JSPWiki>>http://www.jspwiki.org/wiki/TextFormattingRules]]
904 -* [[MediaWiki>>http://en.wikipedia.org/wiki/Help:Editing]]
905 -* [[Confluence>>http://confluence.atlassian.com/display/CONF20/Confluence+Notation+Guide+Overview]]
906 -* [[TWiki>>http://twiki.org/cgi-bin/view/TWiki/WikiSyntax]]
907 -* [[Creole 1.0>>http://www.wikicreole.org/wiki/Creole1.0]]
908 -* [[XHTML 1.0>>http://www.w3.org/TR/xhtml1/]]
909 -
910 -{{warning}}The implementation for these syntaxes is not fully finished yet. For example support for links is not working perfectly yet. We also need to define if we want to extend the original syntaxes to support XWiki-specific features like ability to link to another sub-wiki.{{/warning}}
img.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.VincentMassol
Size
... ... @@ -1,1 +1,0 @@
1 -959 bytes
Content
XWiki.StyleSheetExtension[0]
Code
... ... @@ -1,3 +1,45 @@
1 +#document-title {
2 + margin-bottom: 1em;
3 +}
4 +#change-context {
5 + float: right;
6 + padding-top: 0.5em;
7 +}
8 +#goto-select optgroup {
9 + margin: 0.5ex;
10 +}
11 +
12 +#syntax-page-content {
13 + margin-left: 15em;
14 +}
15 +#syntax-page-content table {
16 + width: 99%;
17 +}
18 +#syntax-page-content>h3 {
19 + display: none;
20 +}
21 +#syntax-page-content>h3.sectionheader {
22 + display: block;
23 +}
24 +
25 +/*******************************************************/
26 +
27 +.syntax-menu .generalIcon {
28 + background-image: url("$xwiki.getSkinFile('icons/silk/page_white_code.gif')");
29 +}
30 +
31 +.syntax-menu .editingIcon {
32 + background-image: url("$xwiki.getSkinFile('icons/silk/page_white_edit.gif')");
33 +}
34 +
35 +.syntax-menu .advancedIcon {
36 + background-image: url("$xwiki.getSkinFile('icons/silk/wand.gif')");
37 +}
38 +
39 +.syntax-menu .programmingIcon {
40 + background-image: url("$xwiki.getSkinFile('icons/silk/page_white_gear.gif')");
41 +}
42 +
1 1  /* Firefox panics when it has an overflowing table but the content is pre-formatted. */
2 2  tbody>tr>td>tt {
3 3   white-space: normal !important;
Name
... ... @@ -1,1 +1,1 @@
1 -FF_table_fix
1 +Syntax Guide Stylesheet
Parse content
... ... @@ -1,0 +1,1 @@
1 +Yes
XWiki.JavaScriptExtension[0]
Caching policy
... ... @@ -1,0 +1,1 @@
1 +long
Code
... ... @@ -1,0 +1,14 @@
1 +/* Administration application custom JavaScript */
2 +
3 +document.observe('xwiki:dom:loaded', function() {
4 + if($('goto-select')) {
5 + Event.observe($('goto-select'), 'change', function (event) {
6 + var select = event.element();
7 + var i = select.selectedIndex;
8 + if (window.location != select.options[i].value) {
9 + window.location = select.options[i].value;
10 + }
11 + });
12 + $('goto-select').next().hide();
13 + }
14 +});
Name
... ... @@ -1,0 +1,1 @@
1 +Syntax Guide javascript
Parse content
... ... @@ -1,0 +1,1 @@
1 +No
Use this extension
... ... @@ -1,0 +1,1 @@
1 +onDemand

Get Connected