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