author | Claus Gittinger <cg@exept.de> |
Mon, 11 Nov 2002 10:41:02 +0100 | |
changeset 1178 | 3d3111846c92 |
parent 1143 | 0d5bf26001d1 |
child 1216 | b854fdc89d2a |
permissions | -rw-r--r-- |
601 | 1 |
" |
2 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
14 |
||
1138
aa7687ec256f
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
15 |
"{ Package: 'stx:libhtml' }" |
aa7687ec256f
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
16 |
|
478 | 17 |
Object subclass:#HTMLDocGenerator |
18 |
instanceVariableNames:'' |
|
19 |
classVariableNames:'' |
|
20 |
poolDictionaries:'' |
|
21 |
category:'System-Documentation' |
|
22 |
! |
|
23 |
||
498 | 24 |
!HTMLDocGenerator class methodsFor:'documentation'! |
478 | 25 |
|
601 | 26 |
copyright |
27 |
" |
|
28 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
||
39 |
||
40 |
! |
|
41 |
||
478 | 42 |
documentation |
43 |
" |
|
817 | 44 |
Generates HTML documentation for a class. |
45 |
Although this is normally used with the SystemBrowser |
|
46 |
(classes-generate documentation menu), |
|
47 |
it may be useful on its own, to programatically generate |
|
48 |
up-to-date documents from a classes source. |
|
49 |
||
50 |
This generator extracts the documentation methods source |
|
51 |
(or comment), individual method comments (the first comment in |
|
52 |
a method) and version information to generate a neatly formatted |
|
53 |
HTML page. |
|
54 |
If executable examples (EXBEGIN .. EXEND) are present in the classes |
|
55 |
documentation category these are also added as executable code |
|
56 |
to the document. |
|
478 | 57 |
|
58 |
[author:] |
|
59 |
Claus Gittinger |
|
817 | 60 |
|
61 |
[see also:] |
|
62 |
BrowserView |
|
63 |
HTMLDocumentView |
|
478 | 64 |
" |
65 |
! ! |
|
66 |
||
498 | 67 |
!HTMLDocGenerator class methodsFor:'document generation'! |
478 | 68 |
|
69 |
htmlClassCategoryList |
|
632 | 70 |
"generate a formatted list of all available class categories as |
71 |
an HTML string. Each category will be a hyperlink to another |
|
72 |
autogenerated page, containing the classes per category. |
|
73 |
The generated page is supposed to be given to an HTML reader |
|
74 |
with home being set to ../doc/online/xxx/classDoc |
|
75 |
(i.e. the images are to be found one-up in the doc hierarchy)" |
|
76 |
||
492 | 77 |
|categories s prefixList prefix prefixStack prev| |
478 | 78 |
|
79 |
categories := Set new. |
|
80 |
||
81 |
Smalltalk allClasses do:[:cls | |
|
498 | 82 |
cls isPrivate ifFalse:[ |
917
c77bb2d56e05
#isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
83 |
(cls isNameSpace not or:[cls == Smalltalk]) ifTrue:[ |
528 | 84 |
categories add:cls category |
85 |
] |
|
498 | 86 |
] |
478 | 87 |
]. |
88 |
||
89 |
categories := categories asOrderedCollection sort. |
|
90 |
||
91 |
s := '' writeStream. |
|
92 |
||
93 |
s nextPutAll:' |
|
94 |
<html> |
|
95 |
<head> |
|
96 |
<title> |
|
97 |
Class categories: |
|
98 |
</title> |
|
99 |
</head> |
|
100 |
<body> |
|
632 | 101 |
<a NOPRINT HREF="TOP.html"> <IMG SRC="../icons/DocsUpArrow.gif" ALT="[back]"></A> |
478 | 102 |
|
103 |
<hr> |
|
104 |
<h1>Class categories:</h1> |
|
105 |
||
106 |
<ul> |
|
107 |
'. |
|
108 |
||
109 |
prefixList := Set new. |
|
110 |
||
111 |
categories keysAndValuesDo:[:index :element | |
|
112 |
|prev common| |
|
113 |
||
114 |
index ~~ 1 ifTrue:[ |
|
115 |
prev := categories at:(index - 1). |
|
116 |
common := (Array with:prev with:element) longestCommonPrefix. |
|
117 |
(common endsWith:'-') ifTrue:[ |
|
118 |
prefixList add:(common copyWithoutLast:1) |
|
119 |
] ifFalse:[ |
|
553 | 120 |
(common includes:$-) ifTrue:[ |
121 |
prefixList add:(common copyTo:(common lastIndexOf:$-)-1). |
|
122 |
] ifFalse:[ |
|
1143 | 123 |
"/ common = prev ifTrue:[ |
124 |
"/ prefixList add:common |
|
125 |
"/ ] |
|
478 | 126 |
] |
127 |
] |
|
128 |
] |
|
129 |
]. |
|
130 |
||
131 |
prefix := ''. prefixStack := OrderedCollection new. |
|
132 |
prev := ''. |
|
133 |
||
134 |
categories := categories select:[:nm | nm ~= 'obsolete']. |
|
135 |
||
136 |
categories do:[:nm | |
|
137 |
|longest| |
|
138 |
||
139 |
"/ longest prefix .... |
|
140 |
longest := prefixList inject:'' into:[:maxPrefix :prefix | |
|
1143 | 141 |
|prefixWithDash| |
142 |
||
143 |
prefixWithDash := prefix , '-'. |
|
478 | 144 |
nm = prefix ifTrue:[ |
145 |
maxPrefix |
|
146 |
] ifFalse:[ |
|
1143 | 147 |
(nm startsWith:prefixWithDash) |
478 | 148 |
ifTrue:[ |
1143 | 149 |
prefixWithDash size > maxPrefix size |
478 | 150 |
ifTrue:[ |
1143 | 151 |
prefixWithDash |
478 | 152 |
] ifFalse:[ |
153 |
maxPrefix |
|
154 |
] |
|
155 |
] ifFalse:[ |
|
156 |
maxPrefix |
|
157 |
] |
|
158 |
] |
|
159 |
]. |
|
160 |
||
161 |
longest size > 0 ifTrue:[ |
|
162 |
longest = prefix ifTrue:[ |
|
163 |
"/ no change |
|
164 |
] ifFalse:[ |
|
165 |
(longest startsWith:prefix) ifTrue:[ |
|
166 |
prefixStack addLast:longest. |
|
167 |
longest ~= prev ifTrue:[ |
|
168 |
prefixStack size == 1 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
169 |
s nextPutLine:'<p>'. |
478 | 170 |
]. |
1143 | 171 |
s nextPutLine:'<li>' , (longest copyFrom:prefix size + 1). |
478 | 172 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
173 |
s nextPutLine:'<ul>'. |
478 | 174 |
prefix := longest. |
175 |
] ifFalse:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
176 |
s nextPutLine:'</ul>'. |
552 | 177 |
prefixStack notEmpty ifTrue:[ |
178 |
prefixStack removeLast. |
|
179 |
]. |
|
478 | 180 |
|
181 |
[prefixStack notEmpty |
|
182 |
and:[(longest startsWith:prefixStack last) not]] whileTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
183 |
s nextPutLine:'</ul>'. |
478 | 184 |
prefixStack removeLast. |
185 |
]. |
|
186 |
||
187 |
prefixStack notEmpty ifTrue:[ |
|
188 |
prefix := prefixStack last. |
|
189 |
] ifFalse:[ |
|
190 |
prefixStack addLast:longest. |
|
191 |
prefix := longest. |
|
192 |
longest ~= prev ifTrue:[ |
|
193 |
prefixStack size == 1 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
194 |
s nextPutLine:'<p>'. |
478 | 195 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
196 |
s nextPutLine:'<li>' , longest. |
478 | 197 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
198 |
s nextPutLine:'<ul>'. |
478 | 199 |
] |
200 |
]. |
|
201 |
] |
|
202 |
] ifFalse:[ |
|
203 |
[prefixStack size > 0] whileTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
204 |
s nextPutLine:'</ul>'. |
478 | 205 |
prefixStack removeLast. |
206 |
]. |
|
207 |
prefixStack size == 0 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
208 |
s nextPutLine:'<p>'. |
478 | 209 |
]. |
210 |
prefix := ''. |
|
211 |
]. |
|
212 |
||
213 |
s nextPutAll:'<li><a href="../misc/onlyInSTX2.html" action="html:' |
|
214 |
, self name |
|
215 |
, ' htmlClassesListOfCategory:''' , nm |
|
216 |
, ''' backTo:''htmlClassCategoryList''">' |
|
217 |
"/ full name: |
|
218 |
"/ , nm ,'</a>';cr. |
|
219 |
||
220 |
"/ cut off prefix: |
|
221 |
, (nm copyFrom:prefix size + 1) ,'</a>';cr. |
|
222 |
prev := nm. |
|
223 |
]. |
|
224 |
||
225 |
s nextPutAll:' |
|
226 |
</ul> |
|
227 |
||
228 |
</body> |
|
229 |
</html> |
|
230 |
'. |
|
231 |
||
232 |
^ s contents |
|
233 |
||
234 |
" |
|
235 |
HTMLDocGenerator htmlClassCategoryList |
|
236 |
" |
|
237 |
||
632 | 238 |
"Created: / 22.4.1996 / 20:03:30 / cg" |
239 |
"Modified: / 30.10.1997 / 13:16:08 / cg" |
|
478 | 240 |
! |
241 |
||
242 |
htmlClassListPrefix:prefix |
|
632 | 243 |
"generate an HTML document string which contains HREFS for a list |
244 |
of classes which start with some prefix (typically, the first |
|
245 |
character is given)" |
|
246 |
||
478 | 247 |
|classes| |
248 |
||
249 |
classes := Smalltalk allClasses |
|
498 | 250 |
select:[:cls | |
251 |
cls isPrivate not |
|
917
c77bb2d56e05
#isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
252 |
and:[(cls isNameSpace not or:[cls == Smalltalk]) |
528 | 253 |
and:[cls name startsWith:prefix]] |
498 | 254 |
]. |
478 | 255 |
|
498 | 256 |
^ self |
257 |
htmlClasses:classes |
|
632 | 258 |
title:('Classes starting with ''' , prefix asString , ''':'). |
478 | 259 |
|
632 | 260 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
261 |
"Modified: / 30.10.1997 / 13:21:49 / cg" |
|
478 | 262 |
! |
263 |
||
264 |
htmlClasses:classes title:title |
|
632 | 265 |
"generate an HTML document string which contains HREFS for a given list |
266 |
of classes" |
|
267 |
||
478 | 268 |
^ self |
269 |
htmlClasses:classes |
|
270 |
title:title |
|
271 |
backTo:nil |
|
272 |
||
632 | 273 |
"Modified: / 30.10.1997 / 13:21:40 / cg" |
478 | 274 |
! |
275 |
||
276 |
htmlClasses:classes title:title backTo:backRef |
|
632 | 277 |
"generate an HTML document string which contains HREFS for a given list |
278 |
of classes. If backref is nonNil, a back-button to that |
|
279 |
HREF is added at the top. |
|
280 |
The generated page is supposed to be given to an HTML reader |
|
281 |
with home being set to ../doc/online/xxx/classDoc |
|
282 |
(i.e. the images are to be found one-up in the doc hierarchy)" |
|
283 |
||
478 | 284 |
|classNames s| |
285 |
||
286 |
classNames := (classes collect:[:cls | cls name]) asOrderedCollection sort. |
|
287 |
||
288 |
s := '' writeStream. |
|
289 |
||
290 |
||
291 |
s nextPutAll:' |
|
292 |
<html> |
|
293 |
<head> |
|
294 |
<title> |
|
295 |
'. |
|
296 |
s nextPutAll:title. |
|
297 |
s nextPutAll:' |
|
298 |
</title> |
|
299 |
</head> |
|
300 |
<body> |
|
301 |
'. |
|
302 |
backRef notNil ifTrue:[ |
|
303 |
backRef == #none ifFalse:[ |
|
632 | 304 |
s nextPutAll:'<a NOPRINT HREF="TOP.html" action="html:' , self name , ' ' , backRef , '"> <IMG SRC="../icons/DocsUpArrow.gif" ALT="[back]"></A>'. |
478 | 305 |
] |
306 |
] ifFalse:[ |
|
632 | 307 |
s nextPutAll:'<a NOPRINT HREF="TOP.html"> <IMG SRC="../icons/DocsUpArrow.gif" ALT="[back]"></A>'. |
478 | 308 |
]. |
309 |
backRef ~~ #none ifTrue:[ |
|
310 |
s nextPutAll:'<hr> |
|
311 |
'. |
|
312 |
]. |
|
313 |
||
314 |
s nextPutAll:' |
|
315 |
<h1> |
|
316 |
'. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
317 |
s nextPutLine:title. |
478 | 318 |
s nextPutAll:' |
319 |
</h1> |
|
320 |
<ul> |
|
321 |
'. |
|
322 |
||
323 |
classNames do:[:nm | |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
324 |
s nextPutLine:'<li><a href="../misc/onlyInSTX2.html" action="html:' , self name ,' htmlDocOf:' , nm , '">' , nm , '</A>' |
478 | 325 |
]. |
326 |
||
327 |
s nextPutAll:' |
|
328 |
</ul> |
|
329 |
</body> |
|
330 |
</html> |
|
331 |
'. |
|
332 |
||
333 |
^ s contents |
|
334 |
||
632 | 335 |
"Created: / 23.4.1996 / 15:31:55 / cg" |
336 |
"Modified: / 30.10.1997 / 13:21:32 / cg" |
|
478 | 337 |
! |
338 |
||
339 |
htmlClassesListOfCategory:category |
|
632 | 340 |
"generate an HTML document string which contains HREFS for a list |
341 |
of classes which are contained in a particular category." |
|
342 |
||
528 | 343 |
^ self |
344 |
htmlClassesListOfCategory:category |
|
478 | 345 |
backTo:nil |
346 |
||
632 | 347 |
"Modified: / 30.10.1997 / 13:21:23 / cg" |
478 | 348 |
! |
349 |
||
350 |
htmlClassesListOfCategory:category backTo:backRef |
|
632 | 351 |
"generate an HTML document string which contains HREFS for a list |
352 |
of classes which are contained in a particular category." |
|
353 |
||
478 | 354 |
|classes| |
355 |
||
356 |
classes := Smalltalk allClasses |
|
498 | 357 |
select:[:cls | cls isPrivate not |
917
c77bb2d56e05
#isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
358 |
and:[(cls isNameSpace not or:[cls == Smalltalk]) |
528 | 359 |
and:[cls category = category]] |
360 |
]. |
|
478 | 361 |
|
362 |
^ self |
|
632 | 363 |
htmlClasses:classes |
364 |
title:('Classes in: ' , category) |
|
478 | 365 |
backTo:backRef |
366 |
||
632 | 367 |
"Created: / 23.4.1996 / 15:39:39 / cg" |
368 |
"Modified: / 30.10.1997 / 13:21:16 / cg" |
|
478 | 369 |
! |
370 |
||
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
371 |
htmlClassesMatching:aMatchPattern backTo:backRef |
632 | 372 |
"generate an HTML document string which contains HREFS |
373 |
for a list of classes whose name matches a given matchPattern." |
|
374 |
||
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
375 |
|classes cls| |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
376 |
|
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
377 |
classes := Smalltalk allClasses |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
378 |
select:[:cls | cls isPrivate not |
917
c77bb2d56e05
#isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
379 |
and:[(cls isNameSpace not or:[cls == Smalltalk]) |
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
380 |
and:[aMatchPattern match:cls name]] |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
381 |
]. |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
382 |
|
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
383 |
^ self |
632 | 384 |
htmlClasses:classes |
385 |
title:('Classes matching: ' , aMatchPattern) |
|
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
386 |
backTo:backRef |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
387 |
|
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
388 |
" |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
389 |
self htmlClassesMatching:'Tgen::*' backTo:nil |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
390 |
" |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
391 |
|
632 | 392 |
"Modified: / 30.10.1997 / 13:21:06 / cg" |
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
393 |
! |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
394 |
|
478 | 395 |
htmlDocOf:aClass |
632 | 396 |
"generate an HTML document string which contains a classes documentation" |
397 |
||
478 | 398 |
^ self htmlDocOf:aClass back:nil backRef:nil |
399 |
||
400 |
" |
|
401 |
self htmlDocOf:PostscriptPrinterStream |
|
402 |
" |
|
403 |
||
632 | 404 |
"Modified: / 30.10.1997 / 13:22:19 / cg" |
478 | 405 |
! |
406 |
||
407 |
htmlDocOf:aClass back:backCmd |
|
632 | 408 |
"generate an HTML document string which contains a classes documentation" |
409 |
||
478 | 410 |
^ self htmlDocOf:aClass back:backCmd backRef:nil |
411 |
||
632 | 412 |
"Modified: / 30.10.1997 / 13:22:27 / cg" |
478 | 413 |
! |
414 |
||
415 |
htmlDocOf:aClass back:backCmd backRef:backRef |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
416 |
"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
|
417 |
to a command or document. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
418 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
419 |
Extract sections from the classes documentation method, |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
420 |
where the following lines start a special subsection: |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
421 |
[see also:] - references to other classes and/or documents |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
422 |
[start with:] - one-liners to start a demonstration |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
423 |
[author:] - author(s) of this class |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
424 |
[warning:] - usage warnings if any |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
425 |
[hints:] - usage hints if any |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
426 |
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
|
427 |
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
|
428 |
to an empty line. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
429 |
|
632 | 430 |
Also extract examples from the classes example method, |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
431 |
where executable examples are made from sections enclosed in: |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
432 |
[exBegin] |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
433 |
... |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
434 |
[exEnd] |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
435 |
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
|
436 |
everything else is plain documentation text. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
437 |
" |
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
438 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
439 |
^ self |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
440 |
htmlDocOf:aClass |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
441 |
back:backCmd |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
442 |
backRef:backRef |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
443 |
imagePath:'../icons' |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
444 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
445 |
! |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
446 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
447 |
htmlDocOf:aClass back:backCmd backRef:backRef imagePath:imagePath |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
448 |
"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
|
449 |
to a command or document. |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
450 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
451 |
Extract sections from the classes documentation method, |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
452 |
where the following lines start a special subsection: |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
453 |
[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
|
454 |
[start with:] - one-liners to start a demonstration |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
455 |
[author:] - author(s) of this class |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
456 |
[warning:] - usage warnings if any |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
457 |
[hints:] - usage hints if any |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
458 |
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
|
459 |
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
|
460 |
to an empty line. |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
461 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
462 |
Also extract examples from the classes example method, |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
463 |
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
|
464 |
[exBegin] |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
465 |
... |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
466 |
[exEnd] |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
467 |
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
|
468 |
everything else is plain documentation text. |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
469 |
" |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
470 |
|
478 | 471 |
|supers s indent m docu examples firstIndent firstNonEmpty |
472 |
collectionOfCategories collectionOfClassCategories |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
473 |
revInfo pckgInfo subs refLines demoLines warnLines hintLines |
499 | 474 |
backHRef authorLines first wasLoaded didLoadBin |
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
475 |
privateClasses owner className metaClass shortName shortMetaName |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
476 |
text path| |
478 | 477 |
|
600 | 478 |
aClass isNil ifTrue:[ |
479 |
^ '' "/ just in case ... |
|
480 |
]. |
|
481 |
||
478 | 482 |
(wasLoaded := aClass isLoaded) ifFalse:[ |
483 |
"/ load it - but not a binary |
|
484 |
didLoadBin := Smalltalk loadBinaries. |
|
485 |
Smalltalk loadBinaries:false. |
|
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
486 |
[ |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
487 |
aClass autoload. |
1140
96ccc944d23a
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
488 |
] ensure:[ |
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
489 |
didLoadBin ifTrue:[Smalltalk loadBinaries:true]. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
490 |
] |
478 | 491 |
]. |
492 |
||
499 | 493 |
owner := aClass owningClass. |
569 | 494 |
privateClasses := aClass privateClassesSorted. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
495 |
className := aClass name. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
496 |
shortName := aClass nameWithoutPrefix. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
497 |
metaClass := aClass class. |
523 | 498 |
shortMetaName := metaClass nameWithoutPrefix. |
499 | 499 |
|
478 | 500 |
"/ |
501 |
"/ extract documentation or comment, if there is any |
|
502 |
"/ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
503 |
m := metaClass compiledMethodAt:#documentation. |
478 | 504 |
m notNil ifTrue:[ |
505 |
docu := m comment. |
|
506 |
] ifFalse:[ |
|
507 |
"try comment" |
|
508 |
docu := aClass comment. |
|
509 |
]. |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
510 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
511 |
(docu notNil and:[docu isEmpty]) ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
512 |
docu := nil |
478 | 513 |
]. |
514 |
docu notNil ifTrue:[ |
|
515 |
docu := (docu copy |
|
516 |
replChar:$< withString:'<') |
|
517 |
replChar:$> withString:'>'. |
|
518 |
||
519 |
docu := docu asStringCollection. |
|
520 |
||
521 |
"/ |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
522 |
"/ search for a [see also:] section |
478 | 523 |
"/ |
524 |
refLines := self extractSpecial:'[see also:]' from:docu. |
|
525 |
||
526 |
"/ |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
527 |
"/ search for a [start with:] section |
478 | 528 |
"/ |
529 |
demoLines := self extractSpecial:'[start with:]' from:docu. |
|
530 |
||
531 |
"/ |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
532 |
"/ search for a [author:] section |
478 | 533 |
"/ |
534 |
authorLines := self extractSpecial:'[author:]' from:docu. |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
535 |
authorLines isNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
536 |
authorLines := self extractSpecial:'[authors:]' from:docu. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
537 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
538 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
539 |
"/ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
540 |
"/ search for a [warning:] section |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
541 |
"/ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
542 |
warnLines := self extractSpecial:'[warning:]' from:docu. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
543 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
544 |
"/ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
545 |
"/ search for a [hints:] section |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
546 |
"/ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
547 |
hintLines := self extractSpecial:'[hints:]' from:docu. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
548 |
hintLines isNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
549 |
hintLines := self extractSpecial:'[hint:]' from:docu. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
550 |
]. |
478 | 551 |
|
649 | 552 |
docu notEmpty ifTrue:[ |
553 |
"/ |
|
554 |
"/ strip off empty lines |
|
555 |
"/ |
|
650
f3cbff8e76ae
oops - another check for empty doc
Claus Gittinger <cg@exept.de>
parents:
649
diff
changeset
|
556 |
[docu notEmpty and:[(docu at:1) size == 0]] whileTrue:[ |
649 | 557 |
docu removeIndex:1 |
558 |
]. |
|
650
f3cbff8e76ae
oops - another check for empty doc
Claus Gittinger <cg@exept.de>
parents:
649
diff
changeset
|
559 |
[docu notEmpty and:[(docu at:docu size) size == 0]] whileTrue:[ |
649 | 560 |
docu removeIndex:(docu size) |
561 |
]. |
|
478 | 562 |
]. |
563 |
||
564 |
docu notEmpty ifTrue:[ |
|
565 |
firstIndent := docu first leftIndent. |
|
566 |
firstIndent > 0 ifTrue:[ |
|
567 |
docu := docu collect:[:line | |
|
568 |
line leftIndent >= firstIndent ifTrue:[ |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
569 |
line copyFrom:firstIndent + 1. |
478 | 570 |
] ifFalse:[ |
571 |
line |
|
572 |
] |
|
573 |
]. |
|
574 |
]. |
|
575 |
firstNonEmpty := docu findFirst:[:line | line notEmpty]. |
|
576 |
firstNonEmpty > 1 ifTrue:[ |
|
577 |
docu := docu copyFrom:firstNonEmpty |
|
578 |
] |
|
579 |
]. |
|
580 |
docu := docu asString. |
|
581 |
]. |
|
582 |
||
583 |
refLines notNil ifTrue:[ |
|
584 |
refLines := refLines collect:[:l | |
|
585 |
|t| |
|
586 |
||
587 |
((t := l withoutSeparators) startsWith:'(') ifTrue:[ |
|
588 |
t |
|
589 |
] ifFalse:[ |
|
590 |
l asCollectionOfWords |
|
591 |
] |
|
592 |
]. |
|
593 |
]. |
|
594 |
||
595 |
"/ |
|
596 |
"/ extract examples if there are any |
|
597 |
"/ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
598 |
m := metaClass compiledMethodAt:#examples. |
478 | 599 |
m notNil ifTrue:[ |
600 |
examples := m comment. |
|
601 |
examples notNil ifTrue:[ |
|
602 |
examples isEmpty ifTrue:[ |
|
603 |
examples := nil |
|
604 |
]. |
|
605 |
]. |
|
606 |
examples notNil ifTrue:[ |
|
607 |
examples := (examples copy |
|
608 |
replChar:$< withString:'<') |
|
609 |
replChar:$> withString:'>'. |
|
610 |
||
611 |
examples := examples asStringCollection. |
|
612 |
||
613 |
"/ |
|
614 |
"/ strip off empty lines |
|
615 |
"/ |
|
616 |
[examples first size == 0] whileTrue:[ |
|
617 |
examples removeIndex:1 |
|
618 |
]. |
|
619 |
[examples last size == 0] whileTrue:[ |
|
620 |
examples removeIndex:(examples size) |
|
621 |
]. |
|
622 |
||
623 |
examples notEmpty ifTrue:[ |
|
624 |
firstIndent := examples first withTabsExpanded leftIndent. |
|
625 |
firstIndent > 0 ifTrue:[ |
|
626 |
examples := examples collect:[:line | |
|
627 |
|l| |
|
628 |
||
629 |
l := line withTabsExpanded. |
|
630 |
l leftIndent >= firstIndent ifTrue:[ |
|
631 |
l copyFrom:firstIndent. |
|
632 |
] ifFalse:[ |
|
633 |
l |
|
634 |
] |
|
635 |
]. |
|
636 |
]. |
|
637 |
firstNonEmpty := examples findFirst:[:line | line notEmpty]. |
|
638 |
firstNonEmpty > 1 ifTrue:[ |
|
639 |
examples := examples copyFrom:firstNonEmpty |
|
640 |
] |
|
641 |
]. |
|
642 |
] |
|
643 |
]. |
|
644 |
||
732 | 645 |
collectionOfClassCategories := metaClass categories asSortedCollection. |
478 | 646 |
collectionOfClassCategories size > 0 ifTrue:[ |
647 |
collectionOfClassCategories := collectionOfClassCategories asOrderedCollection. |
|
648 |
collectionOfClassCategories remove:'documentation' ifAbsent:nil. |
|
649 |
]. |
|
732 | 650 |
collectionOfCategories := aClass categories asSortedCollection. |
478 | 651 |
collectionOfCategories size > 0 ifTrue:[ |
652 |
collectionOfCategories := collectionOfCategories asOrderedCollection. |
|
653 |
]. |
|
654 |
||
655 |
(aClass == Autoload or:[aClass == Object]) ifTrue:[ |
|
656 |
subs := #() |
|
657 |
] ifFalse:[ |
|
658 |
subs := aClass subclasses |
|
659 |
asOrderedCollection sort:[:a :b | a name < b name]. |
|
660 |
]. |
|
661 |
||
662 |
s := '' writeStream. |
|
663 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
664 |
s nextPutLine:'<html><head><title>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
665 |
s nextPutAll:'Class: '; nextPutLine:(className). |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
666 |
s nextPutLine:'</title></head><body>'. |
478 | 667 |
|
668 |
backRef isNil ifTrue:[ |
|
669 |
backHRef := 'TOP.html' |
|
670 |
] ifFalse:[ |
|
671 |
backHRef := backRef |
|
672 |
]. |
|
673 |
backCmd notNil ifTrue:[ |
|
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
674 |
s nextPutAll:'<a NOPRINT HREF="' , backHRef , '" action="html:' , self name , ' ' , backCmd , '"> <IMG NOPRINT SRC="' , imagePath , '/DocsUpArrow.gif" ALT="[back]"></A>'. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
675 |
s nextPutLine:'<hr>'. |
478 | 676 |
] ifFalse:[ |
677 |
backHRef ~~ #none ifTrue:[ |
|
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
678 |
s nextPutAll:'<a NOPRINT HREF="' , backHRef , '"> <IMG NOPRINT SRC="' , imagePath , '/DocsUpArrow.gif" ALT="[back]"></A>';cr. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
679 |
s nextPutLine:'<hr>'. |
478 | 680 |
] |
681 |
]. |
|
682 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
683 |
s nextPutLine:'<h1>'. |
478 | 684 |
s nextPutAll:'Class: '; |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
685 |
nextPutAll:'<a INFO="open a browser on ' , shortName , '" type="example" action="SystemBrowser openInClass:' , className , '">'; |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
686 |
nextPutAll:(shortName); nextPutLine:'</a>'. |
499 | 687 |
|
688 |
owner notNil ifTrue:[ |
|
689 |
s nextPutAll:' (private in '; |
|
690 |
nextPutAll:'<a INFO="open a browser on ' , owner nameWithoutPrefix , '" type="example" action="SystemBrowser openInClass:' , owner name , '">'; |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
691 |
nextPutAll:(owner nameWithoutPrefix); nextPutLine:'</a>)'. |
523 | 692 |
] ifFalse:[ |
693 |
aClass nameSpace ~~ Smalltalk ifTrue:[ |
|
694 |
s nextPutAll:' (in ' , aClass nameSpace name , ')' |
|
695 |
] |
|
499 | 696 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
697 |
s nextPutLine:'</h1>'. |
478 | 698 |
|
499 | 699 |
owner notNil ifTrue:[ |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
700 |
s nextPutLine:'This class is only visible from within'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
701 |
s nextPutLine:owner nameWithoutPrefix. |
499 | 702 |
owner owningClass notNil ifTrue:[ |
703 |
s nextPutAll:'(which is itself a private class of '. |
|
704 |
s nextPutAll:owner owningClass nameWithoutPrefix. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
705 |
s nextPutLine:')' |
499 | 706 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
707 |
s nextPutLine:'.' |
499 | 708 |
]. |
709 |
||
478 | 710 |
"/ |
711 |
"/ index |
|
712 |
"/ |
|
713 |
"/ s nextPutAll:'Index:'; cr. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
714 |
s nextPutLine:'<ul>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
715 |
s 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
|
716 |
|
478 | 717 |
docu notNil ifTrue:[ |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
718 |
s nextPutLine:'<li><a href="#DESCRIPTION" name="I_DESCRIPTION">Description</a>'. |
478 | 719 |
]. |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
720 |
warnLines notNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
721 |
warnLines := warnLines asStringCollection. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
722 |
s nextPutLine:'<li><a href="#WARNING" name="I_WARNING">Warning</a>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
723 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
724 |
hintLines notNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
725 |
hintLines := hintLines asStringCollection. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
726 |
s nextPutLine:'<li><a href="#HINTS" name="I_HINTS">Hints</a>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
727 |
]. |
478 | 728 |
|
729 |
refLines notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
730 |
s nextPutLine:'<li><a href="#SEEALSO" name="I_SEEALSO">Related information</a>'. |
478 | 731 |
]. |
732 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
733 |
"/ 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
|
734 |
"/ s nextPutLine:'<li><a href="#CLASSVARIABLES" name="I_CLASSVARIABLES">Class variables</a>'. |
478 | 735 |
|
736 |
collectionOfClassCategories size > 0 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
737 |
s nextPutLine:'<li><a href="#CLASSPROTOCOL" name="I_CLASSPROTOCOL">Class protocol</a>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
738 |
s nextPutLine:'<ul>'. |
478 | 739 |
collectionOfClassCategories sort do:[:cat | |
523 | 740 |
s nextPutLine:'<li><a name="I_' , shortMetaName , '_category_' , cat , '"' , |
741 |
' href="#' , shortMetaName , '_category_' , cat , |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
742 |
'">' , cat , '</a> '. |
478 | 743 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
744 |
s nextPutLine:'</ul>'. |
478 | 745 |
]. |
746 |
collectionOfCategories size > 0 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
747 |
s nextPutLine:'<li><a href="#INSTANCEPROTOCOL" name="I_INSTANCEPROTOCOL">Instance protocol</a>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
748 |
s nextPutLine:'<ul>'. |
478 | 749 |
collectionOfCategories sort do:[:cat | |
523 | 750 |
s nextPutLine:'<li><a name="I_' , shortName , '_category_' , cat , '"' , |
751 |
' href="#' , shortName , '_category_' , cat , |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
752 |
'">' , cat , '</a> '. |
478 | 753 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
754 |
s nextPutLine:'</ul>'. |
478 | 755 |
]. |
756 |
||
499 | 757 |
privateClasses size > 0 ifTrue:[ |
758 |
privateClasses := privateClasses asOrderedCollection sort:[:a :b | a nameWithoutPrefix < b nameWithoutPrefix]. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
759 |
s nextPutLine:'<li><a href="#PRIVATECLASSES" name="I_PRIVATECLASSES">Private classes</a>'. |
499 | 760 |
]. |
761 |
||
478 | 762 |
(aClass == Object or:[aClass == Autoload]) ifTrue:[ |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
763 |
s nextPutLine:'<li><a href="#SUBCLASSES" name="I_SUBCLASSES">Subclasses</a>'. |
478 | 764 |
]. |
765 |
demoLines notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
766 |
s nextPutLine:'<li><a href="#DEMOSTARTUP" name="I_DEMOSTARTUP">Demonstration</a>'. |
478 | 767 |
]. |
768 |
examples notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
769 |
s nextPutLine:'<li><a href="#EXAMPLES" name="I_EXAMPLES">Examples</a>'. |
478 | 770 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
771 |
s nextPutLine:'</ul>'; nextPutLine:'<hr>'. |
478 | 772 |
|
773 |
||
774 |
"/ |
|
775 |
"/ hierarchy |
|
776 |
"/ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
777 |
s nextPutLine:'<h2><a name="INHERITANCE" href="#I_INHERITANCE">Inheritance:</A></h2>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
778 |
s nextPutLine:'<pre>'. |
478 | 779 |
indent := 3. |
780 |
first := true. |
|
781 |
supers := aClass allSuperclasses. |
|
805 | 782 |
(supers size > 0) ifTrue:[ |
637 | 783 |
supers reverseDo:[:cls | |
478 | 784 |
|nm| |
785 |
||
786 |
nm := cls name. |
|
787 |
first ifFalse:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
788 |
s spaces:indent; nextPutLine:'|'. |
478 | 789 |
s spaces:indent; nextPutAll:'+--'. |
790 |
indent := indent + 3. |
|
791 |
] ifTrue:[ |
|
792 |
s spaces:indent |
|
793 |
]. |
|
794 |
first := false. |
|
795 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
796 |
s nextPutLine:'<a INFO="show documentation of ' , nm , '" href="../misc/onlyInSTX2.html" action="html:' , self name , ' htmlDocOf:' , nm , '">' , nm , '</A>'. |
478 | 797 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
798 |
s spaces:indent; nextPutLine:'|'. |
478 | 799 |
s spaces:indent. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
800 |
s nextPutAll:'+--<B>'; nextPutAll:className; nextPutLine:'</B>'. |
478 | 801 |
indent := indent + 3. |
802 |
] ifFalse:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
803 |
s spaces:indent; nextPutLine:'nil'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
804 |
s spaces:indent; nextPutLine:'|'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
805 |
s spaces:indent; nextPutAll:'+--<B>'; nextPutAll:className; nextPutLine:'</B>'. |
478 | 806 |
aClass ~~ Object ifTrue:[ |
807 |
s cr. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
808 |
s nextPutLine:' <B>This class inherits NOTHING - most messages will lead into doesNotUnderstand:</B>' |
478 | 809 |
]. |
810 |
indent := indent + 3. |
|
811 |
]. |
|
812 |
||
813 |
subs notEmpty ifTrue:[ |
|
814 |
subs do:[:aSubclass | |
|
815 |
|nm| |
|
816 |
||
817 |
nm := aSubclass name. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
818 |
s spaces:indent; nextPutLine:'|'. |
478 | 819 |
s spaces:indent; nextPutAll:'+--'. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
820 |
s nextPutLine:'<a INFO="show documentation of ' , nm , '" href="../misc/onlyInSTX2.html" action="html:' , self name , ' htmlDocOf:' , nm , '">' , nm , '</A>'. |
478 | 821 |
] |
822 |
] ifFalse:[ |
|
823 |
aClass == Object ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
824 |
s spaces:indent; nextPutLine:'|'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
825 |
s spaces:indent; nextPutLine:'+-- ... almost every other class ...' |
478 | 826 |
] |
827 |
]. |
|
828 |
||
829 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
830 |
s nextPutLine:'</pre>'; nextPutLine:'<hr>'. |
478 | 831 |
|
832 |
"/ |
|
833 |
"/ category, version & package |
|
834 |
"/ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
835 |
s nextPutLine:'<dl>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
836 |
s nextPutLine:'<dt><a name="CATEGORY"><b>Category:</b></A>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
837 |
s nextPutLine:'<dd><b>', aClass category , '</b>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
838 |
s nextPutLine:'</dl>'. |
478 | 839 |
|
499 | 840 |
owner notNil ifTrue:[ |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
841 |
s nextPutLine:'<dl>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
842 |
s nextPutLine:'<dt><a name="OWNER"><b>Owner:</b></A>'. |
499 | 843 |
s nextPutAll:'<dd><b>'; |
844 |
nextPutAll:'<a INFO="show documentation of ' , owner nameWithoutPrefix , '" href="../misc/onlyInSTX2.html" action="html:' , self name , ' htmlDocOf:' , owner name , '">' , owner nameWithoutPrefix , '</A>'; |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
845 |
nextPutLine:'</b>'. |
499 | 846 |
] ifFalse:[ |
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
847 |
self htmlRevisionDocOf:aClass to:s. |
478 | 848 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
849 |
s nextPutLine:'</dl>'. |
478 | 850 |
|
851 |
authorLines notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
852 |
s nextPutLine:'<dl><dt><a name="AUTHOR"><b>Author:</b></A>'. |
478 | 853 |
authorLines do:[:l| |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
854 |
s nextPutLine:'<dd><b>', l , '</b>'. |
478 | 855 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
856 |
s nextPutLine:'</dl>'. |
478 | 857 |
]. |
858 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
859 |
s nextPutLine:'<hr>'. |
478 | 860 |
|
861 |
docu notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
862 |
s nextPutLine:'<h2><a name="DESCRIPTION" href="#I_DESCRIPTION">Description:</A></h2>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
863 |
s nextPutLine:'<BR>'. |
478 | 864 |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
865 |
s nextPutLine:'<pre>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
866 |
s nextPutLine:docu. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
867 |
s nextPutLine:'</pre>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
868 |
s nextPutLine:'<hr>'. |
478 | 869 |
]. |
870 |
||
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
871 |
warnLines notNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
872 |
s nextPutLine:'<h2><a name="WARNING" href="#I_WARNING">Warning:</A></h2>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
873 |
s nextPutLine:'<BR>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
874 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
875 |
s nextPutLine:'<pre>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
876 |
firstIndent := warnLines first leftIndent. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
877 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
878 |
warnLines do:[:aLine | |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
879 |
aLine leftIndent >= firstIndent ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
880 |
s nextPutLine:(aLine copyFrom:firstIndent+1) |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
881 |
] ifFalse:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
882 |
s nextPutLine:aLine |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
883 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
884 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
885 |
s nextPutLine:'</pre>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
886 |
s nextPutLine:'<hr>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
887 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
888 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
889 |
hintLines notNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
890 |
s nextPutLine:'<h2><a name="HINTS" href="#I_HINTS">Hints:</A></h2>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
891 |
s nextPutLine:'<BR>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
892 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
893 |
s nextPutLine:'<pre>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
894 |
firstIndent := hintLines first leftIndent. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
895 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
896 |
hintLines do:[:aLine | |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
897 |
aLine leftIndent >= firstIndent ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
898 |
s nextPutLine:(aLine copyFrom:firstIndent+1) |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
899 |
] ifFalse:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
900 |
s nextPutLine:aLine |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
901 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
902 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
903 |
s nextPutLine:'</pre>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
904 |
s nextPutLine:'<hr>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
905 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
906 |
|
478 | 907 |
"/ |
908 |
"/ see also |
|
909 |
"/ |
|
910 |
refLines notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
911 |
s nextPutLine:'<h2><a name="SEEALSO" href="#I_SEEALSO">Related information:</A></h2>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
912 |
s nextPutLine:'<pre>'. |
478 | 913 |
refLines do:[:l | |
914 |
|nm href| |
|
915 |
||
916 |
s nextPutAll:' '. |
|
917 |
||
918 |
l isString ifTrue:[ |
|
919 |
nm := (l copyFrom:2 to:(l indexOf:$:)-1) withoutSpaces. |
|
920 |
href := (l copyFrom:(l indexOf:$:)+1 to:(l size - 1)) withoutSpaces. |
|
921 |
(href startsWith:'man:') ifTrue:[ |
|
922 |
href := (href copyFrom:5) withoutSpaces. |
|
500 | 923 |
s nextPutAll:'<a INFO="show man page" href="../misc/onlyInSTX2.html" action="html:' , self name , ' manPageFor:''' , href , '''">[<I>' , nm , '</I>]</A>'. |
478 | 924 |
] ifFalse:[ |
925 |
(href startsWith:'html:') ifTrue:[ |
|
926 |
href := (href copyFrom:6) withoutSpaces. |
|
927 |
]. |
|
928 |
s nextPutAll:'<a href="../' , href , '">[<I>' , nm , '</I>]</a>'. |
|
929 |
] |
|
930 |
] ifFalse:[ |
|
931 |
l do:[:ref | |
|
523 | 932 |
|realRef ns| |
933 |
||
542 | 934 |
(ref includesMatchCharacters) ifTrue:[ |
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
935 |
s nextPutAll:'<a INFO="show documentation of ' , ref , '" href="../misc/onlyInSTX2.html" action="html:' , self name , ' htmlClassesMatching:''' , ref , ''' backTo:nil">' , ref , '</A>'. |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
936 |
] ifFalse:[ |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
937 |
realRef := ref. |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
938 |
(ns := aClass nameSpace) notNil ifTrue:[ |
917
c77bb2d56e05
#isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
939 |
ns isNameSpace ifTrue:[ |
649 | 940 |
(ns at:realRef asSymbol) notNil ifTrue:[ |
941 |
realRef := ns name , '::' , realRef |
|
942 |
] |
|
943 |
] ifFalse:[ |
|
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
944 |
] |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
945 |
]. |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
946 |
s nextPutAll:'<a INFO="show documentation of ' , realRef , '" href="../misc/onlyInSTX2.html" action="html:' , self name , ' htmlDocOf:' , realRef , '">' , ref , '</A>'. |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
947 |
s nextPutAll:' '. |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
948 |
] |
478 | 949 |
]. |
950 |
]. |
|
951 |
s cr. |
|
952 |
]. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
953 |
s nextPutLine:'</pre>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
954 |
s nextPutLine:'<hr>'. |
478 | 955 |
]. |
956 |
||
957 |
||
958 |
"/ |
|
959 |
"/ inst & classVars |
|
960 |
"/ to be added |
|
961 |
||
962 |
||
963 |
"/ |
|
964 |
"/ protocol |
|
965 |
"/ |
|
966 |
self printOutHTMLProtocolOf:aClass on:s. |
|
967 |
||
968 |
"/ |
|
969 |
"/ subclasses (only for Object and Autoload) |
|
970 |
"/ |
|
971 |
(aClass == Object or:[aClass == Autoload]) ifTrue:[ |
|
972 |
subs := aClass subclasses |
|
973 |
asOrderedCollection sort:[:a :b | a name < b name]. |
|
974 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
975 |
s nextPutLine:'<h2><a name="SUBCLASSES" href="#I_SUBCLASSES">Subclasses (direct subclasses only):</A></h2>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
976 |
s nextPutLine:'<pre>'. |
478 | 977 |
subs do:[:cls | |
978 |
|nm| |
|
979 |
||
980 |
nm := cls name. |
|
981 |
s nextPutAll:' '. |
|
982 |
cls isLoaded ifFalse:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
983 |
s nextPutLine:'<a INFO="show documentation of ' , nm , '" href="../misc/onlyInSTX2.html" action="html:' , nm , ' autoload. ',self name,' htmlDocOf:' , nm, '">' , nm , '</A>' |
478 | 984 |
] ifTrue:[ |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
985 |
s nextPutLine:'<a INFO="show documentation of ' , nm , '" href="../misc/onlyInSTX2.html" action="html:',self name,' htmlDocOf:' , nm , '">' , nm , '</A>' |
478 | 986 |
]. |
987 |
]. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
988 |
s nextPutLine:'</pre>'; nextPutLine:'<hr>'. |
478 | 989 |
]. |
990 |
||
991 |
"/ |
|
499 | 992 |
"/ private classes |
993 |
"/ |
|
994 |
privateClasses size > 0 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
995 |
s nextPutLine:'<h2><a name="PRIVATECLASSES" href="#I_PRIVATECLASSES">Private classes:</A></h2>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
996 |
s nextPutLine:'<pre>'. |
499 | 997 |
privateClasses do:[:cls | |
523 | 998 |
|nm fullName| |
499 | 999 |
|
1000 |
nm := cls nameWithoutPrefix. |
|
523 | 1001 |
fullName := cls owningClass name , '::' , nm. |
499 | 1002 |
s nextPutAll:' '. |
523 | 1003 |
s nextPutLine:'<a INFO="show documentation of ' , fullName , '" href="../misc/onlyInSTX2.html" action="html:',self name,' htmlDocOf:' , fullName , '">' , nm , '</A>' |
499 | 1004 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1005 |
s nextPutLine:'</pre>'; nextPutLine:'<hr>'. |
499 | 1006 |
]. |
1007 |
||
1008 |
"/ |
|
478 | 1009 |
"/ demonstration |
1010 |
"/ |
|
1011 |
demoLines notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1012 |
s nextPutLine:'<h2><a name="DEMOSTARTUP" href="#I_DEMOSTARTUP">Demonstration:</A></h2>'. |
478 | 1013 |
demoLines do:[:l | |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1014 |
s nextPutLine:'<a INFO="demonstration" type="example">'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1015 |
s nextPutLine:'<code><pre>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1016 |
s nextPutLine:' ' , l withoutSeparators. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1017 |
s nextPutLine:'</pre></code>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1018 |
s nextPutLine:'</a>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1019 |
s nextPutLine:'<br>'. |
478 | 1020 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1021 |
s nextPutLine:'<hr>'. |
478 | 1022 |
]. |
1023 |
||
1024 |
"/ |
|
1025 |
"/ add examples if there are any |
|
1026 |
"/ |
|
1027 |
examples notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1028 |
s nextPutLine:'<h2><a name="EXAMPLES" href="#I_EXAMPLES">Examples:</A></h2>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1029 |
s nextPutLine:'<BR>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1030 |
s nextPutLine:'<code><pre>'. |
478 | 1031 |
examples do:[:line | |
1032 |
line withoutSeparators = '[exBegin]' ifTrue:[ |
|
599 | 1033 |
s nextPutLine:'<a INFO="execute the example" type="example" showresult>'. |
478 | 1034 |
] ifFalse:[ |
1035 |
line withoutSeparators = '[exEnd]' ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1036 |
s nextPutLine:'</a>'. |
478 | 1037 |
] ifFalse:[ |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1038 |
s nextPutLine:line |
478 | 1039 |
] |
1040 |
]. |
|
1041 |
]. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1042 |
s nextPutLine:'</pre></code>'; nextPutLine:'<hr>'. |
478 | 1043 |
]. |
1044 |
||
1045 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1046 |
s nextPutLine:'</body>'; nextPutLine:'</html>'. |
478 | 1047 |
|
1048 |
wasLoaded ifFalse:[ |
|
1049 |
aClass unload |
|
1050 |
]. |
|
1051 |
||
1052 |
^ s contents |
|
1053 |
||
1054 |
" |
|
1055 |
self htmlDocOf:Object |
|
1056 |
self htmlDocOf:Array |
|
1057 |
self htmlDocOf:Filename |
|
1058 |
self htmlDocOf:Block |
|
1059 |
" |
|
1060 |
||
632 | 1061 |
"Created: / 24.4.1996 / 15:01:59 / cg" |
732 | 1062 |
"Modified: / 25.11.1998 / 12:40:51 / cg" |
478 | 1063 |
! |
1064 |
||
1065 |
htmlDocOf:aClass backRef:backRef |
|
632 | 1066 |
"generate an HTML document string which contains a classes documentation" |
1067 |
||
478 | 1068 |
^ self htmlDocOf:aClass back:nil backRef:backRef |
1069 |
||
632 | 1070 |
"Created: / 24.4.1996 / 15:03:25 / cg" |
1071 |
"Modified: / 30.10.1997 / 13:23:12 / cg" |
|
478 | 1072 |
! |
1073 |
||
1074 |
htmlDocOfImplementorsOf:selector |
|
632 | 1075 |
"generate an HTML document string which contains HREFS |
1076 |
to all implementors of a particular selector" |
|
1077 |
||
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1078 |
|sel s classes| |
478 | 1079 |
|
1080 |
sel := (selector copy |
|
1081 |
replChar:$< withString:'<') |
|
1082 |
replChar:$> withString:'>'. |
|
1083 |
||
1084 |
s := '' writeStream. |
|
1085 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1086 |
s nextPutLine:'<html><head><title>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1087 |
s nextPutLine:sel. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1088 |
s nextPutLine:'</title></head>'. |
478 | 1089 |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1090 |
s nextPutLine:'<body>'. |
632 | 1091 |
s nextPutLine:'<a NOPRINT HREF="TOP.html"> <IMG SRC="../icons/DocsUpArrow.gif" ALT="[back]"></A>'. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1092 |
s nextPutLine:'<hr>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1093 |
s nextPutAll:'<h1>'; nextPutAll:sel; nextPutAll:'</h1>'. |
478 | 1094 |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1095 |
s nextPutLine:'<dl>'. |
478 | 1096 |
|
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1097 |
classes := IdentitySet new. |
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1098 |
|
478 | 1099 |
sel := selector asSymbol. |
1100 |
Smalltalk allClassesDo:[:cls | |
|
499 | 1101 |
cls isPrivate ifFalse:[ |
1138
aa7687ec256f
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1102 |
(cls includesSelector:sel) ifTrue:[ |
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1103 |
classes add:cls |
499 | 1104 |
] |
478 | 1105 |
] |
1106 |
]. |
|
1107 |
||
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1108 |
(classes asOrderedCollection sort:[:a :b | a name < b name]) do:[:cls | |
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1109 |
self printOutHTMLMethodProtocol:(cls compiledMethodAt:sel) |
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1110 |
on:s showClassName:true classRef:true. |
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1111 |
s nextPutLine:'<p>'. |
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1112 |
]. |
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1113 |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1114 |
s nextPutLine:'</dl>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1115 |
s nextPutLine:'</body></html>'. |
478 | 1116 |
|
1117 |
^ s contents |
|
1118 |
||
632 | 1119 |
"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
|
1120 |
"Modified: / 30.10.1998 / 22:15:30 / cg" |
478 | 1121 |
! |
1122 |
||
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1123 |
htmlRevisionDocOf:aClass to:s |
632 | 1124 |
"extract a classes versionInfo and return an HTML document string |
1125 |
for that." |
|
1126 |
||
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1127 |
|revInfo pckgInfo text path| |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1128 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1129 |
revInfo := aClass revisionInfo. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1130 |
pckgInfo := aClass packageSourceCodeInfo. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1131 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1132 |
s nextPutLine:'<dl><dt><a name="VERSION"><b>Version:</b></A>'. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1133 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1134 |
(revInfo isNil and:[pckgInfo isNil]) ifTrue:[ |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1135 |
s nextPutLine:'<dd>no revision info'. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1136 |
] ifFalse:[ |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1137 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1138 |
revInfo isNil ifTrue:[revInfo := IdentityDictionary new]. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1139 |
pckgInfo isNil ifTrue:[pckgInfo := IdentityDictionary new]. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1140 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1141 |
s nextPutLine:'<dd>rev: <b>'. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1142 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1143 |
"/ fetch the revision-info; prefer revisionInfo |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1144 |
text := revInfo at:#revision ifAbsent:(pckgInfo at:#revision ifAbsent:'?'). |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1145 |
s nextPutLine:text. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1146 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1147 |
"/ fetch the date & time; prefer revisionInfo |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1148 |
text := revInfo at:#date ifAbsent:(pckgInfo at:#date ifAbsent:'?'). |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1149 |
s nextPutAll:'</b> date: <b>' , text. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1150 |
text := revInfo at:#time ifAbsent:(pckgInfo at:#time ifAbsent:'?'). |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1151 |
s nextPutLine:' ', text , '</b>'. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1152 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1153 |
text := revInfo at:#user ifAbsent:(pckgInfo at:#user ifAbsent:'?'). |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1154 |
s nextPutLine:'<dd>user: <b>' , text , '</b>'. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1155 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1156 |
text := revInfo at:#fileName ifAbsent:(pckgInfo at:#fileNamer ifAbsent:'?'). |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1157 |
s nextPutAll:'<dd>file: <b>' , text. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1158 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1159 |
text := revInfo at:#directory ifAbsent:(pckgInfo at:#directory ifAbsent:nil). |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1160 |
text isNil ifTrue:[ |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1161 |
path := revInfo at:#repositoryPathName ifAbsent:(pckgInfo at:#repositoryPathName ifAbsent:nil). |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1162 |
path notNil ifTrue:[ |
548
f5b7b050ce01
dont ask SourceCodeManager, if there is none
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
1163 |
SourceCodeManager notNil ifTrue:[ |
f5b7b050ce01
dont ask SourceCodeManager, if there is none
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
1164 |
text := SourceCodeManager directoryFromContainerPath:path. |
f5b7b050ce01
dont ask SourceCodeManager, if there is none
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
1165 |
]. |
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1166 |
text isNil ifTrue:[text := '?']. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1167 |
] ifFalse:[ |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1168 |
text := '?' |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1169 |
] |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1170 |
]. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1171 |
s nextPutLine:'</b> directory: <b>' , text , '</b>'. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1172 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1173 |
text := revInfo at:#module ifAbsent:(pckgInfo at:#module ifAbsent:nil). |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1174 |
text isNil ifTrue:[ |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1175 |
path := revInfo at:#repositoryPathName ifAbsent:(pckgInfo at:#repositoryPathName ifAbsent:nil). |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1176 |
path notNil ifTrue:[ |
548
f5b7b050ce01
dont ask SourceCodeManager, if there is none
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
1177 |
SourceCodeManager notNil ifTrue:[ |
f5b7b050ce01
dont ask SourceCodeManager, if there is none
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
1178 |
text := SourceCodeManager moduleFromContainerPath:path. |
f5b7b050ce01
dont ask SourceCodeManager, if there is none
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
1179 |
]. |
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1180 |
text isNil ifTrue:[text := '?']. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1181 |
] ifFalse:[ |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1182 |
text := '?' |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1183 |
] |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1184 |
]. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1185 |
s nextPutAll:'<dd>module: <b>' , text. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1186 |
|
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1187 |
text := revInfo at:#library ifAbsent:(pckgInfo at:#library ifAbsent:'*none*'). |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1188 |
s nextPutLine:'</b> stc-classLibrary: <b>' , text , '</b>'. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1189 |
]. |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1190 |
|
632 | 1191 |
"Created: / 8.1.1997 / 13:43:28 / cg" |
1192 |
"Modified: / 30.10.1997 / 13:24:39 / cg" |
|
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1193 |
! |
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1194 |
|
478 | 1195 |
htmlSelectorList |
632 | 1196 |
"generate an HTML string for all selectors (for which methods exist) |
1197 |
in the system" |
|
1198 |
||
478 | 1199 |
|selectors| |
1200 |
||
1201 |
selectors := IdentitySet new. |
|
1202 |
Smalltalk allClassesDo:[:cls | |
|
1203 |
selectors addAll:cls methodDictionary keys. |
|
1204 |
]. |
|
1205 |
selectors := selectors asOrderedCollection sort. |
|
1206 |
||
1207 |
^ self htmlSelectors:selectors title:('All selectors:'). |
|
1208 |
||
1209 |
" |
|
1210 |
self htmlSelectorList |
|
1211 |
" |
|
1212 |
||
632 | 1213 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
1214 |
"Modified: / 5.6.1996 / 12:27:09 / stefan" |
|
1215 |
"Modified: / 30.10.1997 / 13:25:19 / cg" |
|
478 | 1216 |
! |
1217 |
||
1218 |
htmlSelectorListMatching:pattern |
|
632 | 1219 |
"generate an HTML string for all selectors which match a pattern |
1220 |
(and for which methods exist) in the system" |
|
1221 |
||
478 | 1222 |
|selectors| |
1223 |
||
1224 |
selectors := IdentitySet new. |
|
1225 |
Smalltalk allClassesDo:[:cls | |
|
1226 |
cls methodDictionary keysDo:[:sel | |
|
1227 |
(pattern match:sel) ifTrue:[ |
|
1228 |
selectors add:sel. |
|
1229 |
] |
|
1230 |
] |
|
1231 |
]. |
|
1232 |
selectors := selectors asOrderedCollection sort. |
|
1233 |
||
1234 |
^ self htmlSelectors:selectors title:('Selectors matching ''' , pattern , ''':'). |
|
1235 |
||
1236 |
" |
|
1237 |
self htmlSelectorListMatching:'*do*' |
|
1238 |
" |
|
1239 |
||
632 | 1240 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
1241 |
"Modified: / 5.6.1996 / 12:29:27 / stefan" |
|
1242 |
"Modified: / 30.10.1997 / 13:25:50 / cg" |
|
478 | 1243 |
! |
1244 |
||
1245 |
htmlSelectorListPrefix:prefix |
|
632 | 1246 |
"generate an HTML string for all selectors whose names starts with |
1247 |
a prefix (and for which methods exist) in the system" |
|
1248 |
||
478 | 1249 |
|selectors| |
1250 |
||
1251 |
selectors := IdentitySet new. |
|
1252 |
Smalltalk allClassesDo:[:cls | |
|
1253 |
cls methodDictionary keysDo:[:sel | |
|
1254 |
(sel startsWith:prefix) ifTrue:[ |
|
1255 |
selectors add:sel. |
|
1256 |
] |
|
1257 |
] |
|
1258 |
]. |
|
1259 |
selectors := selectors asOrderedCollection sort. |
|
1260 |
||
1261 |
^ self htmlSelectors:selectors title:('Selectors starting with ''' , prefix asString , ''':'). |
|
1262 |
||
1263 |
" |
|
1264 |
self htmlSelectorListPrefix:'a' |
|
1265 |
" |
|
1266 |
||
632 | 1267 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
1268 |
"Modified: / 5.6.1996 / 12:31:13 / stefan" |
|
1269 |
"Modified: / 30.10.1997 / 13:26:15 / cg" |
|
478 | 1270 |
! |
1271 |
||
1272 |
htmlSelectors:selectors title:title |
|
632 | 1273 |
"generate an HTML string for a given list of selectors" |
1274 |
||
492 | 1275 |
|s| |
478 | 1276 |
|
1277 |
s := '' writeStream. |
|
1278 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1279 |
s nextPutLine:'<html><head><title>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1280 |
s nextPutLine:title. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1281 |
s nextPutLine:'</title></head>'. |
478 | 1282 |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1283 |
s nextPutLine:'<body>'. |
632 | 1284 |
s nextPutLine:'<a NOPRINT HREF="TOP.html"> <IMG SRC="../icons/DocsUpArrow.gif" ALT="[back]"></A>'. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1285 |
s nextPutLine:'<hr>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1286 |
s nextPutAll:'<h1>'; nextPutAll:title; nextPutAll:'</h1>'. |
478 | 1287 |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1288 |
s nextPutLine:'<ul>'. |
478 | 1289 |
|
1290 |
selectors do:[:sel | |
|
1291 |
|nm| |
|
1292 |
||
1293 |
nm := (sel copy replChar:$< withString:'<') |
|
1294 |
replChar:$> withString:'>'. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1295 |
s nextPutLine:'<li><a href="../misc/onlyInSTX2.html" action="html:',self name,' htmlDocOfImplementorsOf:''' , nm , '''">' , nm , '</A>' |
478 | 1296 |
]. |
1297 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1298 |
s nextPutLine:'</ul>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1299 |
s nextPutLine:'</body></html>'. |
478 | 1300 |
|
1301 |
^ s contents |
|
1302 |
||
632 | 1303 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
1304 |
"Modified: / 30.10.1997 / 13:26:34 / cg" |
|
478 | 1305 |
! |
1306 |
||
1307 |
printOutHTMLCategoryProtocol:aCategory of:aClass on:aStream |
|
632 | 1308 |
"append documentation on each method in a particular methodCategory |
1309 |
of the given class in HTML onto aStream." |
|
1310 |
||
523 | 1311 |
|any dict selectors methods shortName| |
1312 |
||
1313 |
shortName := aClass nameWithoutPrefix. |
|
478 | 1314 |
|
1315 |
dict := aClass methodDictionary. |
|
1316 |
||
1317 |
dict notNil ifTrue:[ |
|
1318 |
any := false. |
|
1319 |
dict do:[:aMethod | |
|
1320 |
(aCategory = aMethod category) ifTrue:[ |
|
1321 |
any := true |
|
1322 |
] |
|
1323 |
]. |
|
1324 |
||
1325 |
any ifTrue:[ |
|
523 | 1326 |
aStream nextPutLine:'<a name="' , shortName , '_category_' , aCategory , |
1327 |
'" href="#I_' , shortName , '_category_' , aCategory , |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1328 |
'"><b>' , aCategory , '</b></A>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1329 |
aStream nextPutLine:'<dl>'. |
478 | 1330 |
|
1331 |
selectors := dict keys asArray. |
|
1332 |
methods := dict values. |
|
1333 |
selectors sortWith:methods. |
|
1334 |
methods do:[:aMethod | |
|
1335 |
(aCategory = aMethod category) ifTrue:[ |
|
1336 |
ErrorSignal catch:[ |
|
1337 |
self printOutHTMLMethodProtocol:aMethod on:aStream. |
|
1338 |
]. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1339 |
aStream nextPutLine:'<p>'. |
478 | 1340 |
] |
1341 |
]. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1342 |
aStream nextPutLine:'</dl>'. |
478 | 1343 |
] |
1344 |
] |
|
1345 |
||
1346 |
" |
|
1347 |
self printOutHTMLProtocolOf:Float on:Stdout |
|
1348 |
" |
|
1349 |
||
632 | 1350 |
"Created: / 22.4.1996 / 20:03:30 / cg" |
1351 |
"Modified: / 5.6.1996 / 13:41:27 / stefan" |
|
1352 |
"Modified: / 30.10.1997 / 13:27:58 / cg" |
|
478 | 1353 |
! |
1354 |
||
1355 |
printOutHTMLMethodProtocol:aMethod on:aStream |
|
1356 |
"given the source in aString, print the methods message specification |
|
1357 |
and any method comments - without source; used to generate documentation |
|
1358 |
pages" |
|
1359 |
||
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1360 |
^ self |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1361 |
printOutHTMLMethodProtocol:aMethod |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1362 |
on:aStream |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1363 |
showClassName:false |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1364 |
classRef:false |
478 | 1365 |
|
1366 |
"Modified: 22.4.1996 / 18:01:56 / cg" |
|
1367 |
"Created: 22.4.1996 / 20:03:30 / cg" |
|
1368 |
! |
|
1369 |
||
1370 |
printOutHTMLMethodProtocol:aMethod on:aStream showClassName:showClassName classRef:withClassRef |
|
1371 |
"given the source in aString, print the methods message specification |
|
1372 |
and any method comments - without source; used to generate documentation |
|
1373 |
pages" |
|
1374 |
||
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1375 |
^ self |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1376 |
printOutHTMLMethodProtocol:aMethod |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1377 |
on:aStream |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1378 |
showClassName:showClassName |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1379 |
classRef:withClassRef |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1380 |
picturePath:'pictures' |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1381 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1382 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1383 |
! |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1384 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1385 |
printOutHTMLMethodProtocol:aMethod on:aStream showClassName:showClassName classRef:withClassRef picturePath:picturePath |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1386 |
"given the source in aString, print the methods message specification |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1387 |
and any method comments - without source; used to generate documentation |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1388 |
pages" |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1389 |
|
492 | 1390 |
|comment cls sel partStream args argStream who methodSpecLine first |
478 | 1391 |
firstIndent firstNonEmpty isSubres isObsolete smallOrEmpty |
1392 |
ballColor| |
|
1393 |
||
1394 |
who := aMethod who. |
|
505
d8d7556d05ee
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1395 |
cls := who methodClass. |
d8d7556d05ee
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1396 |
sel := who methodSelector. |
478 | 1397 |
partStream := sel keywords readStream. |
1398 |
||
1399 |
(args := aMethod methodArgNames) notNil ifTrue:[ |
|
1400 |
argStream := aMethod methodArgNames readStream. |
|
1401 |
||
1402 |
methodSpecLine := ''. first := true. |
|
1403 |
1 to:sel numArgs do:[:index | |
|
1404 |
first ifTrue:[ |
|
1405 |
first := false. |
|
1406 |
] ifFalse:[ |
|
1407 |
methodSpecLine := methodSpecLine , ' ' |
|
1408 |
]. |
|
1409 |
methodSpecLine := methodSpecLine , '<B>' , partStream next , '</B>'. |
|
1410 |
methodSpecLine := methodSpecLine , ' <I>' , argStream next , '</I>'. |
|
1411 |
]. |
|
1412 |
] ifFalse:[ |
|
1413 |
methodSpecLine := '<B>' , partStream next , '</B>' |
|
1414 |
]. |
|
1415 |
||
632 | 1416 |
"/ use string-asSymbol (instead of the obvious symbol itself) |
1417 |
"/ in the checks below, to avoid tricking myself, |
|
1418 |
"/ when the documentation on this method is generated |
|
1419 |
"/ (otherwise, I'll say that this method is both |
|
1420 |
"/ a subres and and obsolete method ...) |
|
1421 |
||
1422 |
isSubres := (aMethod sends:'subclassResponsibility' asSymbol). |
|
478 | 1423 |
|
1424 |
isObsolete := false. |
|
632 | 1425 |
((aMethod sends:'obsoleteMethodWarning' asSymbol) |
1426 |
or:[(aMethod sends:'obsoleteMethodWarning:' asSymbol) |
|
1427 |
or:[(aMethod sends:'obsoleteMethodWarning:from:' asSymbol)]]) ifTrue:[ |
|
478 | 1428 |
cls ~~ Object ifTrue:[ |
1429 |
isObsolete := true |
|
1430 |
] |
|
1431 |
]. |
|
1432 |
||
1433 |
smallOrEmpty := ''. |
|
1434 |
aMethod isPrivate ifTrue:[ |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1435 |
methodSpecLine := '<i>private</i> ' , methodSpecLine. |
478 | 1436 |
"/ smallOrEmpty := '-small'. |
1437 |
] ifFalse:[ |
|
1438 |
aMethod isProtected ifTrue:[ |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1439 |
methodSpecLine := '<i>protected</i> ' , methodSpecLine. |
478 | 1440 |
"/ smallOrEmpty := '-small'. |
1441 |
] ifFalse:[ |
|
1442 |
aMethod isIgnored ifTrue:[ |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1443 |
methodSpecLine := '[ ' , methodSpecLine , ' ] (<i>invisible</i>)'. |
478 | 1444 |
"/ smallOrEmpty := '-small'. |
1445 |
] |
|
1446 |
] |
|
1447 |
]. |
|
1448 |
||
632 | 1449 |
aStream nextPutLine:'<DT>'. |
478 | 1450 |
|
1451 |
||
1452 |
cls isMeta ifTrue:[ |
|
1453 |
ballColor := 'yellow' |
|
1454 |
] ifFalse:[ |
|
1455 |
ballColor := 'red' |
|
1456 |
]. |
|
1457 |
||
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1458 |
aStream nextPutLine:'<IMG src="' , picturePath , '/' , ballColor , '-ball' , smallOrEmpty , '.gif" alt="o " width=6 height=6>'. |
478 | 1459 |
|
1460 |
sel := (sel copy |
|
1461 |
replChar:$< withString:'<') |
|
1462 |
replChar:$> withString:'>'. |
|
1463 |
||
1464 |
withClassRef ifTrue:[ |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1465 |
aStream nextPutLine:'<a name="' , cls name , '_' , sel , |
478 | 1466 |
'" href="../misc/onlyInSTX2.html" action="html:',self name,' htmlDocOf:' , cls name , |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1467 |
'">' , cls name , '</a> ' , methodSpecLine. |
478 | 1468 |
] ifFalse:[ |
1469 |
showClassName ifTrue:[ |
|
1470 |
methodSpecLine := cls name , ' ' , methodSpecLine |
|
1471 |
]. |
|
1472 |
||
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1473 |
aStream nextPutLine:'<a name="' , cls name , '_' , sel , '" ' , |
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1474 |
"/ 'href="' , cls name , '_' , sel , '"' , |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1475 |
'>' , methodSpecLine , '</a>'. |
478 | 1476 |
]. |
632 | 1477 |
aStream nextPutLine:'<DD>'. |
478 | 1478 |
|
1479 |
(comment := aMethod comment) notNil ifTrue:[ |
|
1480 |
comment := (comment copy |
|
1481 |
replChar:$< withString:'<') |
|
1482 |
replChar:$> withString:'>'. |
|
1483 |
||
1484 |
comment notEmpty ifTrue:[ |
|
1485 |
comment := comment asStringCollection. |
|
1486 |
firstIndent := comment first leftIndent. |
|
1487 |
firstIndent > 0 ifTrue:[ |
|
1488 |
comment := comment collect:[:line | |
|
1489 |
line leftIndent >= firstIndent ifTrue:[ |
|
1490 |
line copyFrom:firstIndent. |
|
1491 |
] ifFalse:[ |
|
1492 |
line |
|
1493 |
] |
|
1494 |
]. |
|
1495 |
]. |
|
1496 |
firstNonEmpty := comment findFirst:[:line | line notEmpty]. |
|
1497 |
firstNonEmpty > 1 ifTrue:[ |
|
1498 |
comment := comment copyFrom:firstNonEmpty |
|
1499 |
]. |
|
1500 |
comment := comment asString. |
|
1501 |
]. |
|
1502 |
||
1503 |
comment asStringCollection do:[:line | |
|
1178 | 1504 |
aStream |
1505 |
"/ nextPutAll:'<I>'; |
|
1506 |
nextPutAll:line; |
|
1507 |
"/ nextPutAll:'</I>'; |
|
1508 |
nextPutLine:'<BR>'. |
|
478 | 1509 |
]. |
1510 |
]. |
|
1511 |
||
1512 |
isSubres ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1513 |
aStream nextPutLine:'<BR>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1514 |
aStream nextPutLine:'<I>** This method raises an error - it must be redefined in concrete classes **</I>'. |
478 | 1515 |
]. |
1516 |
isObsolete ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1517 |
aStream nextPutLine:'<BR>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1518 |
aStream nextPutLine:'<I>** This is an obsolete interface - do not use it (it may vanish in future versions) **</I>'. |
478 | 1519 |
]. |
1520 |
||
632 | 1521 |
"Created: / 22.4.1996 / 20:03:30 / cg" |
1522 |
"Modified: / 30.10.1997 / 13:09:45 / cg" |
|
478 | 1523 |
! |
1524 |
||
1525 |
printOutHTMLProtocolOf:aClass on:aStream |
|
632 | 1526 |
"append documentation of the given class in HTML onto aStream." |
1527 |
||
478 | 1528 |
|collectionOfCategories any| |
1529 |
||
1530 |
"/ self printOutDefinitionOn:aPrintStream. |
|
1531 |
||
732 | 1532 |
collectionOfCategories := aClass class categories asSortedCollection. |
478 | 1533 |
any := false. |
523 | 1534 |
|
1535 |
collectionOfCategories size > 0 ifTrue:[ |
|
1536 |
collectionOfCategories := collectionOfCategories asOrderedCollection. |
|
1537 |
collectionOfCategories remove:'documentation' ifAbsent:[]. |
|
1538 |
collectionOfCategories size > 0 ifTrue:[ |
|
1539 |
collectionOfCategories sort. |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1540 |
aStream nextPutLine:'<h2><a name="CLASSPROTOCOL" href="#I_CLASSPROTOCOL">Class protocol:</a></h2>'. |
523 | 1541 |
collectionOfCategories do:[:aCategory | |
478 | 1542 |
self printOutHTMLCategoryProtocol:aCategory of:aClass class on:aStream. |
1543 |
any := true. |
|
523 | 1544 |
]. |
478 | 1545 |
"/ any ifFalse:[ |
1546 |
"/ aStream nextPutAll:'no new protocol' |
|
1547 |
"/ ]. |
|
523 | 1548 |
aStream nextPutLine:'<hr>'. |
1549 |
] |
|
478 | 1550 |
]. |
1551 |
||
1552 |
||
732 | 1553 |
collectionOfCategories := aClass categories asSortedCollection. |
478 | 1554 |
any := false. |
523 | 1555 |
collectionOfCategories size > 0 ifTrue:[ |
478 | 1556 |
collectionOfCategories := collectionOfCategories asOrderedCollection sort. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1557 |
aStream nextPutLine:'<h2><a name="INSTANCEPROTOCOL" href="#I_INSTANCEPROTOCOL">Instance protocol:</A></h2>'. |
478 | 1558 |
collectionOfCategories do:[:aCategory | |
1559 |
self printOutHTMLCategoryProtocol:aCategory of:aClass on:aStream |
|
1560 |
]. |
|
1561 |
"/ any ifFalse:[ |
|
1562 |
"/ aStream nextPutAll:'no new protocol' |
|
1563 |
"/ ]. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1564 |
aStream nextPutLine:'<hr>'. |
478 | 1565 |
] |
1566 |
||
1567 |
" |
|
1568 |
self printOutHTMLProtocolOf:Float on:Stdout |
|
1569 |
" |
|
1570 |
||
632 | 1571 |
"Created: / 22.4.1996 / 20:03:30 / cg" |
732 | 1572 |
"Modified: / 25.11.1998 / 12:40:59 / cg" |
478 | 1573 |
! ! |
1574 |
||
575 | 1575 |
!HTMLDocGenerator class methodsFor:'format conversion - man pages'! |
1576 |
||
1577 |
manPageFor:aCommand |
|
632 | 1578 |
"generate a (unix-) man page for a given command & convert the output to html" |
575 | 1579 |
|
1580 |
^ self |
|
1581 |
manPageFor:aCommand |
|
1582 |
inSection:nil |
|
1583 |
||
632 | 1584 |
"Modified: / 30.10.1997 / 13:29:31 / cg" |
575 | 1585 |
! |
1586 |
||
1587 |
manPageFor:aCommand inSection:sectionOrNil |
|
632 | 1588 |
"generate a (unix-) man page for some entry in a section |
575 | 1589 |
& convert the output to html" |
1590 |
||
1591 |
|manCmd| |
|
1592 |
||
1593 |
sectionOrNil isNil ifTrue:[ |
|
1594 |
manCmd := 'man ' , aCommand |
|
1595 |
] ifFalse:[ |
|
1596 |
manCmd := 'man ' , sectionOrNil printString , ' ' , aCommand |
|
1597 |
]. |
|
1598 |
^ self |
|
1599 |
manPageFor:aCommand |
|
1600 |
manCommand:manCmd. |
|
1601 |
||
632 | 1602 |
"Created: / 9.9.1996 / 17:45:08 / cg" |
1603 |
"Modified: / 30.10.1997 / 13:29:44 / cg" |
|
575 | 1604 |
! |
1605 |
||
1606 |
manPageFor:aCommand manCommand:manCommand |
|
577 | 1607 |
"convert man-command output to html. |
632 | 1608 |
Only the body of the text (without head../head and body../body) is generated" |
575 | 1609 |
|
1610 |
|s t outStream state ch keep| |
|
1611 |
||
1612 |
s := PipeStream readingFrom:manCommand. |
|
1613 |
s notNil ifTrue:[ |
|
1614 |
outStream := '' writeStream. |
|
1615 |
state := nil. |
|
1616 |
keep := nil. |
|
1617 |
[s atEnd] whileFalse:[ |
|
1618 |
ch := s next. |
|
1619 |
||
1620 |
ch notNil ifTrue:[ |
|
1621 |
state == nil ifTrue:[ |
|
1622 |
ch == Character backspace ifTrue:[ |
|
1623 |
state := #back |
|
1624 |
] ifFalse:[ |
|
1625 |
keep notNil ifTrue:[ |
|
1626 |
keep == $< ifTrue:[ |
|
1627 |
outStream nextPutAll:'<'. |
|
1628 |
] ifFalse:[ |
|
1629 |
outStream nextPut:keep. |
|
1630 |
]. |
|
1631 |
]. |
|
1632 |
keep := ch |
|
1633 |
] |
|
1634 |
] ifFalse:[ |
|
1635 |
state == #back ifTrue:[ |
|
1636 |
ch == keep ifTrue:[ |
|
1637 |
outStream nextPutAll:'<b>'. |
|
1638 |
ch == $< ifTrue:[ |
|
1639 |
outStream nextPutAll:'<'. |
|
1640 |
] ifFalse:[ |
|
1641 |
outStream nextPut:ch. |
|
1642 |
]. |
|
1643 |
outStream nextPutAll:'</b>'. |
|
1644 |
state := nil. |
|
1645 |
keep := nil. |
|
1646 |
] ifFalse:[ |
|
1647 |
ch == $_ ifTrue:[ |
|
1648 |
keep notNil ifTrue:[ |
|
1649 |
outStream nextPutAll:'<i>'. |
|
1650 |
keep == $< ifTrue:[ |
|
1651 |
outStream nextPutAll:'<'. |
|
1652 |
] ifFalse:[ |
|
1653 |
outStream nextPut:keep. |
|
1654 |
]. |
|
1655 |
outStream nextPutAll:'</i>'. |
|
1656 |
]. |
|
1657 |
state := nil. |
|
1658 |
keep := nil. |
|
1659 |
] ifFalse:[ |
|
1660 |
keep == $_ ifTrue:[ |
|
1661 |
outStream nextPutAll:'<i>'. |
|
1662 |
ch == $< ifTrue:[ |
|
1663 |
outStream nextPutAll:'<'. |
|
1664 |
] ifFalse:[ |
|
1665 |
outStream nextPut:ch. |
|
1666 |
]. |
|
1667 |
outStream nextPutAll:'</i>'. |
|
1668 |
state := nil. |
|
1669 |
keep := nil. |
|
1670 |
] ifFalse:[ |
|
1671 |
keep notNil ifTrue:[ |
|
1672 |
keep == $< ifTrue:[ |
|
1673 |
outStream nextPutAll:'<'. |
|
1674 |
] ifFalse:[ |
|
1675 |
outStream nextPut:keep. |
|
1676 |
]. |
|
1677 |
ch == $< ifTrue:[ |
|
1678 |
outStream nextPutAll:'<'. |
|
1679 |
] ifFalse:[ |
|
1680 |
outStream nextPut:ch. |
|
1681 |
] |
|
1682 |
]. |
|
1683 |
state := nil. |
|
1684 |
keep := nil. |
|
1685 |
] |
|
1686 |
] |
|
1687 |
] |
|
1688 |
] |
|
1689 |
] |
|
1690 |
] |
|
1691 |
]. |
|
1692 |
||
1693 |
keep notNil ifTrue:[ |
|
1694 |
keep == $< ifTrue:[ |
|
1695 |
outStream nextPutAll:'<'. |
|
1696 |
] ifFalse:[ |
|
1697 |
outStream nextPut:keep |
|
1698 |
] |
|
1699 |
]. |
|
1700 |
t := outStream contents. |
|
1701 |
s shutDown. |
|
1702 |
]. |
|
1703 |
||
1704 |
(t isNil or:[t isEmpty]) ifTrue:[ |
|
1705 |
^ ' |
|
1706 |
No manual page for "<CODE><B>' , aCommand , '</B></CODE>" available. |
|
1707 |
<BR> |
|
1708 |
(the failed command was: "<CODE>' , manCommand , '"</CODE>.) |
|
1709 |
'. |
|
1710 |
]. |
|
1711 |
||
1712 |
^ ' |
|
1713 |
<pre> |
|
1714 |
' , t , ' |
|
1715 |
</pre> |
|
1716 |
' |
|
1717 |
||
1718 |
" |
|
1719 |
self manPageFor:'cvs' |
|
1720 |
" |
|
1721 |
||
632 | 1722 |
"Modified: / 28.6.1996 / 21:28:47 / stefan" |
1723 |
"Created: / 9.9.1996 / 17:43:16 / cg" |
|
1724 |
"Modified: / 30.10.1997 / 13:30:22 / cg" |
|
575 | 1725 |
! |
1726 |
||
1727 |
manPageForFile:aFilename |
|
1728 |
"convert a .man file to html" |
|
1729 |
||
1730 |
^ self |
|
1731 |
manPageFor:aFilename asFilename name |
|
1732 |
manCommand:('nroff -man ' , aFilename asFilename pathName). |
|
1733 |
||
1734 |
" |
|
1735 |
self manPageForFile:'../../stc/stc.1' |
|
1736 |
" |
|
1737 |
" |
|
1738 |
HTMLDocumentView openFullOnText:(self manPageForFile:'../../stc/stc.1') |
|
1739 |
" |
|
1740 |
||
1741 |
"Modified: 4.4.1997 / 10:44:05 / cg" |
|
1742 |
! ! |
|
1743 |
||
498 | 1744 |
!HTMLDocGenerator class methodsFor:'helpers'! |
478 | 1745 |
|
1746 |
extractSpecial:pattern from:docu |
|
1747 |
"given a collection of docu lines (from documentation methods comment), |
|
1748 |
extract things like [see also:], [author:] etc. |
|
1749 |
If found, remove the lines from the string collection, |
|
1750 |
and return the extracted ones. Otherwise return nil." |
|
1751 |
||
1752 |
|srchIdx idx lines l| |
|
1753 |
||
1754 |
srchIdx := docu findFirst:[:l | l asLowercase withoutSeparators = pattern]. |
|
1755 |
srchIdx ~~ 0 ifTrue:[ |
|
1756 |
lines := OrderedCollection new. |
|
1757 |
||
1758 |
idx := srchIdx+1. |
|
1759 |
[idx <= docu size] whileTrue:[ |
|
1760 |
l := docu at:idx. |
|
1761 |
(l isNil or:[l withoutSeparators size == 0]) ifTrue:[ |
|
1762 |
idx := docu size + 1. |
|
1763 |
] ifFalse:[ |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1764 |
l withoutSeparators = '\' ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1765 |
l := '' |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1766 |
]. |
478 | 1767 |
lines add:l |
1768 |
]. |
|
1769 |
idx := idx + 1. |
|
1770 |
]. |
|
1771 |
||
1772 |
docu removeFromIndex:srchIdx toIndex:srchIdx+lines size |
|
1773 |
]. |
|
1774 |
^ lines |
|
1775 |
||
1776 |
"Created: 25.4.1996 / 14:16:01 / cg" |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1777 |
"Modified: 11.1.1997 / 13:03:38 / cg" |
478 | 1778 |
! ! |
1779 |
||
498 | 1780 |
!HTMLDocGenerator class methodsFor:'documentation'! |
478 | 1781 |
|
1782 |
version |
|
1178 | 1783 |
^ '$Header: /cvs/stx/stx/libbasic3/HTMLDocGenerator.st,v 1.37 2002-11-11 09:41:02 cg Exp $' |
478 | 1784 |
! ! |