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