--- a/HTMLDocGenerator.st Thu Oct 13 17:22:30 2016 +0200
+++ b/HTMLDocGenerator.st Thu Oct 13 18:50:22 2016 +0200
@@ -2286,7 +2286,7 @@
with home being set to ../doc/online/xxx/classDoc
(i.e. the images are to be found one-up in the doc hierarchy)"
- |prevWord|
+ |prevWord caseMapping|
outStream := '' writeStream.
@@ -2298,25 +2298,46 @@
self generateH1:'Keywords:'.
outStream nextPutLine:'<dl>'.
prevWord := nil.
- aKWIC entriesDo:[:word :left :right :class :fullText :context|
+
+ caseMapping := Dictionary new.
+ aKWIC entriesDo:[:word :left :right :class|
+ |lcWord wordAlready|
+
+ lcWord := word asLowercase.
+ lcWord ~= word ifTrue:[
+ wordAlready := caseMapping at:lcWord ifAbsent:[nil].
+ wordAlready isNil ifTrue:[
+ caseMapping at:lcWord put:word
+ ].
+ ].
+ ].
+
+ aKWIC matchSorter:[:a :b | a value name < b value name].
+
+ aKWIC entriesDo:[:word :left :right :class|
|ref lcWord ctx|
- ctx := (HTMLUtilities escapeCharacterEntities:context).
+ ctx := (HTMLUtilities escapeCharacterEntities:(left contractAtBeginningTo:20))
+ ,' <b>',(HTMLUtilities escapeCharacterEntities:word),'</b> '
+ ,(HTMLUtilities escapeCharacterEntities:(right contractAtEndTo:20)).
lcWord := word asLowercase.
lcWord ~= prevWord ifTrue:[
prevWord notNil ifTrue:[
outStream nextPutLine:'</ul></dd>'.
].
- outStream nextPutLine:'<dt>',lcWord,'</dt>'.
+ "/ outStream nextPutLine:'<dt>',(HTMLUtilities escapeCharacterEntities:(caseMapping at:lcWord ifAbsent:[word])),'</dt>'.
+ outStream nextPutLine:'<dt>',(HTMLUtilities escapeCharacterEntities:word),'</dt>'.
outStream nextPutLine:'<dd><ul><li>'.
self generateClassDocReferenceFor:class name.
+ outStream nextPutAll:'<tab indent=300>'.
outStream nextPutLine:ctx.
outStream nextPutLine:'</li>'.
prevWord := lcWord.
] ifFalse:[
outStream nextPutLine:'</li><li>'.
self generateClassDocReferenceFor:class name.
+ outStream nextPutAll:'<tab indent=300>'.
outStream nextPutLine:ctx.
outStream nextPutLine:'</li>'.
].