author | Claus Gittinger <cg@exept.de> |
Sat, 28 Sep 2019 16:32:40 +0200 | |
changeset 4504 | 196828a4584c |
parent 4495 | 5f69b603bac0 |
child 4510 | 9776dcbf9a8a |
permissions | -rw-r--r-- |
4481 | 1 |
"{ Encoding: utf8 }" |
2 |
||
601 | 3 |
" |
4 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
1400 | 14 |
"{ Package: 'stx:libbasic3' }" |
1138
aa7687ec256f
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
15 |
|
3797 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
478 | 18 |
Object subclass:#HTMLDocGenerator |
1255 | 19 |
instanceVariableNames:'outStream pathToTopOfDocumentation |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
20 |
pathToLanguageTopOfDocumentation httpRequestOrNil |
2016 | 21 |
generateBodyOnly backRef backCmd imagePath refLines demoLines |
22 |
warnLines hintLines authorLines classProtocolCategories |
|
3643 | 23 |
instanceProtocolCategories generateJavaScriptCallInfo |
3999 | 24 |
generateDocumentForOfflineReading showUpButton' |
4106 | 25 |
classVariableNames:'CachedKWIC' |
478 | 26 |
poolDictionaries:'' |
27 |
category:'System-Documentation' |
|
28 |
! |
|
29 |
||
498 | 30 |
!HTMLDocGenerator class methodsFor:'documentation'! |
478 | 31 |
|
601 | 32 |
copyright |
33 |
" |
|
34 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
35 |
All Rights Reserved |
|
36 |
||
37 |
This software is furnished under a license and may be used |
|
38 |
only in accordance with the terms of that license and with the |
|
39 |
inclusion of the above copyright notice. This software may not |
|
40 |
be provided or otherwise made available to, or used by, any |
|
41 |
other person. No title to or ownership of the software is |
|
42 |
hereby transferred. |
|
43 |
" |
|
44 |
||
45 |
||
46 |
! |
|
47 |
||
478 | 48 |
documentation |
49 |
" |
|
817 | 50 |
Generates HTML documentation for a class. |
4122 | 51 |
|
52 |
This is used with the SystemBrowser (classes-generate documentation menu), |
|
53 |
and the online documentation (which generates up-to-date documents just-in-time |
|
54 |
out of the running system). |
|
55 |
||
56 |
It may also be useful, to programatically generate up-to-date documents |
|
57 |
into a folder of self contained html files (eg. for deployment). |
|
817 | 58 |
|
59 |
This generator extracts the documentation methods source |
|
60 |
(or comment), individual method comments (the first comment in |
|
61 |
a method) and version information to generate a neatly formatted |
|
62 |
HTML page. |
|
63 |
If executable examples (EXBEGIN .. EXEND) are present in the classes |
|
64 |
documentation category these are also added as executable code |
|
65 |
to the document. |
|
478 | 66 |
|
3643 | 67 |
[instance variables:] |
68 |
outStream <WriteStream> internal |
|
69 |
pathToTopOfDocumentation <String> will be prepended to links. |
|
70 |
defaults to '../../doc' |
|
71 |
pathToLanguageTopOfDocumentation <String> defaults to '../../doc/online/<lang>' |
|
72 |
httpRequestOrNil internal |
|
73 |
generateBodyOnly internal |
|
74 |
backRef <URLString> if non-nil, the url for a back-button |
|
75 |
backCmd <String> if non-nil, the command for a back-button (for internal doc-browser only) |
|
76 |
imagePath <String> path to image documents |
|
77 |
refLines internal |
|
78 |
demoLines internal |
|
79 |
warnLines internal |
|
80 |
hintLines internal |
|
81 |
authorLines internal |
|
82 |
classProtocolCategories internal |
|
83 |
instanceProtocolCategories internal |
|
84 |
generateJavaScriptCallInfo <Boolean> if true, synopsis is shown in JavaScript syntax also |
|
85 |
generateDocumentForOfflineReading <Boolean> if true, document is generated with file links (instead of browser command links) |
|
86 |
for offline reading by an arbitrary browser. |
|
87 |
||
478 | 88 |
[author:] |
89 |
Claus Gittinger |
|
817 | 90 |
|
91 |
[see also:] |
|
92 |
BrowserView |
|
93 |
HTMLDocumentView |
|
478 | 94 |
" |
95 |
! ! |
|
96 |
||
498 | 97 |
!HTMLDocGenerator class methodsFor:'document generation'! |
478 | 98 |
|
3644 | 99 |
generateOfflineDocIn:aTopDirectory |
100 |
"generate a full tree of documents for offline reading. |
|
101 |
Similar to what is generated by the live-document generator, but |
|
102 |
all links are to static files. |
|
103 |
Tool for deployment." |
|
104 |
||
105 |
aTopDirectory recursiveMakeDirectory. |
|
106 |
(aTopDirectory / 'packages') recursiveMakeDirectory. |
|
107 |
(aTopDirectory / 'categories') recursiveMakeDirectory. |
|
108 |
||
109 |
(aTopDirectory / 'index.html') contents:(self htmlOfflineIndex). |
|
110 |
(aTopDirectory / 'packages/index.html') contents:(self htmlOfflinePackageList). |
|
111 |
(aTopDirectory / 'categories/index.html') contents:(self htmlOfflineClassCategoryList). |
|
112 |
"/ (aTopDirectory / 'classes/index.html') contents:(self htmlOfflineClassList). |
|
113 |
||
114 |
" |
|
115 |
self generateOfflineDocIn:'./offlineDoc' asFilename |
|
116 |
" |
|
117 |
! |
|
118 |
||
478 | 119 |
htmlClassCategoryList |
632 | 120 |
"generate a formatted list of all available class categories as |
121 |
an HTML string. Each category will be a hyperlink to another |
|
122 |
autogenerated page, containing the classes per category. |
|
123 |
The generated page is supposed to be given to an HTML reader |
|
124 |
with home being set to ../doc/online/xxx/classDoc |
|
125 |
(i.e. the images are to be found one-up in the doc hierarchy)" |
|
126 |
||
1249 | 127 |
^ self new htmlClassCategoryList |
128 |
||
129 |
" |
|
130 |
HTMLDocGenerator htmlClassCategoryList |
|
131 |
" |
|
132 |
! |
|
133 |
||
134 |
htmlClassListPrefix:prefix |
|
135 |
"generate an HTML document string which contains HREFS for a list |
|
136 |
of classes which start with some prefix (typically, the first |
|
137 |
character is given)" |
|
138 |
||
139 |
^ self new htmlClassListPrefix:prefix |
|
140 |
||
141 |
" |
|
142 |
HTMLDocGenerator htmlClassListPrefix:'A' |
|
143 |
" |
|
144 |
! |
|
145 |
||
1952
d4ce03b83795
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
1923
diff
changeset
|
146 |
htmlClasses:classes title:title backTo:backRef |
d4ce03b83795
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
1923
diff
changeset
|
147 |
"generate an HTML document string which contains HREFS for a given list |
d4ce03b83795
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
1923
diff
changeset
|
148 |
of classes. If backref is nonNil, a back-button to that |
d4ce03b83795
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
1923
diff
changeset
|
149 |
HREF is added at the top. |
d4ce03b83795
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
1923
diff
changeset
|
150 |
The generated page is supposed to be given to an HTML reader |
d4ce03b83795
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
1923
diff
changeset
|
151 |
with home being set to ../doc/online/xxx/classDoc |
d4ce03b83795
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
1923
diff
changeset
|
152 |
(i.e. the images are to be found one-up in the doc hierarchy)" |
d4ce03b83795
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
1923
diff
changeset
|
153 |
|
d4ce03b83795
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
1923
diff
changeset
|
154 |
^ self new htmlClasses:classes title:title backTo:backRef |
d4ce03b83795
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
1923
diff
changeset
|
155 |
! |
d4ce03b83795
Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents:
1923
diff
changeset
|
156 |
|
1249 | 157 |
htmlClassesListOfCategory:aCategory backTo:backMessage |
158 |
"generate an HTML document string which contains HREFS for a list |
|
159 |
of classes which are contained in a particular category." |
|
160 |
||
161 |
^ self new htmlClassesListOfCategory:aCategory backTo:backMessage |
|
162 |
! |
|
163 |
||
164 |
htmlDocOf:aClass |
|
165 |
"generate an HTML document string which contains a classes documentation" |
|
166 |
||
167 |
^ self new htmlDocOf:aClass |
|
168 |
||
169 |
" |
|
170 |
HTMLDocGenerator htmlDocOf:Array |
|
1973 | 171 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator htmlDocOf:Array) |
1249 | 172 |
" |
1973 | 173 |
|
174 |
"Modified: / 05-11-2007 / 16:19:03 / cg" |
|
1249 | 175 |
! |
176 |
||
1253 | 177 |
htmlDocOf:aClass back:backCmd backRef:backRef imagePath:imagePath |
178 |
"generate a nice HTML page from a class, with a back-reference |
|
179 |
to a command or document." |
|
180 |
||
181 |
^ self new htmlDocOf:aClass back:backCmd backRef:backRef imagePath:imagePath |
|
182 |
! |
|
183 |
||
1289
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
184 |
htmlDocOf:aClass backRef:backRef |
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
185 |
"generate an HTML document string which contains a classes documentation" |
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
186 |
|
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
187 |
^ self new htmlDocOf:aClass backRef:backRef |
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
188 |
! |
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
189 |
|
1249 | 190 |
htmlDocOfImplementorsOf:selector |
191 |
"generate an HTML document string which contains HREFS |
|
192 |
to all implementors of a particular selector" |
|
193 |
||
194 |
^ self new htmlDocOfImplementorsOf:selector |
|
195 |
||
196 |
" |
|
197 |
HTMLDocGenerator htmlDocOfImplementorsOf:#at: |
|
198 |
" |
|
199 |
! |
|
200 |
||
1435 | 201 |
htmlDocOfImplementorsOfAnyMatching:selectorPattern |
202 |
"generate an HTML document string which contains HREFS |
|
203 |
to all implementors of a particular selector pattern" |
|
204 |
||
205 |
^ self new htmlDocOfImplementorsOfAnyMatching:selectorPattern |
|
206 |
||
207 |
" |
|
208 |
HTMLDocGenerator htmlDocOfImplementorsOfAnyMatching:'key*:x:y:' |
|
209 |
" |
|
210 |
! |
|
211 |
||
4106 | 212 |
htmlKWOCList |
213 |
" |
|
214 |
CachedKWIC := nil |
|
215 |
" |
|
216 |
CachedKWIC isNil ifTrue:[ |
|
4127 | 217 |
"/ CachedKWIC := self generateKWIC. |
218 |
CachedKWIC := self generateKWICForClassAndMethodNames. |
|
4106 | 219 |
"/ to flush the cached kwic, whenever a class-documentation method is changed |
220 |
Smalltalk addDependent:self class. |
|
221 |
]. |
|
222 |
^ self new htmlKWOCListFor:CachedKWIC |
|
223 |
||
224 |
" |
|
225 |
HTMLDocGenerator htmlKWOCList |
|
226 |
" |
|
227 |
! |
|
228 |
||
3644 | 229 |
htmlOfflineClassCategoryList |
230 |
"generate a formatted list of all available class categories as |
|
231 |
an HTML string. Each category will be a hyperlink to another |
|
232 |
autogenerated page, containing the classes per category. |
|
233 |
The generated page is supposed to be given to an HTML reader |
|
234 |
with home being set to ../doc/online/xxx/classDoc |
|
235 |
(i.e. the images are to be found one-up in the doc hierarchy)" |
|
236 |
||
237 |
^ self new |
|
238 |
generateDocumentForOfflineReading:true; |
|
239 |
htmlClassCategoryList |
|
240 |
||
241 |
" |
|
242 |
HTMLDocGenerator htmlOfflineClassCategoryList |
|
243 |
" |
|
244 |
! |
|
245 |
||
3643 | 246 |
htmlOfflineDocOf:aClass |
247 |
"generate an HTML document string which contains a class's documentation for offline reading. |
|
248 |
This is different in that it creates file links, instead of action links |
|
249 |
(action links only work with the builtin doc reader)." |
|
250 |
||
251 |
^ self new htmlOfflineDocOf:aClass |
|
252 |
||
253 |
" |
|
254 |
HTMLDocGenerator htmlDocOf:Array |
|
255 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator htmlDocOf:Array) |
|
256 |
" |
|
257 |
||
258 |
"Modified: / 05-11-2007 / 16:19:03 / cg" |
|
259 |
! |
|
260 |
||
3644 | 261 |
htmlOfflineIndex |
262 |
^ '<html> |
|
263 |
<body> |
|
264 |
<ul> |
|
265 |
<li><A HREF="packages/index.html">By Package</A> |
|
266 |
<li><A HREF="categories/index.html">By Category</A> |
|
267 |
<li><A HREF="classes/index.html">By Class Name</A> |
|
268 |
</ul> |
|
269 |
</body> |
|
270 |
</html> |
|
271 |
' |
|
272 |
! |
|
273 |
||
274 |
htmlOfflinePackageList |
|
275 |
"generate an HTML string for all packages in the system" |
|
276 |
||
277 |
^ self new |
|
278 |
generateDocumentForOfflineReading:true; |
|
279 |
htmlPackageList |
|
280 |
||
281 |
" |
|
282 |
HTMLDocGenerator htmlOfflinePackageList |
|
283 |
" |
|
284 |
! |
|
285 |
||
2017 | 286 |
htmlPackageDocOf:packageID |
287 |
"generate an HTML document string which contains a packages classlist" |
|
288 |
||
289 |
^ self new htmlPackageDocOf:packageID |
|
290 |
||
291 |
" |
|
292 |
HTMLDocGenerator htmlPackageDocOf:#'stx:libbasic' |
|
293 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator htmlPackageDocOf:#'stx:libbasic') |
|
294 |
" |
|
295 |
! |
|
296 |
||
2018 | 297 |
htmlPackageList |
298 |
"generate an HTML string for all packages in the system" |
|
299 |
||
300 |
^ self new htmlPackageList |
|
301 |
||
302 |
" |
|
303 |
HTMLDocGenerator htmlPackageList |
|
304 |
" |
|
305 |
! |
|
306 |
||
1249 | 307 |
htmlSelectorList |
308 |
"generate an HTML string for all selectors (for which methods exist) |
|
309 |
in the system" |
|
310 |
||
311 |
^ self new htmlSelectorList |
|
312 |
||
313 |
" |
|
314 |
HTMLDocGenerator htmlSelectorList |
|
315 |
" |
|
316 |
! |
|
317 |
||
318 |
htmlSelectorListMatching:prefix |
|
319 |
"generate an HTML string for all selectors which match a pattern |
|
320 |
(and for which methods exist) in the system" |
|
321 |
||
322 |
^ self new htmlSelectorListMatching:prefix |
|
323 |
! |
|
324 |
||
325 |
htmlSelectorListPrefix:prefix |
|
326 |
"generate an HTML string for all selectors whose names starts with |
|
327 |
a prefix (and for which methods exist) in the system" |
|
328 |
||
329 |
^ self new htmlSelectorListPrefix:prefix |
|
330 |
||
331 |
" |
|
332 |
HTMLDocGenerator htmlSelectorListPrefix:'a' |
|
333 |
" |
|
334 |
! |
|
335 |
||
336 |
manPageFor:aCommandName |
|
337 |
"generate a (unix-) man page for a given command & convert the output to html" |
|
338 |
||
339 |
^ self new manPageFor:aCommandName |
|
340 |
||
341 |
" |
|
342 |
HTMLDocGenerator manPageFor:'ls' |
|
343 |
||
344 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageFor:'ls') |
|
345 |
" |
|
346 |
! |
|
347 |
||
348 |
manPageFor:aManPageTemplateFile manCommand:nroffCommand |
|
349 |
"convert man-command output to html. |
|
350 |
Only the body of the text (without head../head and body../body) is generated" |
|
351 |
||
352 |
^ self new manPageFor:aManPageTemplateFile manCommand:nroffCommand |
|
353 |
||
354 |
" |
|
355 |
HTMLDocGenerator |
|
356 |
manPageForFile:'/usr/man/man2/open.2' |
|
357 |
manCommand:'nroff -man /usr/man/man2/open.2' |
|
358 |
" |
|
359 |
! |
|
360 |
||
361 |
manPageForFile:aManPageTemplateFile |
|
362 |
"convert a .man file to html" |
|
363 |
||
364 |
^ self new manPageForFile:aManPageTemplateFile |
|
365 |
||
366 |
" |
|
367 |
HTMLDocGenerator manPageForFile:'/usr/man/man2/open.2' |
|
368 |
||
369 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:'../../stc/stc.1') |
|
370 |
" |
|
371 |
! ! |
|
372 |
||
3625 | 373 |
!HTMLDocGenerator class methodsFor:'document generation-helpers'! |
374 |
||
4127 | 375 |
camelCaseSeparatedWordsOf:wordIn do:aBlock |
376 |
" |
|
377 |
self camelCaseSeparatedWordsOf:'HelloWorld' do:[:w | Transcript showCR:w] |
|
378 |
self camelCaseSeparatedWordsOf:'abcDef' do:[:w | Transcript showCR:w] |
|
379 |
self camelCaseSeparatedWordsOf:'UTFEncoder' do:[:w | Transcript showCR:w] |
|
380 |
self camelCaseSeparatedWordsOf:'JisEncoder' do:[:w | Transcript showCR:w] |
|
381 |
self camelCaseSeparatedWordsOf:'JISEncode' do:[:w | Transcript showCR:w] |
|
382 |
" |
|
383 |
|state newState in out ch part| |
|
384 |
||
385 |
in := wordIn readStream. |
|
386 |
out := '' writeStream. |
|
387 |
[in atEnd] whileFalse:[ |
|
388 |
ch := in next. |
|
389 |
(ch isDigit or:[ch == $_]) ifFalse:[ |
|
390 |
newState := ch isUppercase. |
|
391 |
]. |
|
392 |
(newState ~~ state) ifTrue:[ |
|
393 |
newState == true ifTrue:[ |
|
394 |
"/ going from lower- to uppercase |
|
395 |
part := out contents. |
|
396 |
part notEmpty ifTrue:[ aBlock value:part ]. |
|
397 |
out := '' writeStream. |
|
398 |
out nextPut:ch. |
|
399 |
state := newState. |
|
400 |
] ifFalse:[ |
|
401 |
"/ going upper- to lowercase |
|
402 |
out size <= 1 ifTrue:[ |
|
403 |
out nextPut:ch. |
|
404 |
] ifFalse:[ |
|
405 |
|prev| |
|
406 |
||
407 |
prev := out contents. |
|
408 |
aBlock value:(prev copyButLast). |
|
409 |
out := '' writeStream. |
|
410 |
out nextPut:prev last. |
|
411 |
out nextPut:ch. |
|
412 |
]. |
|
413 |
state := newState. |
|
414 |
]. |
|
415 |
] ifFalse:[ |
|
416 |
out nextPut:ch. |
|
417 |
]. |
|
418 |
]. |
|
419 |
part := out contents. |
|
420 |
part notEmpty ifTrue:[ aBlock value:part ]. |
|
421 |
! |
|
422 |
||
4106 | 423 |
generateKWIC |
424 |
|fillWords kwic| |
|
425 |
||
426 |
fillWords := |
|
427 |
#( |
|
428 |
'the' 'a' |
|
429 |
'can' 'you' |
|
4125 | 430 |
'to' 'in' 'out' 'at' 'of' |
4110 | 431 |
'also' 'with' 'without' 'all' 'any' 'how' |
4123 | 432 |
'however' 'although' 'always' 'either' 'neither' |
4110 | 433 |
'anywhere' 'anyway' 'anything' 'anyone' |
4123 | 434 |
'not' 'but' 'else' 'elsewhere' |
4106 | 435 |
'am' 'are' 'is' 'be' 'will' 'wont' 'won''t' 'do' 'don''t' |
4125 | 436 |
'no' 'non' 'now' 'old' 'on' 'only' |
4106 | 437 |
'my' 'their' 'your' 'its' |
438 |
'one' 'two' 'three' |
|
4125 | 439 |
'etc' 'for' 'lot' 'lots' 'made' 'may' 'most' 'mostly' 'much' |
4106 | 440 |
'use' 'this' 'that' 'which' 'what' 'why' |
4125 | 441 |
'or' 'other' 'please' |
4106 | 442 |
). |
443 |
||
444 |
kwic := KeywordInContextIndexBuilder new. |
|
445 |
kwic excluded:fillWords. |
|
4127 | 446 |
kwic separatorAlgorithm:[:line | |
447 |
line asCollectionOfSubstringsSeparatedByAny:' ^~=@.:,;-+*/()[]|{}#"''<>',Character cr |
|
448 |
]. |
|
4106 | 449 |
kwic exclusionFilter:[:word | |
450 |
word size == 1 |
|
451 |
or:[ word conform:#isDigit ]]. |
|
4122 | 452 |
|
4106 | 453 |
Smalltalk allClassesDo:[:eachClass | |
4126 | 454 |
eachClass isLoaded ifTrue:[ |
455 |
|doc| |
|
456 |
||
457 |
doc := eachClass commentOrDocumentationString. |
|
458 |
doc notEmptyOrNil ifTrue:[ |
|
459 |
kwic addLine:doc reference:eachClass ignoreCase:true. |
|
460 |
]. |
|
461 |
]. |
|
4106 | 462 |
]. |
4122 | 463 |
|
4123 | 464 |
"/ if we have a key like 'startWith:' in the list, |
465 |
"/ and 'starts' is also there, place the 'startsWith:' entries into the same bin. |
|
4122 | 466 |
kwic remapKeywordsWith:[:oldKey :knownMappings | |
467 |
|newKey| |
|
468 |
||
4125 | 469 |
6 to:oldKey size - 1 do:[:len | |
4122 | 470 |
newKey isNil ifTrue:[ |
4123 | 471 |
|part| |
472 |
||
473 |
part := (oldKey copyTo:len). |
|
474 |
(knownMappings includes:part) ifTrue:[ |
|
475 |
newKey := part. |
|
4122 | 476 |
]. |
477 |
]. |
|
478 |
]. |
|
479 |
newKey ? oldKey. |
|
480 |
]. |
|
481 |
||
4106 | 482 |
^ kwic |
483 |
||
484 |
" |
|
4122 | 485 |
CachedKWIC := nil. |
4106 | 486 |
self generateKWIC |
487 |
" |
|
488 |
! |
|
489 |
||
4127 | 490 |
generateKWICForClassAndMethodNames |
491 |
|fillWords kwic| |
|
492 |
||
493 |
fillWords := |
|
494 |
#( |
|
495 |
"/ 'the' 'a' |
|
496 |
"/ 'can' 'you' |
|
497 |
"/ 'to' 'in' 'out' 'at' 'of' |
|
498 |
"/ 'also' 'with' 'without' 'all' 'any' 'how' |
|
499 |
"/ 'however' 'although' 'always' 'either' 'neither' |
|
500 |
"/ 'anywhere' 'anyway' 'anything' 'anyone' |
|
501 |
"/ 'not' 'but' 'else' 'elsewhere' |
|
502 |
"/ 'am' 'are' 'is' 'be' 'will' 'wont' 'won''t' 'do' 'don''t' |
|
503 |
"/ 'no' 'non' 'now' 'old' 'on' 'only' |
|
504 |
"/ 'my' 'their' 'your' 'its' |
|
505 |
"/ 'one' 'two' 'three' |
|
506 |
"/ 'etc' 'for' 'lot' 'lots' 'made' 'may' 'most' 'mostly' 'much' |
|
507 |
"/ 'use' 'this' 'that' 'which' 'what' 'why' |
|
508 |
"/ 'or' 'other' 'please' |
|
509 |
). |
|
510 |
||
511 |
kwic := KeywordInContextIndexBuilder new. |
|
512 |
kwic excluded:fillWords. |
|
513 |
kwic separatorAlgorithm:[:name | |
|
514 |
|words| |
|
515 |
words := Set new. |
|
516 |
(name asCollectionOfSubstringsSeparatedBy:$:) do:[:eachPart | |
|
517 |
eachPart notEmpty ifTrue:[ |
|
518 |
self camelCaseSeparatedWordsOf:eachPart do:[:w | words add:w]. |
|
519 |
]. |
|
520 |
]. |
|
521 |
words := words reject:[:w | w isEmpty]. |
|
522 |
words |
|
523 |
]. |
|
524 |
||
525 |
Smalltalk allClassesDo:[:eachClass | |
|
526 |
kwic addLine:eachClass name reference:eachClass ignoreCase:true. |
|
527 |
"/ eachClass isLoaded ifTrue:[ |
|
528 |
"/ eachClass theNonMetaclass selectorsAndMethodsDo:[:sel :mthd | |
|
529 |
"/ kwic addLine:sel reference:mthd ignoreCase:true. |
|
530 |
"/ ]. |
|
531 |
"/ eachClass theMetaclass selectorsAndMethodsDo:[:sel :mthd| |
|
532 |
"/ kwic addLine:sel reference:mthd ignoreCase:true. |
|
533 |
"/ ]. |
|
534 |
"/ ]. |
|
535 |
]. |
|
536 |
^ kwic |
|
537 |
||
538 |
" |
|
539 |
CachedKWIC := nil. |
|
540 |
self generateKWICForClassAndMethodNames |
|
541 |
" |
|
542 |
! |
|
543 |
||
3625 | 544 |
htmlForMethod:aMethod |
545 |
|who sel partStream args argStream methodSpecLine| |
|
546 |
||
547 |
who := aMethod who. |
|
548 |
sel := who methodSelector. |
|
549 |
||
550 |
partStream := sel keywords readStream. |
|
551 |
||
552 |
(args := aMethod methodArgNames) notNil ifTrue:[ |
|
553 |
argStream := args readStream. |
|
554 |
||
555 |
methodSpecLine := ''. |
|
4495 | 556 |
1 to:sel argumentCount do:[:index | |
4404 | 557 |
methodSpecLine size ~~ 0 ifTrue:[ |
3625 | 558 |
methodSpecLine := methodSpecLine , ' ' |
559 |
]. |
|
560 |
methodSpecLine := methodSpecLine , '<B>' , partStream next , '</B>'. |
|
561 |
methodSpecLine := methodSpecLine , ' <I>' , argStream next , '</I>'. |
|
562 |
]. |
|
563 |
] ifFalse:[ |
|
564 |
methodSpecLine := '<B>' , partStream next , '</B>' |
|
565 |
]. |
|
566 |
^ methodSpecLine |
|
567 |
||
568 |
"Created: / 05-11-2007 / 16:13:39 / cg" |
|
4404 | 569 |
"Modified: / 01-03-2019 / 15:53:15 / Claus Gittinger" |
3625 | 570 |
! ! |
571 |
||
1255 | 572 |
!HTMLDocGenerator class methodsFor:'pathnames'! |
573 |
||
1993
68da9e3a68e9
make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents:
1979
diff
changeset
|
574 |
findPathToTopOfDocumentation |
4267 | 575 |
"find the 'doc/online' folder" |
576 |
||
3999 | 577 |
|triedDirs| |
578 |
||
579 |
triedDirs := OrderedCollection new. |
|
4267 | 580 |
triedDirs add:(Smalltalk packageDirectory directory / 'doc/online') pathName. |
3999 | 581 |
triedDirs addAll: |
582 |
#( |
|
583 |
'../../doc/online' |
|
584 |
'doc/online' |
|
585 |
'/opt/stx/doc/online' |
|
586 |
). |
|
587 |
triedDirs do:[:eachPathToTry | |
|
1993
68da9e3a68e9
make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents:
1979
diff
changeset
|
588 |
(eachPathToTry asFilename exists |
68da9e3a68e9
make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents:
1979
diff
changeset
|
589 |
and:[eachPathToTry asFilename isDirectory]) |
68da9e3a68e9
make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents:
1979
diff
changeset
|
590 |
ifTrue:[ |
68da9e3a68e9
make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents:
1979
diff
changeset
|
591 |
^ eachPathToTry |
68da9e3a68e9
make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents:
1979
diff
changeset
|
592 |
] |
68da9e3a68e9
make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents:
1979
diff
changeset
|
593 |
]. |
68da9e3a68e9
make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents:
1979
diff
changeset
|
594 |
^ '.' |
3999 | 595 |
|
596 |
" |
|
597 |
self findPathToTopOfDocumentation |
|
598 |
" |
|
4267 | 599 |
|
600 |
"Modified (comment): / 25-11-2017 / 14:05:08 / cg" |
|
1993
68da9e3a68e9
make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents:
1979
diff
changeset
|
601 |
! |
68da9e3a68e9
make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents:
1979
diff
changeset
|
602 |
|
1255 | 603 |
languageSpecificDocDirectory |
604 |
|lang| |
|
605 |
||
2178
af7b05dfeaae
changed: #languageSpecificDocDirectory
Claus Gittinger <cg@exept.de>
parents:
2055
diff
changeset
|
606 |
lang := UserPreferences current language. |
1255 | 607 |
|
608 |
"XXX Kludge for now, map ISO-639 abbreviations to dir names. |
|
609 |
Should rename the directories" |
|
610 |
||
611 |
lang == #en ifTrue:[ |
|
612 |
^ 'english'. |
|
613 |
]. |
|
614 |
lang == #de ifTrue:[ |
|
615 |
^ 'german'. |
|
616 |
]. |
|
617 |
lang == #fr ifTrue:[ |
|
618 |
^ 'french'. |
|
619 |
]. |
|
620 |
lang == #it ifTrue:[ |
|
621 |
^ 'italian'. |
|
622 |
]. |
|
3643 | 623 |
"/ lang == #es ifTrue:[ |
624 |
"/ ^ 'spanish'. |
|
625 |
"/ ]. |
|
1255 | 626 |
lang == #jp ifTrue:[ |
627 |
^ 'japanese'. |
|
628 |
]. |
|
629 |
^ 'english'. |
|
630 |
||
631 |
" |
|
632 |
self languageSpecificDocDirectory |
|
633 |
" |
|
634 |
! ! |
|
635 |
||
636 |
!HTMLDocGenerator methodsFor:'accessing'! |
|
637 |
||
3643 | 638 |
generateBodyOnly:aBoolean |
639 |
generateBodyOnly := aBoolean. |
|
640 |
! |
|
641 |
||
642 |
generateDocumentForOfflineReading |
|
643 |
^ generateDocumentForOfflineReading ? false |
|
644 |
! |
|
645 |
||
646 |
generateDocumentForOfflineReading:aBoolean |
|
647 |
generateDocumentForOfflineReading := aBoolean. |
|
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
648 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
649 |
|
3625 | 650 |
generateJavaScriptCallInfo |
651 |
^ generateJavaScriptCallInfo ? false |
|
652 |
! |
|
653 |
||
654 |
generateJavaScriptCallInfo:aBoolean |
|
655 |
generateJavaScriptCallInfo := aBoolean. |
|
656 |
! |
|
657 |
||
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
658 |
httpRequest:aRequest |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
659 |
httpRequestOrNil := aRequest. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
660 |
! |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
661 |
|
1255 | 662 |
pathToLanguageTopOfDocumentation:something |
663 |
pathToLanguageTopOfDocumentation := something. |
|
664 |
! |
|
665 |
||
666 |
pathToTopOfDocumentation:something |
|
667 |
pathToTopOfDocumentation := something. |
|
3999 | 668 |
! |
669 |
||
670 |
showUpButton |
|
671 |
^ showUpButton ? true |
|
672 |
! |
|
673 |
||
674 |
showUpButton:aBoolean |
|
675 |
showUpButton := aBoolean |
|
1255 | 676 |
! ! |
677 |
||
1249 | 678 |
!HTMLDocGenerator methodsFor:'document generation'! |
679 |
||
2016 | 680 |
generateClassInfoForClass:aClass |
2017 | 681 |
|owner packageID| |
2016 | 682 |
|
683 |
owner := aClass owningClass. |
|
2017 | 684 |
packageID := aClass package. |
2016 | 685 |
|
686 |
outStream nextPutLine:'<dl>'. |
|
687 |
outStream nextPutLine:'<dt><a name="PACKAGE"><b>Package:</b></A>'. |
|
2017 | 688 |
outStream nextPutAll:'<dd><b>'. |
689 |
self generatePackageDocReferenceFor:packageID text:packageID. |
|
690 |
"/ outStream nextPutAll:packageID. |
|
691 |
outStream nextPutLine:'</b>'. |
|
2016 | 692 |
outStream nextPutLine:'</dl>'. |
693 |
||
694 |
||
695 |
aClass category notNil ifTrue:[ |
|
696 |
outStream nextPutLine:'<dl>'. |
|
697 |
outStream nextPutLine:'<dt><a name="CATEGORY"><b>Category:</b></A>'. |
|
698 |
outStream nextPutLine:'<dd><b>', aClass category , '</b>'. |
|
699 |
outStream nextPutLine:'</dl>'. |
|
700 |
]. |
|
701 |
||
702 |
owner notNil ifTrue:[ |
|
703 |
outStream nextPutLine:'<dl>'. |
|
704 |
outStream nextPutLine:'<dt><a name="OWNER"><b>Owner:</b></A>'. |
|
705 |
outStream nextPutAll:'<dd><b>'. |
|
706 |
self generateClassDocReferenceFor:owner name. |
|
707 |
outStream cr. |
|
708 |
"/ outStream nextPutLine:(self |
|
709 |
"/ anchorForHTMLDocAction: |
|
710 |
"/ ('htmlDocOf:', owner name ) |
|
711 |
"/ info: |
|
712 |
"/ ( 'Show documentation of ' , owner nameWithoutPrefix ) |
|
713 |
"/ text: |
|
714 |
"/ owner nameWithoutPrefix). |
|
715 |
outStream nextPutLine:'</b>'. |
|
716 |
] ifFalse:[ |
|
717 |
self htmlRevisionDocOf:aClass to:outStream. |
|
718 |
]. |
|
719 |
outStream nextPutLine:'</dl>'. |
|
720 |
||
721 |
authorLines notNil ifTrue:[ |
|
722 |
outStream nextPutLine:'<dl><dt><a name="AUTHOR"><b>Author:</b></A>'. |
|
723 |
authorLines do:[:l| |
|
724 |
outStream nextPutLine:'<dd><b>', l , '</b>'. |
|
725 |
]. |
|
726 |
outStream nextPutLine:'</dl>'. |
|
727 |
]. |
|
728 |
! |
|
729 |
||
730 |
generateClassProtocolDocumentationForClass:aClass |
|
731 |
|metaClass shortMetaName| |
|
732 |
||
733 |
classProtocolCategories notEmpty ifTrue:[ |
|
734 |
metaClass := aClass class. |
|
735 |
shortMetaName := metaClass nameWithoutPrefix. |
|
736 |
||
737 |
outStream nextPutLine:'<li><a href="#CLASSPROTOCOL" name="I_CLASSPROTOCOL">Class protocol</a>'. |
|
738 |
outStream nextPutLine:'<ul>'. |
|
739 |
classProtocolCategories do:[:cat | |
|
740 |
outStream nextPutLine:'<li><a name="I_' , shortMetaName , '_category_' , cat , '"' , |
|
741 |
' href="#' , shortMetaName , '_category_' , cat , |
|
742 |
'">' , cat , '</a> '. |
|
743 |
]. |
|
744 |
outStream nextPutLine:'</ul>'. |
|
745 |
]. |
|
746 |
! |
|
747 |
||
748 |
generateDemo |
|
749 |
outStream nextPutLine:'<h2><a name="DEMOSTARTUP" href="#I_DEMOSTARTUP">Demonstration:</A></h2>'. |
|
750 |
demoLines do:[:l | |
|
751 |
outStream nextPutLine:'<a INFO="demonstration" type="example">'. |
|
752 |
outStream nextPutLine:'<pre><code>'. |
|
753 |
outStream nextPutLine:' ' , l withoutSeparators. |
|
754 |
outStream nextPutLine:'</code></pre>'. |
|
755 |
outStream nextPutLine:'</a>'. |
|
756 |
outStream nextPutLine:'<br>'. |
|
757 |
]. |
|
758 |
! |
|
759 |
||
760 |
generateDescription:docu |
|
761 |
docu notNil ifTrue:[ |
|
762 |
outStream nextPutLine:'<h2><a name="DESCRIPTION" href="#I_DESCRIPTION">Description:</A></h2>'. |
|
763 |
outStream nextPutLine:'<BR>'. |
|
764 |
||
765 |
outStream nextPutLine:'<pre>'. |
|
766 |
outStream nextPutLine:docu. |
|
767 |
outStream nextPutLine:'</pre>'. |
|
768 |
self generateHorizontalLine. |
|
769 |
]. |
|
770 |
! |
|
771 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
772 |
generateExampleEnd |
4318 | 773 |
outStream nextPutAll:'</code></pre>'. |
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
774 |
self generatingForSTXBrowser ifTrue:[ |
4318 | 775 |
outStream nextPutAll:'</a>'. |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
776 |
]. |
4318 | 777 |
outStream nextPutAll:'</td></tr></table>'. |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
778 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
779 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
780 |
generateExampleStart |
4318 | 781 |
"/ outStream nextPutAll:'<p></p>'. |
782 |
outStream nextPutAll:'<table width="100%" bgcolor="#eedddd"><tr><td>'. |
|
1343 | 783 |
self generatingForSTXBrowser ifTrue:[ |
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
784 |
outStream nextPutLine:'<a info="execute the example" type="example" showresult>'. |
1343 | 785 |
]. |
4318 | 786 |
outStream nextPutAll:'<pre><code>'. |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
787 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
788 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
789 |
generateExamples:examples |
3625 | 790 |
"everything between exBegin and exEnd is shown as code example; |
791 |
the remaining text is shown as regular text (commenting the code, I hope)" |
|
792 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
793 |
|inExample| |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
794 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
795 |
inExample := false. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
796 |
outStream nextPutLine:'<h2><a name="EXAMPLES" href="#I_EXAMPLES">Examples:</A></h2>'. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
797 |
outStream nextPutLine:'<BR>'. |
1343 | 798 |
|
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
799 |
examples do:[:line | |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
800 |
line withoutSeparators = '[exBegin]' ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
801 |
inExample ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
802 |
self generateExampleEnd. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
803 |
]. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
804 |
self generateExampleStart. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
805 |
inExample := true. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
806 |
] ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
807 |
line withoutSeparators = '[exEnd]' ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
808 |
inExample ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
809 |
self generateExampleEnd. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
810 |
]. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
811 |
inExample := false. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
812 |
] ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
813 |
outStream nextPutLine:line |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
814 |
] |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
815 |
]. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
816 |
]. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
817 |
inExample ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
818 |
self generateExampleEnd. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
819 |
]. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
820 |
self generateHorizontalLine. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
821 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
822 |
|
2016 | 823 |
generateInheritanceTreeForClass:aClass |
824 |
|indent first supers subs| |
|
825 |
||
826 |
supers := aClass allSuperclasses. |
|
827 |
(aClass == Autoload or:[aClass == Object]) ifTrue:[ |
|
828 |
subs := #() |
|
829 |
] ifFalse:[ |
|
830 |
subs := self shownSubclassesOf:aClass. |
|
831 |
]. |
|
832 |
||
833 |
outStream nextPutLine:'<h2><a name="INHERITANCE" href="#I_INHERITANCE">Inheritance:</A></h2>'. |
|
834 |
outStream nextPutLine:'<pre>'. |
|
835 |
indent := 3. |
|
836 |
first := true. |
|
4404 | 837 |
(supers size ~~ 0) ifTrue:[ |
2016 | 838 |
supers reverseDo:[:cls | |
839 |
|className| |
|
840 |
||
841 |
className := cls name. |
|
842 |
first ifFalse:[ |
|
843 |
outStream spaces:indent; nextPutLine:'|'. |
|
844 |
outStream spaces:indent; nextPutAll:'+--'. |
|
845 |
indent := indent + 3. |
|
846 |
] ifTrue:[ |
|
847 |
outStream spaces:indent |
|
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
848 |
]. |
2016 | 849 |
first := false. |
850 |
||
851 |
self generateClassDocReferenceFor:className. |
|
852 |
outStream cr. |
|
853 |
]. |
|
854 |
outStream spaces:indent; nextPutLine:'|'. |
|
855 |
outStream spaces:indent. |
|
856 |
outStream nextPutAll:'+--<B>'; nextPutAll:aClass name; nextPutLine:'</B>'. |
|
857 |
indent := indent + 3. |
|
858 |
] ifFalse:[ |
|
859 |
outStream spaces:indent; nextPutLine:'nil'. |
|
860 |
outStream spaces:indent; nextPutLine:'|'. |
|
861 |
outStream spaces:indent; nextPutAll:'+--<B>'; nextPutAll:aClass name; nextPutLine:'</B>'. |
|
862 |
aClass ~~ Object ifTrue:[ |
|
863 |
outStream cr. |
|
864 |
outStream nextPutLine:' <B>This class inherits NOTHING - most messages will lead into doesNotUnderstand:</B>' |
|
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
865 |
]. |
2016 | 866 |
indent := indent + 3. |
867 |
]. |
|
868 |
||
869 |
subs notEmpty ifTrue:[ |
|
870 |
subs do:[:aSubclass | |
|
871 |
|className| |
|
872 |
||
873 |
className := aSubclass name. |
|
874 |
outStream spaces:indent; nextPutLine:'|'. |
|
875 |
outStream spaces:indent; nextPutAll:'+--'. |
|
876 |
self generateClassDocReferenceFor:className. |
|
877 |
outStream cr. |
|
878 |
] |
|
879 |
] ifFalse:[ |
|
880 |
aClass == Object ifTrue:[ |
|
881 |
outStream spaces:indent; nextPutLine:'|'. |
|
882 |
outStream spaces:indent; nextPutLine:'+-- ... almost every other class ...' |
|
883 |
] |
|
884 |
]. |
|
885 |
||
886 |
outStream nextPutLine:'</pre>'. |
|
4404 | 887 |
|
888 |
"Modified: / 01-03-2019 / 15:52:20 / Claus Gittinger" |
|
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
889 |
! |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
890 |
|
2016 | 891 |
generateInstanceProtocolDocumentationForClass:aClass |
892 |
|shortName| |
|
893 |
||
894 |
shortName := aClass nameWithoutPrefix. |
|
895 |
instanceProtocolCategories notEmpty ifTrue:[ |
|
896 |
outStream nextPutLine:'<li><a href="#INSTANCEPROTOCOL" name="I_INSTANCEPROTOCOL">Instance protocol</a>'. |
|
897 |
outStream nextPutLine:'<ul>'. |
|
898 |
instanceProtocolCategories do:[:cat | |
|
899 |
outStream nextPutLine:'<li><a name="I_' , shortName , '_category_' , cat , '"' , |
|
900 |
' href="#' , shortName , '_category_' , cat , |
|
901 |
'">' , cat , '</a> '. |
|
902 |
]. |
|
903 |
outStream nextPutLine:'</ul>'. |
|
904 |
]. |
|
905 |
! |
|
906 |
||
907 |
generatePrivateClassInfoForClass:aClass withPrivateClasses:privateClasses |
|
908 |
outStream nextPutLine:'<pre>'. |
|
909 |
privateClasses do:[:cls | |
|
910 |
|nm fullName| |
|
911 |
||
912 |
nm := cls nameWithoutPrefix. |
|
913 |
fullName := cls name. |
|
914 |
outStream nextPutAll:' '. |
|
915 |
(cls owningClass isLoaded not |
|
916 |
or:[cls owningClass wasAutoloaded]) ifTrue:[ |
|
917 |
self |
|
918 |
generateClassDocReferenceFor:fullName |
|
919 |
text:nm |
|
920 |
autoloading:(cls owningClass name) |
|
921 |
] ifFalse:[ |
|
922 |
self |
|
923 |
generateClassDocReferenceFor:fullName |
|
924 |
text:nm. |
|
925 |
]. |
|
926 |
outStream cr. |
|
927 |
]. |
|
928 |
outStream nextPutLine:'</pre>'. |
|
929 |
! |
|
930 |
||
931 |
generateRefLineFor:ref forClass:aClass |
|
4469 | 932 |
|idx1 idx2 realRef ns nm href selString clsName| |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
933 |
|
2016 | 934 |
outStream nextPutAll:' '. |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
935 |
|
4469 | 936 |
(ref startsWith:'#') ifTrue:[ |
937 |
idx2 := (ref indexOfSeparatorStartingAt:2). |
|
938 |
idx2 == 0 ifTrue:[idx2 := ref size] ifFalse:[idx2 := idx2-1]. |
|
939 |
selString := ref copyFrom:2 to:idx2. |
|
940 |
(idx1 := ref indexOfString:'method in ' caseSensitive:false) ~~ 0 ifTrue:[ |
|
941 |
clsName := ref copyFrom:idx1 + 'method in ' size. |
|
942 |
clsName := clsName withoutSuffix:'.'. |
|
943 |
]. |
|
944 |
self generateClassDocReferenceFor:clsName |
|
945 |
text:('Implementation of: ',selString, ' in ',clsName) |
|
946 |
autoloading:nil. |
|
947 |
^ self |
|
948 |
]. |
|
949 |
||
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
950 |
idx1 := ref indexOf:$:. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
951 |
idx2 := ref indexOf:$: startingAt:idx1+1. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
952 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
953 |
(idx1 == 0 or:[idx2 == (idx1+1)]) ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
954 |
(ref includesMatchCharacters) ifTrue:[ |
2016 | 955 |
outStream nextPutAll:(self |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
956 |
anchorForHTMLDocAction: |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
957 |
('htmlClassesMatching:''' , ref , ''' backTo:nil') |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
958 |
info: |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
959 |
( 'Show documentation of ' , ref ) |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
960 |
text: |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
961 |
ref). |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
962 |
^ self |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
963 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
964 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
965 |
realRef := ref. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
966 |
((ns := aClass nameSpace) notNil and:[ns ~~ Smalltalk]) ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
967 |
ns isNameSpace ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
968 |
(ns at:realRef asSymbol) notNil ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
969 |
realRef := ns name , '::' , realRef |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
970 |
] |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
971 |
] |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
972 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
973 |
self generateClassDocReferenceFor:realRef text:ref. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
974 |
^ self |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
975 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
976 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
977 |
(ref startsWith:'http:') ifTrue:[ |
2016 | 978 |
outStream nextPutAll:'<a href="' , ref , '"><I>' , ref , '</I></a>'. |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
979 |
^ self. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
980 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
981 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
982 |
nm := (ref copyFrom:2 to:idx1-1) withoutSpaces. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
983 |
href := (ref copyFrom:(ref indexOf:$:)+1 to:(ref size - 1)) withoutSpaces. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
984 |
(href startsWith:'man:') ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
985 |
href := (href copyFrom:5) withoutSpaces. |
4450 | 986 |
outStream nextPutAll:'<a INFO="Show manual page" href="' , self pathToTopOfDocumentation , '/misc/onlyInSTX2.html" action="html:' , self className , ' manPageFor:''' , href , '''">[<I>' , nm , '</I>]</A>'. |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
987 |
^ self. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
988 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
989 |
(href startsWith:'http:') ifTrue:[ |
2016 | 990 |
outStream nextPutAll:'<a href="' , href , '">[<I>' , nm , '</I>]</a>'. |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
991 |
^ self |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
992 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
993 |
(href startsWith:'html:') ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
994 |
href := (href copyFrom:6) withoutSpaces. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
995 |
]. |
2016 | 996 |
outStream nextPutAll:'<a href="' , (self pathToDocumentationFile:href) , '">[<I>' , nm , '</I>]</a>'. |
4450 | 997 |
|
998 |
"Modified: / 28-06-2019 / 09:01:50 / Claus Gittinger" |
|
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
999 |
! |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
1000 |
|
2016 | 1001 |
generateRefLines:refLines forClass:aClass |
1002 |
outStream nextPutLine:'<pre>'. |
|
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1003 |
refLines do:[:l | |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1004 |
l isString ifTrue:[ |
2016 | 1005 |
self generateRefLineFor:l forClass:aClass. |
1006 |
outStream cr. |
|
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1007 |
] ifFalse:[ |
4469 | 1008 |
(l asString startsWith:'#') ifTrue:[ |
1009 |
self generateRefLineFor:(l asStringWith:' ') forClass:aClass. |
|
2016 | 1010 |
outStream cr. |
4469 | 1011 |
] ifFalse:[ |
1012 |
l do:[:ref | |
|
1013 |
self generateRefLineFor:ref forClass:aClass. |
|
1014 |
outStream cr. |
|
1015 |
]. |
|
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1016 |
]. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1017 |
]. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1018 |
]. |
2016 | 1019 |
outStream nextPutLine:'</pre>'. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1020 |
! |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1021 |
|
2016 | 1022 |
generateSubclassInfoForClass:aClass |
1023 |
|subs| |
|
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1024 |
|
1974 | 1025 |
subs := self shownSubclassesOf:aClass. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1026 |
|
2016 | 1027 |
outStream nextPutLine:'<pre>'. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1028 |
subs do:[:cls | |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1029 |
|nm| |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1030 |
|
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1031 |
nm := cls name. |
2016 | 1032 |
outStream nextPutAll:' '. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1033 |
cls isLoaded ifFalse:[ |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1034 |
self |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1035 |
generateClassDocReferenceFor:nm |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1036 |
text:nm |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1037 |
autoloading:nm |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1038 |
] ifTrue:[ |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1039 |
self generateClassDocReferenceFor:nm. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1040 |
]. |
2016 | 1041 |
outStream cr. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1042 |
]. |
2016 | 1043 |
outStream nextPutLine:'</pre>'. |
1973 | 1044 |
|
1974 | 1045 |
"Modified: / 05-11-2007 / 17:22:43 / cg" |
3643 | 1046 |
! ! |
1047 |
||
1048 |
!HTMLDocGenerator methodsFor:'document generation-API'! |
|
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1049 |
|
478 | 1050 |
htmlDocOf:aClass |
632 | 1051 |
"generate an HTML document string which contains a classes documentation" |
1052 |
||
4002 | 1053 |
^ self htmlDocOf:aClass theNonMetaclass back:nil backRef:nil |
478 | 1054 |
|
1055 |
" |
|
1056 |
self htmlDocOf:PostscriptPrinterStream |
|
1057 |
" |
|
1058 |
||
632 | 1059 |
"Modified: / 30.10.1997 / 13:22:19 / cg" |
478 | 1060 |
! |
1061 |
||
1062 |
htmlDocOf:aClass back:backCmd |
|
632 | 1063 |
"generate an HTML document string which contains a classes documentation" |
1064 |
||
478 | 1065 |
^ self htmlDocOf:aClass back:backCmd backRef:nil |
1066 |
||
632 | 1067 |
"Modified: / 30.10.1997 / 13:22:27 / cg" |
478 | 1068 |
! |
1069 |
||
1070 |
htmlDocOf:aClass back:backCmd backRef:backRef |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1071 |
"generate a nice HTML page from a class, with a back-reference |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1072 |
to a command or document. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1073 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1074 |
Extract sections from the classes documentation method, |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1075 |
where the following lines start a special subsection: |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1076 |
[see also:] - references to other classes and/or documents |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1077 |
[start with:] - one-liners to start a demonstration |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1078 |
[author:] - author(s) of this class |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1079 |
[warning:] - usage warnings if any |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1080 |
[hints:] - usage hints if any |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1081 |
Each section ends with an empty line - however, for formatting, |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1082 |
a line consisting of a single backslash character will be converted |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1083 |
to an empty line. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1084 |
|
632 | 1085 |
Also extract examples from the classes example method, |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1086 |
where executable examples are made from sections enclosed in: |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1087 |
[exBegin] |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1088 |
... |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1089 |
[exEnd] |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1090 |
these parts are displayed in courier and will be made executable. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1091 |
everything else is plain documentation text. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1092 |
" |
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1093 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1094 |
^ self |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1095 |
htmlDocOf:aClass |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1096 |
back:backCmd |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1097 |
backRef:backRef |
1255 | 1098 |
imagePath:(self pathToTopOfDocumentation , '/icons') |
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1099 |
! |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1100 |
|
1328 | 1101 |
htmlDocOf:aClass back:backCmdArg backRef:backRefArg imagePath:imagePathArg |
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1102 |
"generate a nice HTML page from a class, with a back-reference |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1103 |
to a command or document. |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1104 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1105 |
Extract sections from the classes documentation method, |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1106 |
where the following lines start a special subsection: |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1107 |
[see also:] - references to other classes and/or documents |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1108 |
[start with:] - one-liners to start a demonstration |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1109 |
[author:] - author(s) of this class |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1110 |
[warning:] - usage warnings if any |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1111 |
[hints:] - usage hints if any |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1112 |
Each section ends with an empty line - however, for formatting, |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1113 |
a line consisting of a single backslash character will be converted |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1114 |
to an empty line. |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1115 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1116 |
Also extract examples from the classes example method, |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1117 |
where executable examples are made from sections enclosed in: |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1118 |
[exBegin] |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1119 |
... |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1120 |
[exEnd] |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1121 |
these parts are displayed in courier and will be made executable. |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1122 |
everything else is plain documentation text. |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1123 |
" |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1124 |
|
2016 | 1125 |
|docu examples wasLoaded didLoadBin |
3643 | 1126 |
privateClasses owner ownerName shortName | |
478 | 1127 |
|
1328 | 1128 |
backRef := backRefArg. |
1129 |
backCmd := backCmdArg. |
|
1130 |
imagePath := imagePathArg. |
|
1131 |
||
600 | 1132 |
aClass isNil ifTrue:[ |
1133 |
^ '' "/ just in case ... |
|
1134 |
]. |
|
1135 |
||
2016 | 1136 |
outStream := '' writeStream. |
1328 | 1137 |
shortName := aClass nameWithoutPrefix. |
2016 | 1138 |
|
1139 |
self generateHTMLHeadWithTitle:('Class: ' , aClass name). |
|
1328 | 1140 |
self generateBODYStart. |
1141 |
self generateBackButton. |
|
1142 |
||
1896
ed785b09f5b1
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
1435
diff
changeset
|
1143 |
(aClass isRealNameSpace) ifTrue:[ |
2016 | 1144 |
outStream |
1145 |
nextPutLine:'<h1>'; |
|
1146 |
nextPutAll:'NameSpace: '; |
|
1147 |
nextPutLine:(shortName); |
|
1148 |
nextPutLine:'</h1>'. |
|
1328 | 1149 |
self generateBODYandHTMLEnd. |
2016 | 1150 |
^ outStream contents. |
1328 | 1151 |
]. |
1152 |
||
478 | 1153 |
(wasLoaded := aClass isLoaded) ifFalse:[ |
1154 |
"/ load it - but not a binary |
|
1155 |
didLoadBin := Smalltalk loadBinaries. |
|
1156 |
Smalltalk loadBinaries:false. |
|
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1157 |
[ |
1256 | 1158 |
Autoload autoloadFailedSignal handle:[:ex | |
1309 | 1159 |
^ 'Autoload of ' , aClass name , ' failed - no documentation available.' |
1256 | 1160 |
] do:[ |
1161 |
aClass autoload. |
|
1162 |
]. |
|
1140
96ccc944d23a
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
1163 |
] ensure:[ |
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1164 |
didLoadBin ifTrue:[Smalltalk loadBinaries:true]. |
1256 | 1165 |
]. |
478 | 1166 |
]. |
1167 |
||
499 | 1168 |
owner := aClass owningClass. |
569 | 1169 |
privateClasses := aClass privateClassesSorted. |
499 | 1170 |
|
2016 | 1171 |
docu := self extractDocumentationFromClass:aClass. |
1172 |
"/ refLines, demoLines etc. are generated as a side effect. |
|
1173 |
||
1174 |
examples := self extractExamplesFromClass:aClass. |
|
1175 |
||
1176 |
self extractProtocolCategoriesFrom:aClass. |
|
1177 |
||
1178 |
outStream nextPutLine:'<h1>'. |
|
1179 |
outStream nextPutAll:'Class: '. |
|
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
1180 |
|
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
1181 |
self generatingForSTXBrowser ifTrue:[ |
2016 | 1182 |
outStream |
1183 |
nextPutAll:'<a INFO="Open a Browser on ' , shortName , '" type="example" action="Smalltalk browseInClass:' , aClass name , '">'; |
|
1184 |
nextPutAll:shortName; nextPutLine:'</a>'. |
|
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
1185 |
] ifFalse:[ |
2016 | 1186 |
outStream nextPutAll:shortName. |
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
1187 |
]. |
499 | 1188 |
owner notNil ifTrue:[ |
3643 | 1189 |
ownerName := owner nameWithoutPrefix. |
2016 | 1190 |
outStream nextPutAll:' (private in '. |
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
1191 |
self generatingForSTXBrowser ifTrue:[ |
2016 | 1192 |
outStream |
3643 | 1193 |
nextPutAll:'<a INFO="Open a Browser on ' , ownerName , '" type="example" action="Smalltalk browseInClass:' , owner name , '">'; |
1194 |
nextPutAll:(ownerName); nextPutLine:'</a>)'. |
|
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
1195 |
] ifFalse:[ |
3643 | 1196 |
outStream nextPutAll:ownerName. |
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
1197 |
]. |
523 | 1198 |
] ifFalse:[ |
1199 |
aClass nameSpace ~~ Smalltalk ifTrue:[ |
|
2016 | 1200 |
outStream nextPutAll:' (in ' , aClass nameSpace name , ')' |
523 | 1201 |
] |
499 | 1202 |
]. |
2016 | 1203 |
outStream nextPutLine:'</h1>'. |
478 | 1204 |
|
499 | 1205 |
owner notNil ifTrue:[ |
2016 | 1206 |
outStream nextPutLine:'This class is only visible from within'. |
3643 | 1207 |
outStream nextPutAll:ownerName. |
499 | 1208 |
owner owningClass notNil ifTrue:[ |
2016 | 1209 |
outStream nextPutAll:' (which is itself a private class of '. |
1210 |
outStream nextPutAll:owner owningClass nameWithoutPrefix. |
|
1211 |
outStream nextPutAll:')' |
|
499 | 1212 |
]. |
2016 | 1213 |
outStream nextPutLine:'.' |
499 | 1214 |
]. |
1215 |
||
478 | 1216 |
"/ |
1217 |
"/ index |
|
1218 |
"/ |
|
1219 |
"/ s nextPutAll:'Index:'; cr. |
|
2016 | 1220 |
outStream nextPutLine:'<ul>'. |
1221 |
outStream nextPutLine:'<li><a href="#INHERITANCE" name="I_INHERITANCE">Inheritance</a>'. |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1222 |
|
478 | 1223 |
docu notNil ifTrue:[ |
2016 | 1224 |
outStream nextPutLine:'<li><a href="#DESCRIPTION" name="I_DESCRIPTION">Description</a>'. |
478 | 1225 |
]. |
2016 | 1226 |
warnLines notEmptyOrNil ifTrue:[ |
1227 |
outStream nextPutLine:'<li><a href="#WARNING" name="I_WARNING">Warning</a>'. |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1228 |
]. |
2016 | 1229 |
hintLines notEmptyOrNil ifTrue:[ |
1230 |
outStream nextPutLine:'<li><a href="#HINTS" name="I_HINTS">Hints</a>'. |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1231 |
]. |
478 | 1232 |
refLines notNil ifTrue:[ |
2016 | 1233 |
outStream nextPutLine:'<li><a href="#SEEALSO" name="I_SEEALSO">Related information</a>'. |
478 | 1234 |
]. |
1235 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1236 |
"/ s nextPutLine:'<li><a href="#INSTANCEVARIABLES" name="I_INSTANCEVARIABLES">Instance variables</a>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1237 |
"/ s nextPutLine:'<li><a href="#CLASSVARIABLES" name="I_CLASSVARIABLES">Class variables</a>'. |
478 | 1238 |
|
2016 | 1239 |
self generateClassProtocolDocumentationForClass:aClass. |
1240 |
self generateInstanceProtocolDocumentationForClass:aClass. |
|
1241 |
||
1242 |
privateClasses notEmptyOrNil ifTrue:[ |
|
499 | 1243 |
privateClasses := privateClasses asOrderedCollection sort:[:a :b | a nameWithoutPrefix < b nameWithoutPrefix]. |
2016 | 1244 |
outStream nextPutLine:'<li><a href="#PRIVATECLASSES" name="I_PRIVATECLASSES">Private classes</a>'. |
499 | 1245 |
]. |
1246 |
||
478 | 1247 |
(aClass == Object or:[aClass == Autoload]) ifTrue:[ |
2016 | 1248 |
outStream nextPutLine:'<li><a href="#SUBCLASSES" name="I_SUBCLASSES">Subclasses</a>'. |
478 | 1249 |
]. |
1250 |
demoLines notNil ifTrue:[ |
|
2016 | 1251 |
outStream nextPutLine:'<li><a href="#DEMOSTARTUP" name="I_DEMOSTARTUP">Demonstration</a>'. |
478 | 1252 |
]. |
1253 |
examples notNil ifTrue:[ |
|
2016 | 1254 |
outStream nextPutLine:'<li><a href="#EXAMPLES" name="I_EXAMPLES">Examples</a>'. |
478 | 1255 |
]. |
2016 | 1256 |
outStream nextPutLine:'</ul>'. |
1249 | 1257 |
self generateHorizontalLine. |
478 | 1258 |
|
1259 |
"/ |
|
1260 |
"/ hierarchy |
|
1261 |
"/ |
|
2016 | 1262 |
self generateInheritanceTreeForClass:aClass. |
1249 | 1263 |
self generateHorizontalLine. |
478 | 1264 |
|
1265 |
"/ |
|
1266 |
"/ category, version & package |
|
1267 |
"/ |
|
2016 | 1268 |
self generateClassInfoForClass:aClass. |
1249 | 1269 |
self generateHorizontalLine. |
478 | 1270 |
|
2016 | 1271 |
self generateDescription:docu. |
478 | 1272 |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1273 |
warnLines notNil ifTrue:[ |
2016 | 1274 |
outStream nextPutLine:'<h2><a name="WARNING" href="#I_WARNING">Warning:</A></h2>'. |
1275 |
outStream nextPutLine:'<BR>'. |
|
1276 |
||
1277 |
outStream nextPutLine:'<pre>'. |
|
1278 |
||
1279 |
warnLines := self undentedToFirstLinesIndent:warnLines. |
|
2865 | 1280 |
outStream nextPutAllLines:warnLines. |
2016 | 1281 |
outStream nextPutLine:'</pre>'. |
1249 | 1282 |
self generateHorizontalLine. |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1283 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1284 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1285 |
hintLines notNil ifTrue:[ |
2016 | 1286 |
outStream nextPutLine:'<h2><a name="HINTS" href="#I_HINTS">Hints:</A></h2>'. |
1287 |
outStream nextPutLine:'<BR>'. |
|
1288 |
||
1289 |
outStream nextPutLine:'<pre>'. |
|
1290 |
hintLines := self undentedToFirstLinesIndent:hintLines. |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1291 |
|
2865 | 1292 |
outStream nextPutAllLines:hintLines. |
2016 | 1293 |
outStream nextPutLine:'</pre>'. |
1249 | 1294 |
self generateHorizontalLine. |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1295 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1296 |
|
478 | 1297 |
"/ |
1298 |
"/ see also |
|
1299 |
"/ |
|
1300 |
refLines notNil ifTrue:[ |
|
2016 | 1301 |
outStream nextPutLine:'<h2><a name="SEEALSO" href="#I_SEEALSO">Related information:</A></h2>'. |
1302 |
self generateRefLines:refLines forClass:aClass. |
|
1249 | 1303 |
self generateHorizontalLine. |
478 | 1304 |
]. |
1305 |
||
1306 |
||
1307 |
"/ |
|
1308 |
"/ inst & classVars |
|
1309 |
"/ to be added |
|
1310 |
||
1311 |
||
1312 |
"/ |
|
1313 |
"/ protocol |
|
1314 |
"/ |
|
2016 | 1315 |
self printOutHTMLProtocolOf:aClass on:outStream. |
478 | 1316 |
|
1317 |
"/ |
|
1318 |
"/ subclasses (only for Object and Autoload) |
|
1319 |
"/ |
|
1320 |
(aClass == Object or:[aClass == Autoload]) ifTrue:[ |
|
2016 | 1321 |
outStream nextPutLine:'<h2><a name="SUBCLASSES" href="#I_SUBCLASSES">Subclasses (direct subclasses only):</A></h2>'. |
1322 |
self generateSubclassInfoForClass:aClass. |
|
1249 | 1323 |
self generateHorizontalLine. |
478 | 1324 |
]. |
1325 |
||
1326 |
"/ |
|
499 | 1327 |
"/ private classes |
1328 |
"/ |
|
2016 | 1329 |
privateClasses notEmptyOrNil ifTrue:[ |
1330 |
outStream nextPutLine:'<h2><a name="PRIVATECLASSES" href="#I_PRIVATECLASSES">Private classes:</A></h2>'. |
|
1331 |
self generatePrivateClassInfoForClass:aClass withPrivateClasses:privateClasses. |
|
1249 | 1332 |
self generateHorizontalLine. |
499 | 1333 |
]. |
1334 |
||
2016 | 1335 |
"/ demonstration, if there are any |
478 | 1336 |
demoLines notNil ifTrue:[ |
2016 | 1337 |
self generateDemo. |
1249 | 1338 |
self generateHorizontalLine. |
478 | 1339 |
]. |
1340 |
||
2016 | 1341 |
"/ examples, if there are any |
478 | 1342 |
examples notNil ifTrue:[ |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1343 |
self generateExamples:examples. |
478 | 1344 |
]. |
1345 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1346 |
self generateBODYandHTMLEnd. |
478 | 1347 |
|
1348 |
wasLoaded ifFalse:[ |
|
1349 |
aClass unload |
|
1350 |
]. |
|
1351 |
||
2016 | 1352 |
^ outStream contents |
478 | 1353 |
|
1354 |
" |
|
1355 |
self htmlDocOf:Object |
|
1356 |
self htmlDocOf:Array |
|
1357 |
self htmlDocOf:Filename |
|
1358 |
self htmlDocOf:Block |
|
1359 |
" |
|
1360 |
||
1896
ed785b09f5b1
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
1435
diff
changeset
|
1361 |
"Created: / 24-04-1996 / 15:01:59 / cg" |
2865 | 1362 |
"Modified: / 27-07-2012 / 09:29:45 / cg" |
478 | 1363 |
! |
1364 |
||
1365 |
htmlDocOf:aClass backRef:backRef |
|
632 | 1366 |
"generate an HTML document string which contains a classes documentation" |
1367 |
||
478 | 1368 |
^ self htmlDocOf:aClass back:nil backRef:backRef |
1369 |
||
632 | 1370 |
"Created: / 24.4.1996 / 15:03:25 / cg" |
1371 |
"Modified: / 30.10.1997 / 13:23:12 / cg" |
|
478 | 1372 |
! |
1373 |
||
1374 |
htmlDocOfImplementorsOf:selector |
|
632 | 1375 |
"generate an HTML document string which contains HREFS |
1376 |
to all implementors of a particular selector" |
|
1377 |
||
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1378 |
|sel s classes| |
478 | 1379 |
|
1249 | 1380 |
sel := self withSpecialHTMLCharactersEscaped:selector. |
478 | 1381 |
|
1249 | 1382 |
outStream := s := '' writeStream. |
478 | 1383 |
|
1249 | 1384 |
self generateHTMLHeadWithTitle:('Implementations of: ' , sel). |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1385 |
self generateBODYStart. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1386 |
|
1249 | 1387 |
self generateUpArrowButtonForTop. |
1388 |
self generateHorizontalLine. |
|
1389 |
self generateH1:sel. |
|
478 | 1390 |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1391 |
s nextPutLine:'<dl>'. |
478 | 1392 |
|
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1393 |
classes := IdentitySet new. |
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1394 |
|
478 | 1395 |
sel := selector asSymbol. |
1249 | 1396 |
Smalltalk allClassesAndMetaclassesDo:[:cls | |
499 | 1397 |
cls isPrivate ifFalse:[ |
1138
aa7687ec256f
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1398 |
(cls includesSelector:sel) ifTrue:[ |
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1399 |
classes add:cls |
499 | 1400 |
] |
478 | 1401 |
] |
1402 |
]. |
|
1403 |
||
1249 | 1404 |
(classes asOrderedCollection sort:[:a :b | a name < b name]) |
1405 |
do:[:cls | |
|
1406 |
self |
|
1407 |
printOutHTMLMethodProtocol:(cls compiledMethodAt:sel) |
|
1408 |
on:s |
|
1409 |
showClassName:true |
|
1410 |
classRef:true. |
|
1411 |
s nextPutLine:'<p>'. |
|
1412 |
]. |
|
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1413 |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1414 |
s nextPutLine:'</dl>'. |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1415 |
self generateBODYandHTMLEnd. |
478 | 1416 |
|
1417 |
^ s contents |
|
1418 |
||
632 | 1419 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1420 |
"Modified: / 30.10.1998 / 22:15:30 / cg" |
478 | 1421 |
! |
1422 |
||
1435 | 1423 |
htmlDocOfImplementorsOfAnyMatching:selectorPattern |
1424 |
"generate an HTML document string which contains HREFS |
|
1425 |
to all implementors of a particular selector" |
|
1426 |
||
1427 |
|s sel classes| |
|
1428 |
||
1429 |
outStream := s := '' writeStream. |
|
1430 |
||
1431 |
sel := self withSpecialHTMLCharactersEscaped:selectorPattern. |
|
1432 |
self generateHTMLHeadWithTitle:('Implementations of: ' , sel). |
|
1433 |
self generateBODYStart. |
|
1434 |
||
1435 |
self generateUpArrowButtonForTop. |
|
1436 |
self generateHorizontalLine. |
|
1437 |
||
1438 |
self generateH1:sel. |
|
1439 |
||
1440 |
s nextPutLine:'<dl>'. |
|
1441 |
||
1442 |
classes := IdentitySet new. |
|
1443 |
||
1444 |
Smalltalk allClassesAndMetaclassesDo:[:cls | |
|
1445 |
cls isPrivate ifFalse:[ |
|
1446 |
(cls methodDictionary keys contains:[:sel | selectorPattern match:sel]) ifTrue:[ |
|
1447 |
classes add:cls |
|
1448 |
] |
|
1449 |
] |
|
1450 |
]. |
|
1451 |
||
1452 |
(classes asOrderedCollection sort:[:a :b | a name < b name]) |
|
1453 |
do:[:cls | |
|
1454 |
cls methodDictionary keys do:[:eachSel | |
|
1455 |
(selectorPattern match:eachSel) ifTrue:[ |
|
1456 |
self |
|
1457 |
printOutHTMLMethodProtocol:(cls compiledMethodAt:eachSel) |
|
1458 |
on:s |
|
1459 |
showClassName:true |
|
1460 |
classRef:true. |
|
1461 |
s nextPutLine:'<p>'. |
|
1462 |
]. |
|
1463 |
]. |
|
1464 |
]. |
|
1465 |
||
1466 |
s nextPutLine:'</dl>'. |
|
1467 |
self generateBODYandHTMLEnd. |
|
1468 |
||
1469 |
^ s contents |
|
3643 | 1470 |
! |
1471 |
||
1472 |
htmlOfflineDocOf:aClass |
|
1473 |
"generate an HTML document string which contains a class's documentation for offline reading. |
|
1474 |
Offline reading means that the links to other classes are created as file links, |
|
1475 |
(as opposed to action links, which only work with the builtin doc reader)." |
|
1476 |
||
1477 |
generateDocumentForOfflineReading := true. |
|
1478 |
^ self |
|
1479 |
htmlDocOf:aClass back:nil backRef:nil |
|
1480 |
imagePath:(self pathToTopOfDocumentation , '/icons') |
|
1481 |
||
1482 |
" |
|
1483 |
self htmlOfflineDocOf:PostscriptPrinterStream |
|
1484 |
" |
|
1251 | 1485 |
! ! |
1486 |
||
1280 | 1487 |
!HTMLDocGenerator methodsFor:'document generation-helpers'! |
1251 | 1488 |
|
2016 | 1489 |
extractAndRemoveSpecial:pattern from:docu |
1490 |
"given a collection of docu lines (from documentation methods comment), |
|
1491 |
extract things like [see also:], [author:] etc. |
|
1492 |
If found, remove the lines from the string collection, |
|
1493 |
and return the extracted ones. Otherwise return nil. |
|
1494 |
Attention: docu is sideeffectively changed (lines removed)" |
|
1495 |
||
1496 |
|srchIdx idx lines l| |
|
1497 |
||
1498 |
srchIdx := docu findFirst:[:l | l asLowercase withoutSeparators = pattern]. |
|
1499 |
srchIdx ~~ 0 ifTrue:[ |
|
1500 |
lines := OrderedCollection new. |
|
1501 |
||
1502 |
idx := srchIdx+1. |
|
1503 |
[idx <= docu size] whileTrue:[ |
|
1504 |
l := docu at:idx. |
|
1505 |
(l isNil or:[l withoutSeparators size == 0]) ifTrue:[ |
|
1506 |
idx := docu size + 1. |
|
1507 |
] ifFalse:[ |
|
1508 |
l withoutSeparators = '\' ifTrue:[ |
|
1509 |
l := '' |
|
1510 |
]. |
|
1511 |
lines add:l |
|
1512 |
]. |
|
1513 |
idx := idx + 1. |
|
1514 |
]. |
|
1515 |
||
1516 |
docu removeFromIndex:srchIdx toIndex:srchIdx+lines size |
|
1517 |
]. |
|
1518 |
^ lines |
|
1519 |
||
1520 |
"Created: 25.4.1996 / 14:16:01 / cg" |
|
1521 |
"Modified: 11.1.1997 / 13:03:38 / cg" |
|
1522 |
! |
|
1523 |
||
1524 |
extractAndRemoveSpecialLinesFromDocumentation:docu |
|
1525 |
"Extract things like [see also:], [author:] etc. from docu |
|
1526 |
If found, remove the lines from the string collection, |
|
1527 |
and leave them in corresponding instVars. |
|
1528 |
Attention: docu is sideeffectively changed (lines removed)" |
|
1529 |
||
1530 |
"/ |
|
1531 |
"/ search for a [see also:] section |
|
1532 |
"/ |
|
1533 |
refLines := self extractAndRemoveSpecial:'[see also:]' from:docu. |
|
1534 |
refLines notNil ifTrue:[ |
|
1535 |
"/ care for the special tuple format |
|
1536 |
refLines := refLines collect:[:l | |
|
1537 |
|t| |
|
1538 |
||
1539 |
((t := l withoutSeparators) startsWith:'(') ifTrue:[ |
|
1540 |
t |
|
1541 |
] ifFalse:[ |
|
1542 |
t := l asCollectionOfWords. |
|
1543 |
(t size == 1 |
|
1544 |
and:[ (t first includes:$:) not ]) ifTrue:[ |
|
1545 |
t first |
|
1546 |
] ifFalse:[ |
|
1547 |
t |
|
1548 |
] |
|
1549 |
] |
|
1550 |
]. |
|
1551 |
]. |
|
1552 |
||
1553 |
||
1554 |
"/ |
|
1555 |
"/ search for a [start with:] section |
|
1556 |
"/ |
|
1557 |
demoLines := self extractAndRemoveSpecial:'[start with:]' from:docu. |
|
1558 |
||
1559 |
"/ |
|
1560 |
"/ search for a [author:] section |
|
1561 |
"/ |
|
1562 |
authorLines := self extractAndRemoveSpecial:'[author:]' from:docu. |
|
1563 |
authorLines isNil ifTrue:[ |
|
1564 |
authorLines := self extractAndRemoveSpecial:'[authors:]' from:docu. |
|
1565 |
]. |
|
1566 |
||
1567 |
"/ |
|
1568 |
"/ search for a [warning:] section |
|
1569 |
"/ |
|
1570 |
warnLines := self extractAndRemoveSpecial:'[warning:]' from:docu. |
|
1571 |
warnLines notNil ifTrue:[ |
|
1572 |
warnLines := warnLines asStringCollection. |
|
1573 |
]. |
|
1574 |
||
1575 |
"/ |
|
1576 |
"/ search for a [hints:] section |
|
1577 |
"/ |
|
1578 |
hintLines := self extractAndRemoveSpecial:'[hints:]' from:docu. |
|
1579 |
hintLines isNil ifTrue:[ |
|
1580 |
hintLines := self extractAndRemoveSpecial:'[hint:]' from:docu. |
|
1581 |
]. |
|
1582 |
hintLines notNil ifTrue:[ |
|
1583 |
hintLines := hintLines asStringCollection. |
|
1584 |
]. |
|
1585 |
! |
|
1586 |
||
1587 |
extractDocumentationFromClass:aClass |
|
1588 |
|documentationMethod docu| |
|
1589 |
||
1590 |
documentationMethod := aClass theMetaclass compiledMethodAt:#documentation. |
|
1591 |
documentationMethod notNil ifTrue:[ |
|
1592 |
docu := documentationMethod comment. |
|
1593 |
] ifFalse:[ |
|
1594 |
"try comment" |
|
1595 |
docu := aClass theNonMetaclass comment. |
|
1596 |
]. |
|
1597 |
docu isEmptyOrNil ifTrue:[ ^ nil ]. |
|
1598 |
||
1599 |
docu := self withSpecialHTMLCharactersEscaped:docu. |
|
1600 |
docu := docu asStringCollection. |
|
1601 |
||
1602 |
self extractAndRemoveSpecialLinesFromDocumentation:docu. |
|
1603 |
||
1604 |
docu notEmpty ifTrue:[ |
|
1605 |
"/ |
|
1606 |
"/ strip off empty lines |
|
1607 |
"/ |
|
1608 |
[docu notEmpty and:[ docu first size == 0]] whileTrue:[ |
|
1609 |
docu removeFirst |
|
1610 |
]. |
|
1611 |
[docu notEmpty and:[ docu last size == 0]] whileTrue:[ |
|
1612 |
docu removeLast |
|
1613 |
]. |
|
1614 |
]. |
|
1615 |
||
1616 |
docu notEmpty ifTrue:[ |
|
1617 |
docu := self undentedToFirstLinesIndent:docu. |
|
1618 |
]. |
|
1619 |
docu := docu asString. |
|
1620 |
^ docu |
|
1621 |
! |
|
1622 |
||
1623 |
extractExamplesFromClass:aClass |
|
4484 | 1624 |
|m examples lines makePre isHtml| |
2016 | 1625 |
|
1626 |
m := aClass theMetaclass compiledMethodAt:#examples. |
|
1627 |
m isNil ifTrue:[ ^ nil]. |
|
1628 |
||
1629 |
examples := m comment. |
|
1630 |
examples isEmptyOrNil ifTrue:[ ^ nil]. |
|
1631 |
||
4484 | 1632 |
makePre := isHtml := false. |
1633 |
lines := examples asStringCollection. |
|
1634 |
(lines first withoutSeparators = '<pre>') ifTrue:[ |
|
1635 |
makePre := true. |
|
1636 |
lines removeFirst. |
|
1637 |
(lines last withoutSeparators = '</pre>') ifTrue:[ |
|
1638 |
lines removeLast. |
|
1639 |
]. |
|
1640 |
examples := lines asString. |
|
1641 |
] ifFalse:[ |
|
1642 |
(lines first withoutSeparators = '<html>') ifTrue:[ |
|
1643 |
(lines last withoutSeparators = '</html>') ifTrue:[ |
|
1644 |
lines removeLast. |
|
1645 |
]. |
|
1646 |
^ lines |
|
1647 |
]. |
|
1648 |
]. |
|
1649 |
||
2016 | 1650 |
examples := self withSpecialHTMLCharactersEscaped:examples. |
1651 |
examples := examples asStringCollection. |
|
1652 |
||
1653 |
"/ |
|
1654 |
"/ strip off empty lines |
|
1655 |
"/ |
|
3625 | 1656 |
[examples notEmpty and:[examples first isEmptyOrNil]] whileTrue:[ |
2252
cd22e5433333
changed: #extractExamplesFromClass:
Stefan Vogel <sv@exept.de>
parents:
2205
diff
changeset
|
1657 |
examples removeFirst. |
2016 | 1658 |
]. |
3625 | 1659 |
[examples notEmpty and:[examples last isEmptyOrNil]] whileTrue:[ |
2252
cd22e5433333
changed: #extractExamplesFromClass:
Stefan Vogel <sv@exept.de>
parents:
2205
diff
changeset
|
1660 |
examples removeLast. |
2016 | 1661 |
]. |
1662 |
||
1663 |
examples isEmpty ifTrue:[ ^ nil]. |
|
4484 | 1664 |
makePre ifTrue:[ |
1665 |
examples addFirst:'<pre>'. |
|
1666 |
examples addLast:'</pre>'. |
|
1667 |
^ examples |
|
1668 |
] ifFalse:[ |
|
1669 |
^ self undentedToFirstLinesIndent:examples. |
|
1670 |
]. |
|
2016 | 1671 |
! |
1672 |
||
1673 |
extractProtocolCategoriesFrom:aClass |
|
4247 | 1674 |
classProtocolCategories := aClass theMetaclass methodCategories asSortedCollection. |
2016 | 1675 |
classProtocolCategories notEmpty ifTrue:[ |
1676 |
classProtocolCategories := classProtocolCategories asSortedCollection. |
|
1677 |
classProtocolCategories remove:'documentation' ifAbsent:nil. |
|
1678 |
]. |
|
4247 | 1679 |
instanceProtocolCategories := aClass theNonMetaclass methodCategories asSortedCollection. |
2016 | 1680 |
instanceProtocolCategories notEmpty ifTrue:[ |
1681 |
instanceProtocolCategories := instanceProtocolCategories asSortedCollection. |
|
1682 |
]. |
|
4247 | 1683 |
|
1684 |
"Modified: / 05-07-2017 / 10:51:25 / cg" |
|
2016 | 1685 |
! |
1686 |
||
3625 | 1687 |
htmlForMethod:arg |
1688 |
^ self class htmlForMethod:arg |
|
1973 | 1689 |
! |
1690 |
||
1251 | 1691 |
htmlRevisionDocOf:aClass to:s |
1692 |
"extract a classes versionInfo and return an HTML document string |
|
1693 |
for that." |
|
1694 |
||
1695 |
|revInfo pckgInfo text path| |
|
1696 |
||
1697 |
revInfo := aClass revisionInfo. |
|
1698 |
pckgInfo := aClass packageSourceCodeInfo. |
|
1699 |
||
1700 |
s nextPutLine:'<dl><dt><a name="VERSION"><b>Version:</b></A>'. |
|
1701 |
||
1702 |
(revInfo isNil and:[pckgInfo isNil]) ifTrue:[ |
|
1703 |
s nextPutLine:'<dd>no revision info'. |
|
1704 |
] ifFalse:[ |
|
1705 |
||
1706 |
revInfo isNil ifTrue:[revInfo := IdentityDictionary new]. |
|
1707 |
pckgInfo isNil ifTrue:[pckgInfo := IdentityDictionary new]. |
|
1708 |
||
1709 |
s nextPutLine:'<dd>rev: <b>'. |
|
1710 |
||
1711 |
"/ fetch the revision-info; prefer revisionInfo |
|
1712 |
text := revInfo at:#revision ifAbsent:(pckgInfo at:#revision ifAbsent:'?'). |
|
1713 |
s nextPutLine:text. |
|
1714 |
||
1715 |
"/ fetch the date & time; prefer revisionInfo |
|
1716 |
text := revInfo at:#date ifAbsent:(pckgInfo at:#date ifAbsent:'?'). |
|
1717 |
s nextPutAll:'</b> date: <b>' , text. |
|
1718 |
text := revInfo at:#time ifAbsent:(pckgInfo at:#time ifAbsent:'?'). |
|
1719 |
s nextPutLine:' ', text , '</b>'. |
|
1720 |
||
1721 |
text := revInfo at:#user ifAbsent:(pckgInfo at:#user ifAbsent:'?'). |
|
1722 |
s nextPutLine:'<dd>user: <b>' , text , '</b>'. |
|
1723 |
||
1724 |
text := revInfo at:#fileName ifAbsent:(pckgInfo at:#fileNamer ifAbsent:'?'). |
|
1725 |
s nextPutAll:'<dd>file: <b>' , text. |
|
1726 |
||
1727 |
text := revInfo at:#directory ifAbsent:(pckgInfo at:#directory ifAbsent:nil). |
|
1728 |
text isNil ifTrue:[ |
|
1729 |
path := revInfo at:#repositoryPathName ifAbsent:(pckgInfo at:#repositoryPathName ifAbsent:nil). |
|
1730 |
path notNil ifTrue:[ |
|
1731 |
SourceCodeManager notNil ifTrue:[ |
|
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
1732 |
text := SourceCodeManager directoryFromContainerPath:path forClass:aClass. |
1251 | 1733 |
]. |
1734 |
text isNil ifTrue:[text := '?']. |
|
1735 |
] ifFalse:[ |
|
1736 |
text := '?' |
|
1737 |
] |
|
1738 |
]. |
|
1739 |
s nextPutLine:'</b> directory: <b>' , text , '</b>'. |
|
1740 |
||
1741 |
text := revInfo at:#module ifAbsent:(pckgInfo at:#module ifAbsent:nil). |
|
1742 |
text isNil ifTrue:[ |
|
1743 |
path := revInfo at:#repositoryPathName ifAbsent:(pckgInfo at:#repositoryPathName ifAbsent:nil). |
|
1744 |
path notNil ifTrue:[ |
|
1745 |
SourceCodeManager notNil ifTrue:[ |
|
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
1746 |
text := SourceCodeManager moduleFromContainerPath:path forClass:aClass. |
1251 | 1747 |
]. |
1748 |
text isNil ifTrue:[text := '?']. |
|
1749 |
] ifFalse:[ |
|
1750 |
text := '?' |
|
1751 |
] |
|
1752 |
]. |
|
1753 |
s nextPutAll:'<dd>module: <b>' , text. |
|
1754 |
||
1755 |
text := revInfo at:#library ifAbsent:(pckgInfo at:#library ifAbsent:'*none*'). |
|
1756 |
s nextPutLine:'</b> stc-classLibrary: <b>' , text , '</b>'. |
|
1757 |
]. |
|
1758 |
||
1759 |
"Created: / 8.1.1997 / 13:43:28 / cg" |
|
1760 |
"Modified: / 30.10.1997 / 13:24:39 / cg" |
|
478 | 1761 |
! |
1762 |
||
1763 |
printOutHTMLCategoryProtocol:aCategory of:aClass on:aStream |
|
632 | 1764 |
"append documentation on each method in a particular methodCategory |
1765 |
of the given class in HTML onto aStream." |
|
1766 |
||
523 | 1767 |
|any dict selectors methods shortName| |
1768 |
||
1769 |
shortName := aClass nameWithoutPrefix. |
|
478 | 1770 |
|
1771 |
dict := aClass methodDictionary. |
|
1772 |
||
1773 |
dict notNil ifTrue:[ |
|
1774 |
any := false. |
|
1775 |
dict do:[:aMethod | |
|
1776 |
(aCategory = aMethod category) ifTrue:[ |
|
1777 |
any := true |
|
1778 |
] |
|
1779 |
]. |
|
1780 |
||
1781 |
any ifTrue:[ |
|
523 | 1782 |
aStream nextPutLine:'<a name="' , shortName , '_category_' , aCategory , |
1783 |
'" href="#I_' , shortName , '_category_' , aCategory , |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1784 |
'"><b>' , aCategory , '</b></A>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1785 |
aStream nextPutLine:'<dl>'. |
478 | 1786 |
|
1787 |
selectors := dict keys asArray. |
|
1788 |
methods := dict values. |
|
1789 |
selectors sortWith:methods. |
|
1790 |
methods do:[:aMethod | |
|
1791 |
(aCategory = aMethod category) ifTrue:[ |
|
1216
b854fdc89d2a
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
1178
diff
changeset
|
1792 |
Error catch:[ |
478 | 1793 |
self printOutHTMLMethodProtocol:aMethod on:aStream. |
1794 |
]. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1795 |
aStream nextPutLine:'<p>'. |
478 | 1796 |
] |
1797 |
]. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1798 |
aStream nextPutLine:'</dl>'. |
478 | 1799 |
] |
1800 |
] |
|
1801 |
||
1802 |
" |
|
1803 |
self printOutHTMLProtocolOf:Float on:Stdout |
|
1804 |
" |
|
1805 |
||
632 | 1806 |
"Created: / 22.4.1996 / 20:03:30 / cg" |
1807 |
"Modified: / 5.6.1996 / 13:41:27 / stefan" |
|
1808 |
"Modified: / 30.10.1997 / 13:27:58 / cg" |
|
478 | 1809 |
! |
1810 |
||
1811 |
printOutHTMLMethodProtocol:aMethod on:aStream |
|
4263 | 1812 |
"given the source in aString, print the method's message specification |
478 | 1813 |
and any method comments - without source; used to generate documentation |
1814 |
pages" |
|
1815 |
||
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1816 |
^ self |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1817 |
printOutHTMLMethodProtocol:aMethod |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1818 |
on:aStream |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1819 |
showClassName:false |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1820 |
classRef:false |
478 | 1821 |
|
4263 | 1822 |
"Modified: / 22-04-1996 / 18:01:56 / cg" |
1823 |
"Created: / 22-04-1996 / 20:03:30 / cg" |
|
1824 |
"Modified (comment): / 21-11-2017 / 13:01:48 / cg" |
|
478 | 1825 |
! |
1826 |
||
1827 |
printOutHTMLMethodProtocol:aMethod on:aStream showClassName:showClassName classRef:withClassRef |
|
4263 | 1828 |
"given the source in aString, print the method's message specification |
478 | 1829 |
and any method comments - without source; used to generate documentation |
1830 |
pages" |
|
1831 |
||
1344 | 1832 |
|p| |
1833 |
||
1834 |
"/ p := imagePath. |
|
1835 |
"/ p isNil ifTrue:[ |
|
1836 |
"/ p := self pathToTopOfDocumentation , '/icons' |
|
1837 |
"/ ]. |
|
1838 |
p := self pathToTopOfDocumentation , '/pictures'. |
|
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1839 |
^ self |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1840 |
printOutHTMLMethodProtocol:aMethod |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1841 |
on:aStream |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1842 |
showClassName:showClassName |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1843 |
classRef:withClassRef |
1344 | 1844 |
picturePath:p |
4263 | 1845 |
|
1846 |
"Modified (comment): / 21-11-2017 / 13:01:53 / cg" |
|
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1847 |
! |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1848 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1849 |
printOutHTMLMethodProtocol:aMethod on:aStream showClassName:showClassName classRef:withClassRef picturePath:picturePath |
3625 | 1850 |
"given the source in aString, print the method's message specification |
1851 |
and any method comments - without source. |
|
1852 |
used to generate documentation pages" |
|
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1853 |
|
1973 | 1854 |
|comment cls sel who methodSpecLine |
478 | 1855 |
firstIndent firstNonEmpty isSubres isObsolete smallOrEmpty |
3625 | 1856 |
ballColor anchorName parseTree expr obsoleteInfo |
1857 |
exampleComments isInheritedComment| |
|
478 | 1858 |
|
1859 |
who := aMethod who. |
|
505
d8d7556d05ee
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1860 |
cls := who methodClass. |
d8d7556d05ee
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1861 |
sel := who methodSelector. |
1973 | 1862 |
|
1863 |
methodSpecLine := self htmlForMethod:aMethod. |
|
478 | 1864 |
|
632 | 1865 |
"/ use string-asSymbol (instead of the obvious symbol itself) |
1866 |
"/ in the checks below, to avoid tricking myself, |
|
1867 |
"/ when the documentation on this method is generated |
|
1868 |
"/ (otherwise, I'll say that this method is both |
|
1869 |
"/ a subres and and obsolete method ...) |
|
1870 |
||
4250 | 1871 |
isSubres := aMethod isSubclassResponsibility. |
478 | 1872 |
|
1973 | 1873 |
isObsolete := aMethod isObsolete. |
1874 |
"/ the above checks for the obsolete-resource flag; |
|
1875 |
"/ there is still achance for obsoleteMethodWarning to be sent, without the resource flag being present. |
|
1876 |
isObsolete ifFalse:[ |
|
4200 | 1877 |
(aMethod sendsAnySelector:#(#'obsoleteMethodWarning' #'obsoleteMethodWarning:' #'obsoleteMethodWarning:from:')) ifTrue:[ |
1973 | 1878 |
(sel startsWith:'obsoleteMethodWarning') ifFalse:[ |
1879 |
true "cls ~~ Object" ifTrue:[ |
|
1880 |
isObsolete := true. |
|
1881 |
ParseTreeSearcher notNil ifTrue:[ |
|
1882 |
parseTree := cls parseTreeFor:sel. |
|
1883 |
parseTree notNil ifTrue: [ |
|
1884 |
expr := ParseTreeSearcher treeMatching:'`@e1 obsoleteMethodWarning:`@e2' in: parseTree. |
|
1885 |
expr isNil ifTrue:[ |
|
1886 |
expr := ParseTreeSearcher treeMatching:'`@e1 obsoleteMethodWarning:`@e2 from:`@e3' in: parseTree. |
|
1887 |
]. |
|
1888 |
expr notNil ifTrue:[ |
|
1889 |
|arg1| |
|
1890 |
||
1891 |
arg1 := expr arguments first. |
|
1892 |
arg1 isLiteral ifTrue:[ |
|
1893 |
arg1 value isString ifTrue:[ |
|
1894 |
obsoleteInfo := arg1 value. |
|
1895 |
]. |
|
1400 | 1896 |
]. |
1897 |
]. |
|
1898 |
]. |
|
1899 |
]. |
|
1900 |
]. |
|
1973 | 1901 |
] |
1902 |
]. |
|
478 | 1903 |
]. |
1904 |
||
1905 |
smallOrEmpty := ''. |
|
1906 |
aMethod isPrivate ifTrue:[ |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1907 |
methodSpecLine := '<i>private</i> ' , methodSpecLine. |
478 | 1908 |
"/ smallOrEmpty := '-small'. |
1909 |
] ifFalse:[ |
|
1910 |
aMethod isProtected ifTrue:[ |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1911 |
methodSpecLine := '<i>protected</i> ' , methodSpecLine. |
478 | 1912 |
"/ smallOrEmpty := '-small'. |
1913 |
] ifFalse:[ |
|
1914 |
aMethod isIgnored ifTrue:[ |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1915 |
methodSpecLine := '[ ' , methodSpecLine , ' ] (<i>invisible</i>)'. |
478 | 1916 |
"/ smallOrEmpty := '-small'. |
1917 |
] |
|
1918 |
] |
|
1919 |
]. |
|
4051 | 1920 |
aMethod isExtension ifTrue:[ |
1921 |
methodSpecLine := methodSpecLine,(' <br>( <i>an extension from the %1 package</i> )' bindWith:aMethod package). |
|
1922 |
]. |
|
478 | 1923 |
|
632 | 1924 |
aStream nextPutLine:'<DT>'. |
478 | 1925 |
|
1926 |
||
1927 |
cls isMeta ifTrue:[ |
|
1928 |
ballColor := 'yellow' |
|
1929 |
] ifFalse:[ |
|
1930 |
ballColor := 'red' |
|
1931 |
]. |
|
1932 |
||
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1933 |
aStream nextPutLine:'<IMG src="' , picturePath , '/' , ballColor , '-ball' , smallOrEmpty , '.gif" alt="o " width=6 height=6>'. |
1335 | 1934 |
aStream nextPutAll:' '. |
478 | 1935 |
|
1249 | 1936 |
sel := self withSpecialHTMLCharactersEscaped:sel. |
1937 |
anchorName := cls name , '_' , sel. |
|
478 | 1938 |
|
1939 |
withClassRef ifTrue:[ |
|
1250 | 1940 |
aStream nextPutAll:(self |
1941 |
anchorForHTMLDocAction: |
|
1942 |
('htmlDocOf:', cls theNonMetaclass name ) |
|
1943 |
info: |
|
1944 |
('Show documentation of ' , cls theNonMetaclass name ) |
|
1945 |
text: |
|
1946 |
cls name |
|
1947 |
name:anchorName). |
|
1948 |
aStream nextPutLine:' ' , methodSpecLine. |
|
478 | 1949 |
] ifFalse:[ |
1950 |
showClassName ifTrue:[ |
|
1951 |
methodSpecLine := cls name , ' ' , methodSpecLine |
|
1952 |
]. |
|
1953 |
||
1249 | 1954 |
aStream nextPutLine:'<a name="' , anchorName , '" ' , |
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1955 |
"/ 'href="' , cls name , '_' , sel , '"' , |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1956 |
'>' , methodSpecLine , '</a>'. |
3625 | 1957 |
self generateJavaScriptCallInfo ifTrue:[ |
1958 |
|jsMethodSpecLine| |
|
1959 |
aStream nextPutLine:'<br>JS: ' , (HTMLDocGeneratorForJavaScript htmlForMethod:aMethod). |
|
1960 |
]. |
|
478 | 1961 |
]. |
632 | 1962 |
aStream nextPutLine:'<DD>'. |
478 | 1963 |
|
3625 | 1964 |
isInheritedComment := false. |
1965 |
comment := self methodCommentOf:aMethod. |
|
1966 |
||
1967 |
"/ filter history lines |
|
1968 |
((comment startsWith:'Created: ') |
|
1969 |
or:[ (comment startsWith:'Modified: ') ]) ifTrue:[ |
|
1970 |
comment := nil. |
|
1971 |
]. |
|
1972 |
||
1973 |
comment isEmptyOrNil ifTrue:[ |
|
1974 |
|m| |
|
1975 |
||
1976 |
m := aMethod mclass superclass lookupMethodFor:aMethod selector. |
|
1977 |
m notNil ifTrue:[ |
|
1978 |
(comment := self methodCommentOf:m) notEmptyOrNil ifTrue:[ |
|
1979 |
isInheritedComment := true. |
|
1980 |
((comment startsWith:'Created: ') |
|
1981 |
or:[ (comment startsWith:'Modified: ') ]) ifTrue:[ |
|
1982 |
comment := nil. |
|
1983 |
]. |
|
1984 |
]. |
|
1985 |
]. |
|
1986 |
]. |
|
1987 |
comment notNil ifTrue:[ |
|
1249 | 1988 |
comment := self withSpecialHTMLCharactersEscaped:comment. |
478 | 1989 |
|
1990 |
comment notEmpty ifTrue:[ |
|
1991 |
comment := comment asStringCollection. |
|
1992 |
firstIndent := comment first leftIndent. |
|
1993 |
firstIndent > 0 ifTrue:[ |
|
1994 |
comment := comment collect:[:line | |
|
1995 |
line leftIndent >= firstIndent ifTrue:[ |
|
1996 |
line copyFrom:firstIndent. |
|
1997 |
] ifFalse:[ |
|
1998 |
line |
|
1999 |
] |
|
2000 |
]. |
|
2001 |
]. |
|
2002 |
firstNonEmpty := comment findFirst:[:line | line notEmpty]. |
|
2003 |
firstNonEmpty > 1 ifTrue:[ |
|
2004 |
comment := comment copyFrom:firstNonEmpty |
|
2005 |
]. |
|
2006 |
comment := comment asString. |
|
3625 | 2007 |
|
2008 |
isInheritedComment ifTrue:[ |
|
2009 |
comment := '<I>(comment from inherited method)</I><BR>' , comment. |
|
2010 |
]. |
|
2011 |
"/ make argument names italic in the comment |
|
4495 | 2012 |
aMethod argumentCount > 0 ifTrue:[ |
3625 | 2013 |
(aMethod methodArgNames ? #()) do:[:each | |
2014 |
comment := comment copyReplaceString:each withString:'<I>',each,'</I>' |
|
2015 |
]. |
|
2016 |
comment := comment copyReplaceString:'<I><I>' withString:'<I>'. |
|
2017 |
comment := comment copyReplaceString:'</I></I>' withString:'</I>'. |
|
2018 |
]. |
|
478 | 2019 |
]. |
2020 |
||
2021 |
comment asStringCollection do:[:line | |
|
1178 | 2022 |
aStream |
2023 |
"/ nextPutAll:'<I>'; |
|
2024 |
nextPutAll:line; |
|
2025 |
"/ nextPutAll:'</I>'; |
|
2026 |
nextPutLine:'<BR>'. |
|
478 | 2027 |
]. |
2028 |
]. |
|
2029 |
||
2030 |
isSubres ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
2031 |
aStream nextPutLine:'<BR>'. |
4484 | 2032 |
aStream nextPutLine:'<I>** This method must be redefined in concrete classes (subclassResponsibility) **</I>'. |
478 | 2033 |
]. |
2034 |
isObsolete ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
2035 |
aStream nextPutLine:'<BR>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
2036 |
aStream nextPutLine:'<I>** This is an obsolete interface - do not use it (it may vanish in future versions) **</I>'. |
1400 | 2037 |
obsoleteInfo notNil ifTrue:[ |
2038 |
aStream nextPutLine:'<BR>'. |
|
2039 |
aStream nextPutLine:'<I>** ' , obsoleteInfo , ' **</I>'. |
|
2040 |
]. |
|
478 | 2041 |
]. |
2042 |
||
3625 | 2043 |
(isSubres | isObsolete) ifFalse:[ |
4326 | 2044 |
[ |
2045 |
exampleComments := self methodExampleCommentsOf:aMethod. |
|
2046 |
] valueWithTimeout:10 seconds. |
|
2047 |
||
3625 | 2048 |
exampleComments notEmptyOrNil ifTrue:[ |
2049 |
exampleComments do:[:each | |
|
2050 |
|exampleCode| |
|
2051 |
||
2052 |
exampleCode := self undentedToFirstLinesIndent:each asStringCollection. |
|
4404 | 2053 |
[exampleCode size ~~ 0 and:[(exampleCode first ? '') withoutSeparators isEmpty]] |
3625 | 2054 |
whileTrue:[ exampleCode removeFirst]. |
4404 | 2055 |
[exampleCode size ~~ 0 and:[(exampleCode last ? '') withoutSeparators isEmpty]] |
3625 | 2056 |
whileTrue:[ exampleCode removeLast]. |
2057 |
||
2058 |
exampleCode notEmpty ifTrue:[ |
|
4328 | 2059 |
"/ outStream nextPutLine:'<blockquote>'. |
2060 |
outStream nextPutLine:'<p>usage example(s):'. |
|
4318 | 2061 |
"/ outStream nextPutLine:'usage example(s):<br>'. |
3625 | 2062 |
self generateExampleStart. |
2063 |
exampleCode do:[:eachLine | |
|
2064 |
outStream nextPutLine:eachLine |
|
2065 |
]. |
|
2066 |
self generateExampleEnd. |
|
4328 | 2067 |
"/ outStream nextPutLine:'</blockquote>'. |
3625 | 2068 |
]. |
2069 |
]. |
|
2070 |
]. |
|
2071 |
]. |
|
2072 |
||
2073 |
" |
|
2074 |
self basicNew |
|
2075 |
printOutHTMLMethodProtocol:(Array compiledMethodAt:#addAllNonNilElementsTo:) |
|
2076 |
on:Transcript |
|
2077 |
showClassName:true classRef:true picturePath:'pics' |
|
2078 |
" |
|
2079 |
||
1973 | 2080 |
"Created: / 22-04-1996 / 20:03:30 / cg" |
4250 | 2081 |
"Modified: / 16-07-2017 / 11:28:18 / cg" |
4404 | 2082 |
"Modified: / 01-03-2019 / 15:52:32 / Claus Gittinger" |
478 | 2083 |
! |
2084 |
||
2085 |
printOutHTMLProtocolOf:aClass on:aStream |
|
632 | 2086 |
"append documentation of the given class in HTML onto aStream." |
2087 |
||
478 | 2088 |
|collectionOfCategories any| |
2089 |
||
2090 |
"/ self printOutDefinitionOn:aPrintStream. |
|
2091 |
||
4247 | 2092 |
collectionOfCategories := aClass class methodCategories asSortedCollection. |
478 | 2093 |
any := false. |
523 | 2094 |
|
4404 | 2095 |
collectionOfCategories size ~~ 0 ifTrue:[ |
523 | 2096 |
collectionOfCategories := collectionOfCategories asOrderedCollection. |
2097 |
collectionOfCategories remove:'documentation' ifAbsent:[]. |
|
4404 | 2098 |
collectionOfCategories size ~~ 0 ifTrue:[ |
523 | 2099 |
collectionOfCategories sort. |
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
2100 |
aStream nextPutLine:'<h2><a name="CLASSPROTOCOL" href="#I_CLASSPROTOCOL">Class protocol:</a></h2>'. |
523 | 2101 |
collectionOfCategories do:[:aCategory | |
478 | 2102 |
self printOutHTMLCategoryProtocol:aCategory of:aClass class on:aStream. |
2103 |
any := true. |
|
523 | 2104 |
]. |
478 | 2105 |
"/ any ifFalse:[ |
2106 |
"/ aStream nextPutAll:'no new protocol' |
|
2107 |
"/ ]. |
|
1249 | 2108 |
self generateHorizontalLine. |
523 | 2109 |
] |
478 | 2110 |
]. |
2111 |
||
2112 |
||
4247 | 2113 |
collectionOfCategories := aClass methodCategories asSortedCollection. |
478 | 2114 |
any := false. |
4404 | 2115 |
collectionOfCategories size ~~ 0 ifTrue:[ |
478 | 2116 |
collectionOfCategories := collectionOfCategories asOrderedCollection sort. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
2117 |
aStream nextPutLine:'<h2><a name="INSTANCEPROTOCOL" href="#I_INSTANCEPROTOCOL">Instance protocol:</A></h2>'. |
478 | 2118 |
collectionOfCategories do:[:aCategory | |
2119 |
self printOutHTMLCategoryProtocol:aCategory of:aClass on:aStream |
|
2120 |
]. |
|
2121 |
"/ any ifFalse:[ |
|
2122 |
"/ aStream nextPutAll:'no new protocol' |
|
2123 |
"/ ]. |
|
1249 | 2124 |
self generateHorizontalLine. |
478 | 2125 |
] |
2126 |
||
2127 |
" |
|
2128 |
self printOutHTMLProtocolOf:Float on:Stdout |
|
2129 |
" |
|
2130 |
||
4247 | 2131 |
"Created: / 22-04-1996 / 20:03:30 / cg" |
2132 |
"Modified: / 05-07-2017 / 10:51:39 / cg" |
|
4404 | 2133 |
"Modified: / 01-03-2019 / 15:53:20 / Claus Gittinger" |
2016 | 2134 |
! |
2135 |
||
2136 |
undentedToFirstLinesIndent:someText |
|
2137 |
|undentedText firstIndent firstNonEmpty| |
|
2138 |
||
2049 | 2139 |
undentedText := someText. |
2140 |
||
4404 | 2141 |
someText size ~~ 0 ifTrue:[ |
2049 | 2142 |
firstIndent := someText first withTabsExpanded leftIndent. |
2143 |
firstIndent > 0 ifTrue:[ |
|
2144 |
undentedText := someText collect:[:line | |
|
2145 |
|l| |
|
2146 |
||
2147 |
l := line withTabsExpanded. |
|
2148 |
l leftIndent >= firstIndent ifTrue:[ |
|
2149 |
l copyFrom:firstIndent + 1. |
|
2150 |
] ifFalse:[ |
|
2151 |
l |
|
2152 |
] |
|
2153 |
]. |
|
2154 |
]. |
|
2016 | 2155 |
]. |
2156 |
||
2157 |
firstNonEmpty := undentedText findFirst:[:line | line notEmpty]. |
|
2158 |
firstNonEmpty > 1 ifTrue:[ |
|
2159 |
undentedText := undentedText copyFrom:firstNonEmpty |
|
2160 |
]. |
|
2161 |
^ undentedText |
|
4404 | 2162 |
|
2163 |
"Modified: / 01-03-2019 / 15:53:11 / Claus Gittinger" |
|
2016 | 2164 |
! ! |
2165 |
||
2166 |
!HTMLDocGenerator methodsFor:'document generation-lists'! |
|
2167 |
||
2168 |
htmlClassCategoryList |
|
2169 |
"generate a formatted list of all available class categories as |
|
2170 |
an HTML string. Each category will be a hyperlink to another |
|
2171 |
autogenerated page, containing the classes per category. |
|
2172 |
The generated page is supposed to be given to an HTML reader |
|
2173 |
with home being set to ../doc/online/xxx/classDoc |
|
2174 |
(i.e. the images are to be found one-up in the doc hierarchy)" |
|
2175 |
||
2176 |
|categories s prefixList prefix prefixStack prev| |
|
2177 |
||
2178 |
categories := Smalltalk allClassCategories asOrderedCollection sort. |
|
2179 |
||
2180 |
outStream := s := '' writeStream. |
|
2181 |
||
2182 |
self generateHTMLHeadWithTitle:'Class Categories:'. |
|
2183 |
||
2184 |
self generateBODYStart. |
|
2185 |
||
2186 |
self generateUpArrowButtonForTop. |
|
2187 |
self generateHorizontalLine. |
|
2188 |
self generateH1:'Class Categories:'. |
|
2189 |
s nextPutLine:'<ul>'. |
|
2190 |
||
2191 |
prefixList := Set new. |
|
2192 |
||
2193 |
categories keysAndValuesDo:[:index :element | |
|
2194 |
|prev common| |
|
2195 |
||
2196 |
index ~~ 1 ifTrue:[ |
|
2197 |
prev := categories at:(index - 1). |
|
2198 |
common := (Array with:prev with:element) longestCommonPrefix. |
|
2199 |
(common endsWith:'-') ifTrue:[ |
|
3232
de4bd4dcb49f
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
2865
diff
changeset
|
2200 |
prefixList add:(common copyButLast:1) |
2016 | 2201 |
] ifFalse:[ |
2202 |
(common includes:$-) ifTrue:[ |
|
2203 |
prefixList add:(common copyTo:(common lastIndexOf:$-)-1). |
|
2204 |
] ifFalse:[ |
|
2205 |
"/ common = prev ifTrue:[ |
|
2206 |
"/ prefixList add:common |
|
2207 |
"/ ] |
|
2208 |
] |
|
2209 |
] |
|
2210 |
] |
|
2211 |
]. |
|
2212 |
||
2213 |
prefix := ''. prefixStack := OrderedCollection new. |
|
2214 |
prev := ''. |
|
2215 |
||
2216 |
categories := categories select:[:nm | nm ~= 'obsolete']. |
|
2217 |
||
2218 |
categories do:[:nm | |
|
2219 |
|longest| |
|
2220 |
||
2221 |
"/ longest prefix .... |
|
2222 |
longest := prefixList inject:'' into:[:maxPrefix :prefix | |
|
2223 |
|prefixWithDash| |
|
2224 |
||
2225 |
prefixWithDash := prefix , '-'. |
|
2226 |
nm = prefix ifTrue:[ |
|
2227 |
maxPrefix |
|
2228 |
] ifFalse:[ |
|
2229 |
(nm startsWith:prefixWithDash) |
|
2230 |
ifTrue:[ |
|
2231 |
prefixWithDash size > maxPrefix size |
|
2232 |
ifTrue:[ |
|
2233 |
prefixWithDash |
|
2234 |
] ifFalse:[ |
|
2235 |
maxPrefix |
|
2236 |
] |
|
2237 |
] ifFalse:[ |
|
2238 |
maxPrefix |
|
2239 |
] |
|
2240 |
] |
|
2241 |
]. |
|
2242 |
||
4404 | 2243 |
longest size ~~ 0 ifTrue:[ |
2016 | 2244 |
longest = prefix ifTrue:[ |
2245 |
"/ no change |
|
2246 |
] ifFalse:[ |
|
2247 |
(longest startsWith:prefix) ifTrue:[ |
|
2248 |
prefixStack addLast:longest. |
|
2249 |
longest ~= prev ifTrue:[ |
|
2250 |
prefixStack size == 1 ifTrue:[ |
|
2251 |
s nextPutLine:'<p>'. |
|
2252 |
]. |
|
2253 |
s nextPutLine:'<li>' , (longest copyFrom:prefix size + 1). |
|
2254 |
]. |
|
2255 |
s nextPutLine:'<ul>'. |
|
2256 |
prefix := longest. |
|
2257 |
] ifFalse:[ |
|
2258 |
s nextPutLine:'</ul>'. |
|
2259 |
prefixStack notEmpty ifTrue:[ |
|
2260 |
prefixStack removeLast. |
|
2261 |
]. |
|
2262 |
||
2263 |
[prefixStack notEmpty |
|
2264 |
and:[(longest startsWith:prefixStack last) not]] whileTrue:[ |
|
2265 |
s nextPutLine:'</ul>'. |
|
2266 |
prefixStack removeLast. |
|
2267 |
]. |
|
2268 |
||
2269 |
prefixStack notEmpty ifTrue:[ |
|
2270 |
prefix := prefixStack last. |
|
2271 |
] ifFalse:[ |
|
2272 |
prefixStack addLast:longest. |
|
2273 |
prefix := longest. |
|
2274 |
longest ~= prev ifTrue:[ |
|
2275 |
prefixStack size == 1 ifTrue:[ |
|
2276 |
s nextPutLine:'<p>'. |
|
2277 |
]. |
|
2278 |
s nextPutLine:'<li>' , longest. |
|
2279 |
]. |
|
2280 |
s nextPutLine:'<ul>'. |
|
2281 |
] |
|
2282 |
]. |
|
2283 |
] |
|
2284 |
] ifFalse:[ |
|
4404 | 2285 |
[prefixStack size ~~ 0] whileTrue:[ |
2016 | 2286 |
s nextPutLine:'</ul>'. |
2287 |
prefixStack removeLast. |
|
2288 |
]. |
|
2289 |
prefixStack size == 0 ifTrue:[ |
|
2290 |
s nextPutLine:'<p>'. |
|
2291 |
]. |
|
2292 |
prefix := ''. |
|
2293 |
]. |
|
2294 |
||
2295 |
s nextPutAll:'<li>'. |
|
3644 | 2296 |
self generateDocumentForOfflineReading ifTrue:[ |
2297 |
s nextPutLine:(self |
|
2298 |
anchorFor: |
|
2299 |
((nm copyReplaceAll:$ with:$_) , '/index.html' ) |
|
2300 |
info: |
|
2301 |
('Classes in ' , nm) |
|
2302 |
text: |
|
2303 |
(nm copyFrom:prefix size + 1) |
|
2304 |
name:nil). |
|
2305 |
] ifFalse:[ |
|
2306 |
s nextPutLine:(self |
|
2016 | 2307 |
anchorForHTMLDocAction: |
2308 |
('htmlClassesListOfCategory:''', nm |
|
2309 |
, ''' backTo:''htmlClassCategoryList''') |
|
2310 |
info: |
|
2311 |
('Classes in ' , nm) |
|
2312 |
text: |
|
2313 |
(nm copyFrom:prefix size + 1)). |
|
3644 | 2314 |
]. |
2016 | 2315 |
|
2316 |
prev := nm. |
|
2317 |
]. |
|
2318 |
||
2319 |
s nextPutAll:' |
|
2320 |
</ul> |
|
2321 |
'. |
|
2322 |
self generateBODYandHTMLEnd. |
|
2323 |
||
2324 |
^ s contents |
|
2325 |
||
2326 |
" |
|
2327 |
HTMLDocGenerator new htmlClassCategoryList |
|
2328 |
" |
|
2329 |
||
4404 | 2330 |
"Created: / 22-04-1996 / 20:03:30 / cg" |
2331 |
"Modified: / 30-10-1997 / 13:16:08 / cg" |
|
2332 |
"Modified: / 01-03-2019 / 15:52:54 / Claus Gittinger" |
|
2016 | 2333 |
! |
2334 |
||
2335 |
htmlClassListPrefix:prefix |
|
2336 |
"generate an HTML document string which contains HREFS for a list |
|
2337 |
of classes which start with some prefix (typically, the first |
|
2338 |
character is given)" |
|
2339 |
||
2340 |
|classes| |
|
2341 |
||
2342 |
classes := Smalltalk allClasses |
|
2343 |
select:[:cls | |
|
2344 |
cls isPrivate not |
|
2345 |
and:[(cls isRealNameSpace not) |
|
2346 |
and:[cls name startsWith:prefix]] |
|
2347 |
]. |
|
2348 |
||
2349 |
^ self |
|
2350 |
htmlClasses:classes |
|
2351 |
title:('Classes starting with ''' , prefix asString , ''':'). |
|
2352 |
||
2353 |
"Created: / 22-04-1996 / 20:03:31 / cg" |
|
2354 |
"Modified: / 10-11-2006 / 17:11:16 / cg" |
|
2355 |
! |
|
2356 |
||
2357 |
htmlClasses:classes title:title |
|
2358 |
"generate an HTML document string which contains HREFS for a given list |
|
2359 |
of classes" |
|
2360 |
||
2361 |
^ self |
|
2362 |
htmlClasses:classes |
|
2363 |
title:title |
|
2364 |
backTo:nil |
|
2365 |
||
2366 |
"Modified: / 30.10.1997 / 13:21:40 / cg" |
|
2367 |
! |
|
2368 |
||
2369 |
htmlClasses:classes title:title backTo:backRef |
|
2370 |
"generate an HTML document string which contains HREFS for a given list |
|
2371 |
of classes. If backref is nonNil, a back-button to that |
|
2372 |
HREF is added at the top. |
|
2373 |
The generated page is supposed to be given to an HTML reader |
|
2374 |
with home being set to ../doc/online/xxx/classDoc |
|
2375 |
(i.e. the images are to be found one-up in the doc hierarchy)" |
|
2376 |
||
2377 |
|classNames s| |
|
2378 |
||
2379 |
classNames := (classes collect:[:cls | cls name]) asOrderedCollection sort. |
|
2380 |
||
2381 |
outStream := s := '' writeStream. |
|
2382 |
||
2383 |
self generateHTMLHeadWithTitle:title. |
|
2384 |
s nextPutLine:'<body>'. |
|
2385 |
backRef notNil ifTrue:[ |
|
2386 |
backRef ~~ #none ifTrue:[ |
|
2387 |
self |
|
2388 |
generateUpArrowButtonWithReference:(self pathToLanguageTopOfDocumentation , '/TOP.html') |
|
2389 |
command:backRef |
|
2390 |
imagePath:nil |
|
2391 |
altLabel:'back'. |
|
2392 |
] |
|
2393 |
] ifFalse:[ |
|
2394 |
self |
|
2395 |
generateUpArrowButtonWithReference:(self pathToLanguageTopOfDocumentation , '/TOP.html') |
|
2396 |
command:nil |
|
2397 |
imagePath:nil |
|
2398 |
altLabel:'top'. |
|
2399 |
]. |
|
2400 |
backRef ~~ #none ifTrue:[ |
|
2401 |
self generateHorizontalLine. |
|
2402 |
]. |
|
2403 |
self generateH1:title. |
|
2404 |
s nextPutLine:'<ul>'. |
|
2405 |
||
2406 |
classNames do:[:className | |
|
2407 |
s nextPutAll:'<li>'. |
|
2408 |
self generateClassDocReferenceFor:className. |
|
2409 |
s cr. |
|
2410 |
]. |
|
2411 |
||
2412 |
s nextPutAll:' |
|
2413 |
</ul> |
|
2414 |
'. |
|
2415 |
self generateBODYandHTMLEnd. |
|
2416 |
||
2417 |
^ s contents |
|
2418 |
||
2419 |
"Created: / 23.4.1996 / 15:31:55 / cg" |
|
2420 |
"Modified: / 30.10.1997 / 13:21:32 / cg" |
|
2421 |
! |
|
2422 |
||
2423 |
htmlClassesListOfCategory:category |
|
2424 |
"generate an HTML document string which contains HREFS for a list |
|
2425 |
of classes which are contained in a particular category." |
|
2426 |
||
2427 |
^ self |
|
2428 |
htmlClassesListOfCategory:category |
|
2429 |
backTo:nil |
|
2430 |
||
2431 |
"Modified: / 30.10.1997 / 13:21:23 / cg" |
|
2432 |
! |
|
2433 |
||
2434 |
htmlClassesListOfCategory:category backTo:backRef |
|
2435 |
"generate an HTML document string which contains HREFS for a list |
|
2436 |
of classes which are contained in a particular category." |
|
2437 |
||
2438 |
|classes| |
|
2439 |
||
2440 |
classes := Smalltalk allClasses |
|
2441 |
select:[:cls | cls isPrivate not |
|
2442 |
and:[(cls isRealNameSpace not) |
|
2443 |
and:[cls category = category]] |
|
2444 |
]. |
|
2445 |
||
2446 |
^ self |
|
2447 |
htmlClasses:classes |
|
2448 |
title:('Classes in: ' , category) |
|
2449 |
backTo:backRef |
|
2450 |
||
2451 |
"Created: / 23-04-1996 / 15:39:39 / cg" |
|
2452 |
"Modified: / 10-11-2006 / 17:11:23 / cg" |
|
2453 |
! |
|
2454 |
||
2455 |
htmlClassesMatching:aMatchPattern backTo:backRef |
|
2456 |
"generate an HTML document string which contains HREFS |
|
2457 |
for a list of classes whose name matches a given matchPattern." |
|
2458 |
||
2459 |
|classes cls| |
|
2460 |
||
2461 |
classes := Smalltalk allClasses |
|
2462 |
select:[:cls | cls isPrivate not |
|
2463 |
and:[(cls isRealNameSpace not) |
|
2464 |
and:[aMatchPattern match:cls name]] |
|
2465 |
]. |
|
2466 |
||
2467 |
^ self |
|
2468 |
htmlClasses:classes |
|
2469 |
title:('Classes matching: ' , aMatchPattern) |
|
2470 |
backTo:backRef |
|
2471 |
||
2472 |
" |
|
2473 |
self htmlClassesMatching:'Tgen::*' backTo:nil |
|
2474 |
" |
|
2475 |
||
2476 |
"Modified: / 10-11-2006 / 17:11:30 / cg" |
|
2477 |
! |
|
2478 |
||
4106 | 2479 |
htmlKWOCListFor:aKWIC |
2480 |
"generate a formatted list of all keywords in context from class documentation |
|
2481 |
as an HTML string. |
|
2482 |
Each keword will be a hyperlinked to another |
|
2483 |
autogenerated page, containing the classes documentation. |
|
2484 |
The generated page is supposed to be given to an HTML reader |
|
2485 |
with home being set to ../doc/online/xxx/classDoc |
|
2486 |
(i.e. the images are to be found one-up in the doc hierarchy)" |
|
2487 |
||
4108 | 2488 |
|prevWord caseMapping| |
4106 | 2489 |
|
2490 |
outStream := '' writeStream. |
|
2491 |
||
2492 |
self generateHTMLHeadWithTitle:'Keyword Index:'. |
|
2493 |
self generateBODYStart. |
|
2494 |
self generateUpArrowButtonForTop. |
|
2495 |
self generateHorizontalLine. |
|
2496 |
||
2497 |
self generateH1:'Keywords:'. |
|
2498 |
outStream nextPutLine:'<dl>'. |
|
2499 |
prevWord := nil. |
|
4108 | 2500 |
|
2501 |
caseMapping := Dictionary new. |
|
2502 |
aKWIC entriesDo:[:word :left :right :class| |
|
2503 |
|lcWord wordAlready| |
|
2504 |
||
2505 |
lcWord := word asLowercase. |
|
2506 |
lcWord ~= word ifTrue:[ |
|
2507 |
wordAlready := caseMapping at:lcWord ifAbsent:[nil]. |
|
2508 |
wordAlready isNil ifTrue:[ |
|
2509 |
caseMapping at:lcWord put:word |
|
2510 |
]. |
|
2511 |
]. |
|
2512 |
]. |
|
2513 |
||
4127 | 2514 |
aKWIC matchSorter:[:a :b | a key < b key]. |
4108 | 2515 |
|
4127 | 2516 |
aKWIC entriesDo:[:word :left :right :classOrMethod| |
4106 | 2517 |
|ref lcWord ctx| |
2518 |
||
4109 | 2519 |
ctx := (HTMLUtilities escapeCharacterEntities:(left contractAtBeginningTo:25)) |
4124 | 2520 |
, ' <b>',(HTMLUtilities escapeCharacterEntities:word),'</b> ' |
4109 | 2521 |
,(HTMLUtilities escapeCharacterEntities:(right contractAtEndTo:25)). |
4106 | 2522 |
|
2523 |
lcWord := word asLowercase. |
|
2524 |
lcWord ~= prevWord ifTrue:[ |
|
2525 |
prevWord notNil ifTrue:[ |
|
2526 |
outStream nextPutLine:'</ul></dd>'. |
|
2527 |
]. |
|
4108 | 2528 |
"/ outStream nextPutLine:'<dt>',(HTMLUtilities escapeCharacterEntities:(caseMapping at:lcWord ifAbsent:[word])),'</dt>'. |
2529 |
outStream nextPutLine:'<dt>',(HTMLUtilities escapeCharacterEntities:word),'</dt>'. |
|
4106 | 2530 |
outStream nextPutLine:'<dd><ul><li>'. |
4127 | 2531 |
classOrMethod isBehavior ifTrue:[ |
2532 |
self generateClassDocReferenceFor:classOrMethod name. |
|
2533 |
] ifFalse:[ |
|
2534 |
self generateMethodDocReferenceFor:classOrMethod selector inClass:classOrMethod mclass name text:classOrMethod selector autoloading:nil. |
|
2535 |
]. |
|
4108 | 2536 |
outStream nextPutAll:'<tab indent=300>'. |
4106 | 2537 |
outStream nextPutLine:ctx. |
2538 |
outStream nextPutLine:'</li>'. |
|
2539 |
prevWord := lcWord. |
|
2540 |
] ifFalse:[ |
|
2541 |
outStream nextPutLine:'</li><li>'. |
|
4127 | 2542 |
classOrMethod isBehavior ifTrue:[ |
2543 |
self generateClassDocReferenceFor:classOrMethod name. |
|
2544 |
] ifFalse:[ |
|
2545 |
self generateMethodDocReferenceFor:classOrMethod selector inClass:classOrMethod mclass name text:classOrMethod selector autoloading:nil. |
|
2546 |
]. |
|
4108 | 2547 |
outStream nextPutAll:'<tab indent=300>'. |
4106 | 2548 |
outStream nextPutLine:ctx. |
2549 |
outStream nextPutLine:'</li>'. |
|
2550 |
]. |
|
2551 |
]. |
|
2552 |
outStream nextPutLine:'</ul></dd>'. |
|
2553 |
outStream nextPutLine:'</dl>'. |
|
2554 |
||
2555 |
self generateBODYandHTMLEnd. |
|
2556 |
^ outStream contents |
|
2557 |
! |
|
2558 |
||
2017 | 2559 |
htmlPackageDocOf:packageID |
2560 |
|classes| |
|
2561 |
||
2562 |
classes := Smalltalk allClassesInPackage:packageID. |
|
2563 |
classes := classes reject:[:cls | cls isPrivate]. |
|
2564 |
^ self htmlClasses: classes title:'Classes in package ',packageID backTo:nil |
|
2565 |
! |
|
2566 |
||
2018 | 2567 |
htmlPackageList |
4122 | 2568 |
"generate an HTML string for a list of all packages in the system" |
2569 |
||
2570 |
^ self |
|
2571 |
htmlPackageListFor:(Smalltalk allPackageIDs) |
|
2572 |
withDocumentation:true "/ false |
|
2573 |
||
2574 |
" |
|
2575 |
self new |
|
2576 |
generateDocumentForOfflineReading:true; |
|
2577 |
htmlPackageList. |
|
2578 |
" |
|
2579 |
! |
|
2580 |
||
2581 |
htmlPackageListFor:packageNames withDocumentation:withDocumentation |
|
2582 |
"generate an HTML string for a given list of packages" |
|
2018 | 2583 |
|
2584 |
|s| |
|
2585 |
||
2586 |
s := outStream := '' writeStream. |
|
2587 |
||
2588 |
self generateHTMLHeadWithTitle:'Package Index'. |
|
2589 |
self generateBODYStart. |
|
2590 |
||
2591 |
self generateUpArrowButtonForTop. |
|
2592 |
self generateHorizontalLine. |
|
2593 |
self generateH1:'Package Index'. |
|
2594 |
s nextPutLine:'<ul>'. |
|
2595 |
||
4122 | 2596 |
packageNames |
2018 | 2597 |
do:[:p | |
2598 |
|pckgString| |
|
2599 |
||
3644 | 2600 |
(p startsWith:'__') ifFalse:[ |
2601 |
s nextPutAll:'<li>'. |
|
2602 |
pckgString := self withSpecialHTMLCharactersEscaped:p. |
|
2603 |
self generateDocumentForOfflineReading ifTrue:[ |
|
2604 |
s nextPutLine:(self |
|
2605 |
anchorFor: |
|
2606 |
((p copyReplaceAll:$: with:$/) , '/index.html' ) |
|
2607 |
info: |
|
2608 |
('Classes in Package: ' , pckgString) |
|
2609 |
text: |
|
2610 |
pckgString |
|
2611 |
name:nil). |
|
2612 |
] ifFalse:[ |
|
2613 |
s nextPutLine:(self |
|
2614 |
anchorForHTMLDocAction: |
|
2615 |
('htmlPackageDocOf:''' , pckgString , '''' ) |
|
2616 |
info: |
|
2617 |
('Classes in Package: ' , pckgString) |
|
2618 |
text: |
|
2619 |
pckgString). |
|
2620 |
]. |
|
2621 |
]. |
|
2018 | 2622 |
]. |
2623 |
||
2624 |
s nextPutLine:'</ul>'. |
|
2625 |
self generateBODYandHTMLEnd. |
|
2626 |
||
2627 |
^ s contents |
|
3644 | 2628 |
|
2629 |
" |
|
2630 |
self new |
|
2631 |
generateDocumentForOfflineReading:true; |
|
2632 |
htmlPackageList. |
|
2633 |
" |
|
2018 | 2634 |
! |
2635 |
||
2016 | 2636 |
htmlSelectorList |
2637 |
"generate an HTML string for all selectors (for which methods exist) |
|
2638 |
in the system" |
|
2639 |
||
2640 |
|selectors| |
|
2641 |
||
2642 |
selectors := IdentitySet new. |
|
2643 |
Smalltalk allClassesAndMetaclassesDo:[:cls | |
|
2644 |
selectors addAll:cls selectors. |
|
2645 |
]. |
|
2646 |
selectors := selectors asOrderedCollection sort. |
|
2647 |
||
2648 |
^ self |
|
2649 |
htmlSelectors:selectors |
|
2650 |
title:('All Selectors:'). |
|
2651 |
||
2652 |
" |
|
2653 |
self htmlSelectorList |
|
2654 |
" |
|
2655 |
||
2656 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
|
2657 |
"Modified: / 5.6.1996 / 12:27:09 / stefan" |
|
2658 |
"Modified: / 30.10.1997 / 13:25:19 / cg" |
|
2659 |
! |
|
2660 |
||
2661 |
htmlSelectorListMatching:pattern |
|
2662 |
"generate an HTML string for all selectors which match a pattern |
|
2663 |
(and for which methods exist) in the system" |
|
2664 |
||
2665 |
|selectors| |
|
2666 |
||
2667 |
selectors := IdentitySet new. |
|
2668 |
Smalltalk allClassesAndMetaclassesDo:[:cls | |
|
4211 | 2669 |
cls selectorsDo:[:sel | |
2016 | 2670 |
(pattern match:sel) ifTrue:[ |
2671 |
selectors add:sel. |
|
2672 |
] |
|
2673 |
] |
|
2674 |
]. |
|
2675 |
selectors := selectors asOrderedCollection sort. |
|
2676 |
||
2677 |
^ self |
|
2678 |
htmlSelectors:selectors |
|
2679 |
title:('Selectors matching ''' , pattern , ''':'). |
|
2680 |
||
2681 |
" |
|
2682 |
self htmlSelectorListMatching:'*do*' |
|
2683 |
" |
|
2684 |
||
4211 | 2685 |
"Created: / 22-04-1996 / 20:03:31 / cg" |
2686 |
"Modified: / 05-06-1996 / 12:29:27 / stefan" |
|
2687 |
"Modified: / 10-02-2017 / 10:32:37 / cg" |
|
2016 | 2688 |
! |
2689 |
||
2690 |
htmlSelectorListPrefix:prefix |
|
2691 |
"generate an HTML string for all selectors whose names starts with |
|
2692 |
a prefix (and for which methods exist) in the system" |
|
2693 |
||
2694 |
|selectors| |
|
2695 |
||
2696 |
selectors := IdentitySet new. |
|
2697 |
Smalltalk allClassesAndMetaclassesDo:[:cls | |
|
4211 | 2698 |
cls selectorsDo:[:sel | |
2016 | 2699 |
(sel startsWith:prefix) ifTrue:[ |
2700 |
selectors add:sel. |
|
2701 |
] |
|
2702 |
] |
|
2703 |
]. |
|
2704 |
selectors := selectors asOrderedCollection sort. |
|
2705 |
||
2706 |
^ self |
|
2707 |
htmlSelectors:selectors |
|
2708 |
title:('Selectors starting with ''' , prefix asString , ''':'). |
|
2709 |
||
2710 |
" |
|
2711 |
self htmlSelectorListPrefix:'a' |
|
2712 |
" |
|
2713 |
||
4211 | 2714 |
"Created: / 22-04-1996 / 20:03:31 / cg" |
2715 |
"Modified: / 05-06-1996 / 12:31:13 / stefan" |
|
2716 |
"Modified: / 10-02-2017 / 10:32:31 / cg" |
|
2016 | 2717 |
! |
2718 |
||
2719 |
htmlSelectors:selectors title:title |
|
2720 |
"generate an HTML string for a given list of selectors" |
|
2721 |
||
2722 |
|s| |
|
2723 |
||
2724 |
s := outStream := '' writeStream. |
|
2725 |
||
2726 |
self generateHTMLHeadWithTitle:title. |
|
2727 |
self generateBODYStart. |
|
2728 |
||
2729 |
self generateUpArrowButtonForTop. |
|
2730 |
self generateHorizontalLine. |
|
2731 |
self generateH1:title. |
|
2732 |
s nextPutLine:'<ul>'. |
|
2733 |
||
2734 |
selectors do:[:sel | |
|
2735 |
|selString| |
|
2736 |
||
2737 |
selString := self withSpecialHTMLCharactersEscaped:sel. |
|
2738 |
s nextPutAll:'<li>'. |
|
2739 |
s nextPutLine:(self |
|
2740 |
anchorForHTMLDocAction: |
|
2741 |
('htmlDocOfImplementorsOf:''' , selString , '''' ) |
|
2742 |
info: |
|
2743 |
('Implementors of: ' , selString) |
|
2744 |
text: |
|
2745 |
selString). |
|
2746 |
]. |
|
2747 |
||
2748 |
s nextPutLine:'</ul>'. |
|
2749 |
self generateBODYandHTMLEnd. |
|
2750 |
||
2751 |
^ s contents |
|
2752 |
||
2753 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
|
2754 |
"Modified: / 30.10.1997 / 13:26:34 / cg" |
|
478 | 2755 |
! ! |
2756 |
||
1265 | 2757 |
!HTMLDocGenerator methodsFor:'format conversion-man pages'! |
575 | 2758 |
|
2759 |
manPageFor:aCommand |
|
632 | 2760 |
"generate a (unix-) man page for a given command & convert the output to html" |
575 | 2761 |
|
2762 |
^ self |
|
2763 |
manPageFor:aCommand |
|
2764 |
inSection:nil |
|
2765 |
||
632 | 2766 |
"Modified: / 30.10.1997 / 13:29:31 / cg" |
575 | 2767 |
! |
2768 |
||
2769 |
manPageFor:aCommand inSection:sectionOrNil |
|
632 | 2770 |
"generate a (unix-) man page for some entry in a section |
575 | 2771 |
& convert the output to html" |
2772 |
||
2773 |
|manCmd| |
|
2774 |
||
2775 |
sectionOrNil isNil ifTrue:[ |
|
2776 |
manCmd := 'man ' , aCommand |
|
2777 |
] ifFalse:[ |
|
2778 |
manCmd := 'man ' , sectionOrNil printString , ' ' , aCommand |
|
2779 |
]. |
|
2780 |
^ self |
|
2781 |
manPageFor:aCommand |
|
2782 |
manCommand:manCmd. |
|
2783 |
||
632 | 2784 |
"Created: / 9.9.1996 / 17:45:08 / cg" |
2785 |
"Modified: / 30.10.1997 / 13:29:44 / cg" |
|
575 | 2786 |
! |
2787 |
||
2788 |
manPageFor:aCommand manCommand:manCommand |
|
577 | 2789 |
"convert man-command output to html. |
632 | 2790 |
Only the body of the text (without head../head and body../body) is generated" |
575 | 2791 |
|
1249 | 2792 |
|manPageStream text| |
575 | 2793 |
|
1249 | 2794 |
manPageStream := PipeStream readingFrom:manCommand. |
2795 |
manPageStream notNil ifTrue:[ |
|
2796 |
[ |
|
2797 |
text := self manPageFromStream:manPageStream. |
|
2798 |
] ensure:[ |
|
4117 | 2799 |
manPageStream abortAndClose. |
1249 | 2800 |
] |
575 | 2801 |
]. |
2802 |
||
1249 | 2803 |
text isEmptyOrNil ifTrue:[ |
2804 |
^ self noManPageForCommand:aCommand usingManCommand:manCommand. |
|
575 | 2805 |
]. |
2806 |
||
1249 | 2807 |
^ '<pre> |
2808 |
' , text , ' |
|
575 | 2809 |
</pre> |
2810 |
' |
|
2811 |
||
2812 |
" |
|
2813 |
self manPageFor:'cvs' |
|
2814 |
" |
|
2815 |
||
632 | 2816 |
"Modified: / 28.6.1996 / 21:28:47 / stefan" |
2817 |
"Created: / 9.9.1996 / 17:43:16 / cg" |
|
2818 |
"Modified: / 30.10.1997 / 13:30:22 / cg" |
|
575 | 2819 |
! |
2820 |
||
2821 |
manPageForFile:aFilename |
|
2822 |
"convert a .man file to html" |
|
2823 |
||
2824 |
^ self |
|
2825 |
manPageFor:aFilename asFilename name |
|
2826 |
manCommand:('nroff -man ' , aFilename asFilename pathName). |
|
2827 |
||
2828 |
" |
|
2829 |
self manPageForFile:'../../stc/stc.1' |
|
2830 |
" |
|
2831 |
" |
|
2832 |
HTMLDocumentView openFullOnText:(self manPageForFile:'../../stc/stc.1') |
|
2833 |
" |
|
2834 |
||
2835 |
"Modified: 4.4.1997 / 10:44:05 / cg" |
|
1249 | 2836 |
! |
2837 |
||
2838 |
manPageFromStream:manPageStream |
|
2839 |
"convert man-command output to html. |
|
2840 |
Only the body of the text (without head../head and body../body) is generated. |
|
2841 |
This method looks for |
|
2842 |
char-backspace-char -> bold |
|
2843 |
char-backspace-underline -> italic" |
|
2844 |
||
2845 |
|state ch keep| |
|
2846 |
||
2847 |
outStream := '' writeStream. |
|
2848 |
state := nil. |
|
2849 |
keep := nil. |
|
2850 |
[manPageStream atEnd] whileFalse:[ |
|
2851 |
ch := manPageStream next. |
|
2852 |
||
2853 |
ch notNil ifTrue:[ |
|
4197 | 2854 |
state isNil ifTrue:[ |
1249 | 2855 |
ch == Character backspace ifTrue:[ |
2856 |
state := #back |
|
2857 |
] ifFalse:[ |
|
2858 |
keep notNil ifTrue:[ |
|
2859 |
self nextPutAllEscaped:keep. |
|
2860 |
]. |
|
2861 |
keep := ch |
|
2862 |
] |
|
2863 |
] ifFalse:[ |
|
2864 |
state == #back ifTrue:[ |
|
2865 |
ch == keep ifTrue:[ |
|
2866 |
self nextPutBold:ch. |
|
2867 |
] ifFalse:[ |
|
2868 |
ch == $_ ifTrue:[ |
|
2869 |
keep notNil ifTrue:[ |
|
2870 |
self nextPutItalic:keep. |
|
2871 |
]. |
|
2872 |
] ifFalse:[ |
|
2873 |
keep == $_ ifTrue:[ |
|
2874 |
self nextPutItalic:ch. |
|
2875 |
] ifFalse:[ |
|
2876 |
keep notNil ifTrue:[ |
|
2877 |
self nextPutAllEscaped:keep. |
|
2878 |
self nextPutAllEscaped:ch. |
|
2879 |
]. |
|
2880 |
]. |
|
2881 |
]. |
|
2882 |
]. |
|
2883 |
state := keep := nil. |
|
2884 |
] |
|
2885 |
] |
|
2886 |
] |
|
2887 |
]. |
|
2888 |
||
2889 |
keep notNil ifTrue:[ |
|
2890 |
self nextPutAllEscaped:keep. |
|
2891 |
]. |
|
2892 |
^ outStream contents. |
|
2893 |
||
2894 |
" |
|
2895 |
HTMLDocGenerator new manPageFor:'cvs' |
|
2896 |
" |
|
2897 |
! |
|
2898 |
||
2899 |
noManPageForCommand:aCommand usingManCommand:manCommand |
|
2900 |
^ ' |
|
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
2901 |
No manual page for "<code><b>' , aCommand , '</b></code>" available. |
1249 | 2902 |
<BR> |
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
2903 |
(The failed command was: "<code>' , manCommand , '"</code>.) |
1249 | 2904 |
'. |
575 | 2905 |
! ! |
2906 |
||
1249 | 2907 |
!HTMLDocGenerator methodsFor:'helpers'! |
2908 |
||
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2909 |
anchorFor:href info:infoMessageOrNil text:text name:nameOrNil |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2910 |
|infoPart namePart| |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2911 |
|
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2912 |
infoPart := namePart := ''. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2913 |
|
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2914 |
infoMessageOrNil notNil ifTrue:[ |
1332
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
2915 |
infoPart := self infoParameterFor:infoMessageOrNil. |
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2916 |
]. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2917 |
nameOrNil notNil ifTrue:[ |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2918 |
namePart := 'NAME="' , nameOrNil , '" '. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2919 |
]. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2920 |
^ '<A HREF="' , href , '" ' |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2921 |
, namePart |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2922 |
, infoPart |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2923 |
, '>' , text |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2924 |
,'</A>'. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2925 |
|
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2926 |
" |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2927 |
self new anchorFor:'foo' info:'bla' text:'text' name:nil |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2928 |
" |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2929 |
! |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2930 |
|
1249 | 2931 |
anchorForHTMLAction:actionString info:infoMessageOrNil text:text |
1250 | 2932 |
^ self |
2933 |
anchorForHTMLAction:actionString |
|
2934 |
info:infoMessageOrNil |
|
2935 |
text:text |
|
2936 |
name:nil |
|
1249 | 2937 |
|
1250 | 2938 |
" |
2939 |
self new anchorForHTMLAction:'foo' info:'bla' text:'text' |
|
2940 |
" |
|
2941 |
! |
|
2942 |
||
2943 |
anchorForHTMLAction:actionString info:infoMessageOrNil text:text name:nameOrNil |
|
2944 |
|infoPart namePart| |
|
2945 |
||
2946 |
infoPart := namePart := ''. |
|
2947 |
||
1249 | 2948 |
infoMessageOrNil notNil ifTrue:[ |
1332
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
2949 |
infoPart := self infoParameterFor:infoMessageOrNil. |
1249 | 2950 |
]. |
1250 | 2951 |
nameOrNil notNil ifTrue:[ |
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
2952 |
namePart := 'name="' , nameOrNil , '" '. |
1250 | 2953 |
]. |
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
2954 |
^ '<a href="' , self pathToTopOfDocumentation , '/misc/onlyInSTX2.html" ' |
1250 | 2955 |
, namePart |
1249 | 2956 |
, infoPart |
1250 | 2957 |
, 'ACTION="html:' |
1249 | 2958 |
, actionString |
2959 |
, '">' , text |
|
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
2960 |
,'</a>'. |
1249 | 2961 |
|
2962 |
" |
|
2963 |
self new anchorForHTMLAction:'foo' info:'bla' text:'text' |
|
2964 |
" |
|
2965 |
! |
|
2966 |
||
2967 |
anchorForHTMLDocAction:actionString info:infoMessageOrNil text:text |
|
2968 |
^ self |
|
1250 | 2969 |
anchorForHTMLDocAction:actionString |
2970 |
info:infoMessageOrNil |
|
2971 |
text:text |
|
2972 |
name:nil |
|
1249 | 2973 |
|
2974 |
" |
|
2975 |
self new anchorForHTMLDocAction:'foo' info:'bla' text:'text' |
|
2976 |
" |
|
2977 |
! |
|
2978 |
||
1250 | 2979 |
anchorForHTMLDocAction:actionString info:infoMessageOrNil text:text name:anchorName |
2980 |
^ self |
|
4450 | 2981 |
anchorForHTMLAction:(self className , ' ' , actionString) |
1250 | 2982 |
info:infoMessageOrNil |
2983 |
text:text |
|
2984 |
name:anchorName |
|
2985 |
||
2986 |
" |
|
2987 |
self new anchorForHTMLDocAction:'foo' info:'bla' text:'text' name:'baz' |
|
2988 |
" |
|
4450 | 2989 |
|
2990 |
"Modified: / 28-06-2019 / 09:01:11 / Claus Gittinger" |
|
1250 | 2991 |
! |
2992 |
||
1249 | 2993 |
anchorForHTMLDocAction:actionString text:text |
2994 |
^ self anchorForHTMLDocAction:actionString info:nil text:text |
|
2995 |
||
2996 |
" |
|
2997 |
self new anchorForHTMLDocAction:'foo' text:'text' |
|
2998 |
" |
|
2999 |
! |
|
478 | 3000 |
|
3643 | 3001 |
findPathToTopOfDocumentation |
3002 |
<resource: #obsolete> |
|
3003 |
^ self class findPathToTopOfDocumentation |
|
3004 |
! |
|
3005 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3006 |
generateBODYEnd |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3007 |
generateBodyOnly == true ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3008 |
outStream nextPutLine:'</body>'. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3009 |
] |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3010 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3011 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3012 |
generateBODYStart |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3013 |
generateBodyOnly == true ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3014 |
outStream nextPutLine:'<body>'. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3015 |
] |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3016 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3017 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3018 |
generateBODYandHTMLEnd |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3019 |
self generateBODYEnd. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3020 |
self generateHTMLEnd. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3021 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3022 |
|
1328 | 3023 |
generateBackButton |
3024 |
|backHRef backLabel| |
|
3025 |
||
3026 |
backRef isNil ifTrue:[ |
|
3027 |
backHRef := self pathToLanguageTopOfDocumentation , '/TOP.html'. |
|
3028 |
backLabel := 'top'. |
|
3029 |
] ifFalse:[ |
|
3030 |
backHRef := backRef. |
|
3031 |
backLabel := 'back'. |
|
3032 |
]. |
|
3033 |
backCmd notNil ifTrue:[ |
|
3034 |
self |
|
3035 |
generateUpArrowButtonWithReference:backHRef |
|
3036 |
command:backCmd |
|
3037 |
imagePath:imagePath |
|
3038 |
altLabel:backLabel. |
|
3039 |
self generateHorizontalLine. |
|
3040 |
] ifFalse:[ |
|
3041 |
backHRef ~~ #none ifTrue:[ |
|
3042 |
self |
|
3043 |
generateUpArrowButtonWithReference:backHRef |
|
3044 |
command:nil |
|
3045 |
imagePath:imagePath |
|
3046 |
altLabel:backLabel. |
|
3047 |
self generateHorizontalLine. |
|
3048 |
] |
|
3049 |
]. |
|
3050 |
! |
|
3051 |
||
1250 | 3052 |
generateClassDocReferenceFor:className |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3053 |
self generateClassDocReferenceFor:className text:className |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3054 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3055 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3056 |
generateClassDocReferenceFor:className text:text |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
3057 |
self generateClassDocReferenceFor:className text:text autoloading:nil |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
3058 |
! |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
3059 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
3060 |
generateClassDocReferenceFor:className text:text autoloading:autoloadedClass |
2017 | 3061 |
"generates a link to a classes documentation" |
3062 |
||
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
3063 |
|href serviceLinkName action| |
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3064 |
|
3643 | 3065 |
self generatingForSTXBrowser ifTrue:[ |
4450 | 3066 |
action := self className , ' htmlDocOf:' , className. |
3643 | 3067 |
autoloadedClass notNil ifTrue:[ |
3068 |
action := autoloadedClass , ' autoload,', action. |
|
3069 |
]. |
|
3070 |
||
3071 |
href := self |
|
3072 |
anchorForHTMLAction:action |
|
3073 |
info:('Show documentation of ' , className ) |
|
3074 |
text:text. |
|
3075 |
] ifFalse:[ |
|
2017 | 3076 |
"/ page is generated for a real http service; |
3077 |
"/ generate a link to the services classDocOf page, |
|
3078 |
"/ Assumes that the server has a classDoc service running. |
|
1310 | 3079 |
httpRequestOrNil notNil ifTrue:[ |
3080 |
serviceLinkName := httpRequestOrNil serviceLinkName. |
|
3081 |
]. |
|
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3082 |
href := self |
2002 | 3083 |
anchorFor:(serviceLinkName, '/classDocOf,', (HTMLUtilities escape:className) ) |
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3084 |
info:('Show documentation of ' , className ) |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3085 |
text:text |
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3086 |
name:nil |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3087 |
]. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3088 |
|
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
3089 |
outStream nextPutAll:href. |
4450 | 3090 |
|
3091 |
"Modified: / 28-06-2019 / 09:01:15 / Claus Gittinger" |
|
1250 | 3092 |
! |
3093 |
||
1249 | 3094 |
generateH1:headerLine |
3095 |
outStream nextPutLine:'<h1>'. |
|
3096 |
outStream nextPutLine:headerLine. |
|
3097 |
outStream nextPutLine:'</h1>'. |
|
3098 |
! |
|
3099 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3100 |
generateHTMLEnd |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3101 |
generateBodyOnly == true ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3102 |
outStream nextPutLine:'</html>' |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3103 |
] |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3104 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3105 |
|
1249 | 3106 |
generateHTMLHeadWithTitle:title |
3643 | 3107 |
|generatedByComment| |
3108 |
||
4450 | 3109 |
generatedByComment := ('<!!-- generated by ' , self className , ' ' , thisContext sender selector , ' -->'). |
3643 | 3110 |
|
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3111 |
generateBodyOnly == true ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3112 |
outStream |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3113 |
nextPutLine:'<!!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">'; |
3643 | 3114 |
nextPutLine:generatedByComment; |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3115 |
cr; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3116 |
nextPutLine:'<html>'; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3117 |
nextPutLine:'<head>'; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3118 |
nextPutLine:'<title>'; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3119 |
nextPutLine:title; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3120 |
nextPutLine:'</title>'; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3121 |
nextPutLine:'</head>'; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3122 |
cr. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3123 |
] ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3124 |
outStream |
3643 | 3125 |
nextPutLine:generatedByComment |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3126 |
]. |
4450 | 3127 |
|
3128 |
"Modified: / 28-06-2019 / 09:01:25 / Claus Gittinger" |
|
1249 | 3129 |
! |
3130 |
||
3131 |
generateHorizontalLine |
|
3132 |
outStream nextPutLine:'<hr>'. |
|
3133 |
! |
|
3134 |
||
4127 | 3135 |
generateMethodDocReferenceFor:selector inClass:className text:text autoloading:autoloadedClass |
3136 |
"generates a link to a classes documentation" |
|
3137 |
||
3138 |
|href serviceLinkName action| |
|
3139 |
||
3140 |
self generatingForSTXBrowser ifTrue:[ |
|
4450 | 3141 |
action := self className , ' htmlDocOf:' , className. |
4127 | 3142 |
autoloadedClass notNil ifTrue:[ |
3143 |
action := autoloadedClass , ' autoload,', action. |
|
3144 |
]. |
|
3145 |
||
3146 |
href := self |
|
3147 |
anchorForHTMLAction:action |
|
3148 |
info:('Show documentation of ' , className ) |
|
3149 |
text:text. |
|
3150 |
] ifFalse:[ |
|
3151 |
"/ page is generated for a real http service; |
|
3152 |
"/ generate a link to the services classDocOf page, |
|
3153 |
"/ Assumes that the server has a classDoc service running. |
|
3154 |
httpRequestOrNil notNil ifTrue:[ |
|
3155 |
serviceLinkName := httpRequestOrNil serviceLinkName. |
|
3156 |
]. |
|
3157 |
href := self |
|
3158 |
anchorFor:(serviceLinkName, '/classDocOf,', (HTMLUtilities escape:className) ) |
|
3159 |
info:('Show documentation of ' , className ) |
|
3160 |
text:text |
|
3161 |
name:nil |
|
3162 |
]. |
|
3163 |
||
3164 |
outStream nextPutAll:href. |
|
4450 | 3165 |
|
3166 |
"Modified: / 28-06-2019 / 09:01:37 / Claus Gittinger" |
|
4127 | 3167 |
! |
3168 |
||
2017 | 3169 |
generatePackageDocReferenceFor:packageID text:text |
3170 |
"generates a link to a package documentation" |
|
3171 |
||
3172 |
|href serviceLinkName action| |
|
3173 |
||
3174 |
self generatingForSTXBrowser ifFalse:[ |
|
3644 | 3175 |
self generateDocumentForOfflineReading ifTrue:[ |
3176 |
href := self |
|
3177 |
anchorFor:(pathToTopOfDocumentation, '/packages/', (HTMLUtilities escape:packageID) ) |
|
3178 |
info:('Show documentation of package ' , packageID ) |
|
3179 |
text:text |
|
3180 |
name:nil |
|
3181 |
] ifFalse:[ |
|
3182 |
"/ page is generated for a real http service; |
|
3183 |
"/ generate a link to the services packageDocOf page, |
|
3184 |
"/ Assumes that the server has a classDoc service running. |
|
3185 |
httpRequestOrNil notNil ifTrue:[ |
|
3186 |
serviceLinkName := httpRequestOrNil serviceLinkName. |
|
3187 |
]. |
|
3188 |
href := self |
|
3189 |
anchorFor:(serviceLinkName, '/classListForPackage,', (HTMLUtilities escape:packageID) ) |
|
3190 |
info:('Show documentation of package ' , packageID ) |
|
3191 |
text:text |
|
3192 |
name:nil |
|
3193 |
] |
|
2017 | 3194 |
] ifTrue:[ |
4450 | 3195 |
action := self className , ' htmlPackageDocOf: #''' , packageID, ''''. |
2017 | 3196 |
href := self |
3197 |
anchorForHTMLAction:action |
|
3198 |
info:('Show documentation of package ' , packageID ) |
|
3199 |
text:text. |
|
3200 |
]. |
|
3201 |
||
3202 |
outStream nextPutAll:href. |
|
4450 | 3203 |
|
3204 |
"Modified: / 28-06-2019 / 09:01:41 / Claus Gittinger" |
|
2017 | 3205 |
! |
3206 |
||
1249 | 3207 |
generateUpArrowButtonForTop |
3644 | 3208 |
|top| |
3209 |
||
3210 |
self generateDocumentForOfflineReading ifTrue:[ |
|
3211 |
top := '../index.html'. |
|
3212 |
] ifFalse:[ |
|
3213 |
top := (self pathToLanguageTopOfDocumentation , '/TOP.html'). |
|
3214 |
]. |
|
3215 |
||
1249 | 3216 |
self |
3644 | 3217 |
generateUpArrowButtonWithReference:top |
1249 | 3218 |
command:nil |
3219 |
imagePath:nil |
|
3220 |
altLabel:'top' |
|
3221 |
! |
|
3222 |
||
3223 |
generateUpArrowButtonWithReference:backHRef command:backCmd imagePath:imagePath altLabel:altLabel |
|
1255 | 3224 |
|p| |
3225 |
||
3999 | 3226 |
self showUpButton ifFalse:[^ self]. |
3227 |
||
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
3228 |
outStream nextPutAll:'<a class="noprint" href="' , backHRef , '"'. |
1249 | 3229 |
backCmd notNil ifTrue:[ |
4450 | 3230 |
outStream nextPutAll:' action="html:' , self className , ' ' , backCmd , '"'. |
1249 | 3231 |
]. |
1255 | 3232 |
p := imagePath. |
3233 |
p isNil ifTrue:[ |
|
3234 |
p := self pathToTopOfDocumentation , '/icons' |
|
3235 |
]. |
|
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
3236 |
outStream nextPutLine:'><img src="' , p , '/DocsUpArrow.gif" alt="[' , (altLabel ? 'back') , ']"></a>'. |
4450 | 3237 |
|
3238 |
"Modified: / 28-06-2019 / 09:01:59 / Claus Gittinger" |
|
1249 | 3239 |
! |
3240 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3241 |
generatingForSTXBrowser |
3643 | 3242 |
self generateDocumentForOfflineReading ifTrue:[^ false]. |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3243 |
^ httpRequestOrNil isNil |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3244 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
3245 |
|
1332
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
3246 |
infoParameterFor:infoMessageOrNil |
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
3247 |
infoMessageOrNil isNil ifTrue:[^ '']. |
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
3248 |
|
1333 | 3249 |
^ |
1332
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
3250 |
'ONMOUSEOVER="window.status=''',infoMessageOrNil,'''; return true" ' , |
1923
57fbb3e512e3
generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents:
1896
diff
changeset
|
3251 |
'ONMOUSEOUT="window.status='' ''; return true" ' |
1332
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
3252 |
! |
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
3253 |
|
1308
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3254 |
methodCommentOf:aMethod |
3625 | 3255 |
"extract the very first comment from the method" |
3256 |
||
1308
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3257 |
|comment mClass mSel parseTree matcher| |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3258 |
|
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3259 |
comment := aMethod comment. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3260 |
comment notNil ifTrue:[^ comment]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3261 |
|
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3262 |
mClass := aMethod mclass. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3263 |
mClass isNil ifTrue:[^ nil]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3264 |
|
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3265 |
mSel := aMethod selector. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3266 |
mSel isNil ifTrue:[^ nil]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3267 |
|
4214 | 3268 |
"/ generate a comment if it's a getter, setter or similar |
1308
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3269 |
ParseTreeSearcher notNil ifTrue:[ |
1336 | 3270 |
aMethod messagesSent isEmpty ifTrue:[ |
1351 | 3271 |
parseTree := mClass parseTreeFor:mSel. |
3272 |
parseTree notNil ifTrue: [ |
|
3273 |
(mClass allInstanceVariableNames) do:[:eachVar | |
|
1336 | 3274 |
matcher := ParseTreeSearcher getterMethod:eachVar. |
1979 | 3275 |
(matcher executeTree: parseTree initialAnswer:false) ifTrue:[ |
1336 | 3276 |
^ 'Return the instance variable ' , eachVar, '.'. |
3277 |
]. |
|
1351 | 3278 |
|
1336 | 3279 |
matcher := ParseTreeSearcher setterMethod:eachVar. |
1979 | 3280 |
(matcher executeTree: parseTree initialAnswer:false) ifTrue:[ |
1336 | 3281 |
^ 'Set the instance variable ' , eachVar, '.'. |
3282 |
]. |
|
1308
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3283 |
]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3284 |
]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3285 |
]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3286 |
]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3287 |
|
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3288 |
"/ (mSuperClass := mClass superclass) notNil ifTrue:[ |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3289 |
"/self halt. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3290 |
"/ ]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3291 |
|
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3292 |
^ nil. |
4214 | 3293 |
|
3294 |
"Modified (comment): / 13-02-2017 / 20:21:50 / cg" |
|
1308
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3295 |
! |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
3296 |
|
3625 | 3297 |
methodExampleCommentsOf:aMethod |
3298 |
"extract the very last comment from the method" |
|
3299 |
||
3300 |
|comments partOfSelector| |
|
3301 |
||
3302 |
comments := aMethod parserClass methodCommentsFromSource:aMethod source. |
|
3303 |
comments size <= 1 ifTrue:[^ nil]. |
|
3304 |
||
3305 |
"/ look for comments which make up valid source code in the method's language |
|
3306 |
||
3307 |
partOfSelector := aMethod selector. |
|
3308 |
(partOfSelector includes:$:) ifTrue:[ |
|
3309 |
partOfSelector := partOfSelector copyTo:(partOfSelector indexOf:$:) |
|
3310 |
]. |
|
3311 |
comments := (comments from:2) |
|
3312 |
select:[:each | |
|
3313 |
(each includesString:partOfSelector) |
|
3314 |
and:[ |
|
3315 |
|rslt| |
|
3316 |
||
4481 | 3317 |
rslt := [ aMethod parserClass parseExpression:each onError:#Error] on:Error do:#Error. |
3625 | 3318 |
rslt ~~ #Error. |
3319 |
]. |
|
3320 |
]. |
|
3321 |
^ comments. |
|
3322 |
! |
|
3323 |
||
1249 | 3324 |
nextPutAllEscaped:aStringOrCharacter |
3325 |
outStream nextPutAll:(self withSpecialHTMLCharactersEscaped:aStringOrCharacter) |
|
3326 |
! |
|
3327 |
||
3328 |
nextPutBold:aStringOrCharacter |
|
3329 |
outStream nextPutAll:'<b>'. |
|
3330 |
self nextPutAllEscaped:aStringOrCharacter. |
|
3331 |
outStream nextPutAll:'</b>'. |
|
3332 |
! |
|
3333 |
||
3334 |
nextPutItalic:aStringOrCharacter |
|
3335 |
outStream nextPutAll:'<i>'. |
|
3336 |
self nextPutAllEscaped:aStringOrCharacter. |
|
3337 |
outStream nextPutAll:'</i>'. |
|
3338 |
! |
|
3339 |
||
1974 | 3340 |
shownSubclassesOf:aClass |
3341 |
|subs| |
|
3342 |
||
3343 |
subs := aClass subclasses. |
|
3344 |
subs := subs select:[:cls | |def| |
|
2205
6a7e8629edd5
changed: #shownSubclassesOf:
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
3345 |
def := cls projectDefinitionClass. |
1974 | 3346 |
def isNil or:[def showClassDocumentationOf:cls]]. |
3347 |
subs := subs asOrderedCollection sort:[:a :b | a name < b name]. |
|
3348 |
^ subs |
|
3349 |
||
3350 |
"Created: / 05-11-2007 / 17:22:27 / cg" |
|
3351 |
! |
|
3352 |
||
1249 | 3353 |
withSpecialHTMLCharactersEscaped:aStringOrCharacter |
3915 | 3354 |
|string| |
3355 |
||
3356 |
string := aStringOrCharacter isString ifTrue:[aStringOrCharacter] ifFalse:[aStringOrCharacter asString]. |
|
3357 |
^ HTMLUtilities escapeCharacterEntities:string |
|
1249 | 3358 |
|
3359 |
" |
|
3360 |
self new withSpecialHTMLCharactersEscaped:'foo>' |
|
3361 |
self new withSpecialHTMLCharactersEscaped:$< |
|
3362 |
self new withSpecialHTMLCharactersEscaped:$A |
|
3363 |
" |
|
2327
99495bed5445
changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
3364 |
|
99495bed5445
changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2252
diff
changeset
|
3365 |
"Modified: / 13-04-2011 / 23:11:16 / cg" |
478 | 3366 |
! ! |
3367 |
||
1255 | 3368 |
!HTMLDocGenerator methodsFor:'pathnames'! |
3369 |
||
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3370 |
pathToDocumentationFile:relativeHref |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3371 |
|top| |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3372 |
|
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3373 |
top := self pathToLanguageTopOfDocumentation. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3374 |
(top asFilename construct:relativeHref) exists ifTrue:[ |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3375 |
"unix format: used as URL" |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3376 |
^ top , '/' , relativeHref |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3377 |
]. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3378 |
^ self pathToEnglishTopOfDocumentation , '/' , relativeHref |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3379 |
! |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3380 |
|
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3381 |
pathToEnglishTopOfDocumentation |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3382 |
"/ always unix-name convention (used as an URL) |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3383 |
^ self pathToTopOfDocumentation , '/english' |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3384 |
! |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
3385 |
|
1255 | 3386 |
pathToLanguageTopOfDocumentation |
3387 |
|languageSpecificDocDirectory fn| |
|
3388 |
||
3389 |
pathToLanguageTopOfDocumentation isNil ifTrue:[ |
|
3390 |
pathToLanguageTopOfDocumentation := self pathToTopOfDocumentation. |
|
3391 |
languageSpecificDocDirectory := self class languageSpecificDocDirectory. |
|
3392 |
fn := pathToLanguageTopOfDocumentation asFilename construct:languageSpecificDocDirectory. |
|
3393 |
(fn exists and:[fn isDirectory]) ifTrue:[ |
|
3394 |
"/ always unix-name convention (used as an URL) |
|
3395 |
pathToLanguageTopOfDocumentation := pathToLanguageTopOfDocumentation , '/' , languageSpecificDocDirectory. |
|
3396 |
]. |
|
3397 |
]. |
|
3398 |
^ pathToLanguageTopOfDocumentation |
|
3399 |
! |
|
3400 |
||
3401 |
pathToTopOfDocumentation |
|
3402 |
pathToTopOfDocumentation isNil ifTrue:[ |
|
3643 | 3403 |
pathToTopOfDocumentation := self class findPathToTopOfDocumentation |
1255 | 3404 |
]. |
3405 |
^ pathToTopOfDocumentation |
|
3406 |
! ! |
|
3407 |
||
498 | 3408 |
!HTMLDocGenerator class methodsFor:'documentation'! |
478 | 3409 |
|
3410 |
version |
|
3915 | 3411 |
^ '$Header$' |
2178
af7b05dfeaae
changed: #languageSpecificDocDirectory
Claus Gittinger <cg@exept.de>
parents:
2055
diff
changeset
|
3412 |
! |
af7b05dfeaae
changed: #languageSpecificDocDirectory
Claus Gittinger <cg@exept.de>
parents:
2055
diff
changeset
|
3413 |
|
af7b05dfeaae
changed: #languageSpecificDocDirectory
Claus Gittinger <cg@exept.de>
parents:
2055
diff
changeset
|
3414 |
version_CVS |
3915 | 3415 |
^ '$Header$' |
478 | 3416 |
! ! |
3232
de4bd4dcb49f
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
2865
diff
changeset
|
3417 |