Changes for page XWiki Syntax Guide

Last modified by Ludovic Dubost on 2020/07/30 11:21

From version 10.1
edited by Ludovic Dubost
on 2020/07/30 11:21
Change comment: Install extension [org.xwiki.platform:xwiki-platform-help-ui/12.3]
To version 6.1
edited by Ludovic Dubost
on 2015/11/28 14:59
Change comment: Install extension [org.xwiki.platform:xwiki-platform-help-ui-7.3]

Summary

Details

Page properties
Content
... ... @@ -9,10 +9,12 @@
9 9  #set($SUPPORTED_SYNTAX_ORDER = ['1.0', '2.0', '2.1'])
10 10  ##
11 11  ## filter all syntaxes that are not installed/configured
12 -#set($configuredSyntaxes = $services.rendering.getConfiguredSyntaxes())
12 +#set($configuredSyntaxIds = $xwiki.getConfiguredSyntaxes())
13 13  #set($enabledSyntaxIds = [])
14 -#foreach($syntax in $configuredSyntaxes)
15 - #set($discard = $enabledSyntaxIds.add($syntax.toIdString()))
14 +#foreach($syntax in $services.rendering.getAvailableParserSyntaxes())
15 + #if($configuredSyntaxIds.contains($syntax.toIdString()))
16 + #set($discard = $enabledSyntaxIds.add($syntax.toIdString()))
17 + #end
16 16  #end
17 17  #set($unavailableSyntaxes=[])
18 18  #foreach($supportedSyntax in $SUPPORTED_SYNTAX_ORDER)
... ... @@ -33,7 +33,7 @@
33 33  
34 34  #set ($crtCategoryId = "$!{request.category}")
35 35  #if ($crtCategoryId != '')
36 - #set ($crtCategoryId = $numbertool.toNumber($crtCategoryId).intValue())
38 + #set ($crtCategoryId = $mathtool.toInteger($crtCategoryId))
37 37  #end
38 38  #set ($crtSectionId = "$!{request.section}")
39 39  #set ($crtSyntaxVer = "$!{request.syntax}")
... ... @@ -112,7 +112,7 @@
112 112   #end
113 113  
114 114   ## Add new sections to category children map
115 - #set($child = {'id' : $sectionDoc.documentReference.name.substring(11), 'minSyntax' : $obj.getProperty("minSyntaxId").value, 'maxSyntax' : $obj.getProperty("maxSyntaxId").value, 'name' : $sectionTitle})
117 + #set($child = {'id' : $sectionDoc.getName().substring(11), 'minSyntax' : $obj.getProperty("minSyntaxId").value, 'maxSyntax' : $obj.getProperty("maxSyntaxId").value, 'name' : $sectionTitle})
116 116   $catChildren.add($child)
117 117   #end
118 118  #end
... ... @@ -159,9 +159,9 @@
159 159  ##
160 160  #foreach ($category in $syntaxMenu)
161 161   ## "Standard" URLs and icons for categories
162 - #set ($category.url = "?syntax=$escapetool.url(${crtSyntaxVer})&category=${mathtool.sub($foreach.count, 1)}${extraParams}")
164 + #set ($category.url = "?syntax=$escapetool.url(${crtSyntaxVer})&category=${mathtool.sub($velocityCount, 1)}${extraParams}")
163 163   #set ($category.cssClass = "${category.id}Icon")
164 - #if ("$!{crtCategoryId}" != '' && $foreach.count == $mathtool.add($crtCategoryId, 1))
166 + #if ("$!{crtCategoryId}" != '' && $velocityCount == $mathtool.add($crtCategoryId, 1))
165 165   #set ($crtCategory = $category)
166 166   #end
167 167   ##
... ... @@ -308,11 +308,11 @@
308 308  ##-----------------------------------------
309 309  ## syntax-page display
310 310  ##-----------------------------------------
311 - #set ($subHeading = '===')
312 312   (% id="syntax-page-content" %)(((
313 313   #if(!$crtSection && !$crtCategory)
314 314   #syntax_displayCategories($syntaxMenu 'syntax.')
315 315   #elseif (!$crtSection)
317 + #set ($subHeading = '===')
316 316   #syntax_displayCategory($crtCategory.children 'syntax.' '==')
317 317   #else
318 318   #syntax_displaySection($crtSection 'syntax.' false)