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