author | Claus Gittinger <cg@exept.de> |
Wed, 21 Dec 2005 12:40:47 +0100 | |
changeset 1435 | a3b5694f60ed |
parent 1400 | 2281a5920b71 |
child 1896 | ed785b09f5b1 |
permissions | -rw-r--r-- |
601 | 1 |
" |
2 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
14 |
||
1400 | 15 |
"{ Package: 'stx:libbasic3' }" |
1138
aa7687ec256f
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
16 |
|
478 | 17 |
Object subclass:#HTMLDocGenerator |
1255 | 18 |
instanceVariableNames:'outStream pathToTopOfDocumentation |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
19 |
pathToLanguageTopOfDocumentation httpRequestOrNil |
1328 | 20 |
generateBodyOnly backRef backCmd imagePath' |
478 | 21 |
classVariableNames:'' |
22 |
poolDictionaries:'' |
|
23 |
category:'System-Documentation' |
|
24 |
! |
|
25 |
||
498 | 26 |
!HTMLDocGenerator class methodsFor:'documentation'! |
478 | 27 |
|
601 | 28 |
copyright |
29 |
" |
|
30 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
31 |
All Rights Reserved |
|
32 |
||
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
||
41 |
||
42 |
! |
|
43 |
||
478 | 44 |
documentation |
45 |
" |
|
817 | 46 |
Generates HTML documentation for a class. |
47 |
Although this is normally used with the SystemBrowser |
|
48 |
(classes-generate documentation menu), |
|
49 |
it may be useful on its own, to programatically generate |
|
50 |
up-to-date documents from a classes source. |
|
51 |
||
52 |
This generator extracts the documentation methods source |
|
53 |
(or comment), individual method comments (the first comment in |
|
54 |
a method) and version information to generate a neatly formatted |
|
55 |
HTML page. |
|
56 |
If executable examples (EXBEGIN .. EXEND) are present in the classes |
|
57 |
documentation category these are also added as executable code |
|
58 |
to the document. |
|
478 | 59 |
|
60 |
[author:] |
|
61 |
Claus Gittinger |
|
817 | 62 |
|
63 |
[see also:] |
|
64 |
BrowserView |
|
65 |
HTMLDocumentView |
|
478 | 66 |
" |
67 |
! ! |
|
68 |
||
498 | 69 |
!HTMLDocGenerator class methodsFor:'document generation'! |
478 | 70 |
|
71 |
htmlClassCategoryList |
|
632 | 72 |
"generate a formatted list of all available class categories as |
73 |
an HTML string. Each category will be a hyperlink to another |
|
74 |
autogenerated page, containing the classes per category. |
|
75 |
The generated page is supposed to be given to an HTML reader |
|
76 |
with home being set to ../doc/online/xxx/classDoc |
|
77 |
(i.e. the images are to be found one-up in the doc hierarchy)" |
|
78 |
||
1249 | 79 |
^ self new htmlClassCategoryList |
80 |
||
81 |
" |
|
82 |
HTMLDocGenerator htmlClassCategoryList |
|
83 |
" |
|
84 |
! |
|
85 |
||
86 |
htmlClassListPrefix:prefix |
|
87 |
"generate an HTML document string which contains HREFS for a list |
|
88 |
of classes which start with some prefix (typically, the first |
|
89 |
character is given)" |
|
90 |
||
91 |
^ self new htmlClassListPrefix:prefix |
|
92 |
||
93 |
" |
|
94 |
HTMLDocGenerator htmlClassListPrefix:'A' |
|
95 |
" |
|
96 |
! |
|
97 |
||
98 |
htmlClassesListOfCategory:aCategory backTo:backMessage |
|
99 |
"generate an HTML document string which contains HREFS for a list |
|
100 |
of classes which are contained in a particular category." |
|
101 |
||
102 |
^ self new htmlClassesListOfCategory:aCategory backTo:backMessage |
|
103 |
! |
|
104 |
||
105 |
htmlDocOf:aClass |
|
106 |
"generate an HTML document string which contains a classes documentation" |
|
107 |
||
108 |
^ self new htmlDocOf:aClass |
|
109 |
||
110 |
" |
|
111 |
HTMLDocGenerator htmlDocOf:Array |
|
112 |
" |
|
113 |
! |
|
114 |
||
1253 | 115 |
htmlDocOf:aClass back:backCmd backRef:backRef imagePath:imagePath |
116 |
"generate a nice HTML page from a class, with a back-reference |
|
117 |
to a command or document." |
|
118 |
||
119 |
^ self new htmlDocOf:aClass back:backCmd backRef:backRef imagePath:imagePath |
|
120 |
! |
|
121 |
||
1289
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
122 |
htmlDocOf:aClass backRef:backRef |
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
123 |
"generate an HTML document string which contains a classes documentation" |
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
124 |
|
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
125 |
^ self new htmlDocOf:aClass backRef:backRef |
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
126 |
! |
c435b15b1415
oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents:
1280
diff
changeset
|
127 |
|
1249 | 128 |
htmlDocOfImplementorsOf:selector |
129 |
"generate an HTML document string which contains HREFS |
|
130 |
to all implementors of a particular selector" |
|
131 |
||
132 |
^ self new htmlDocOfImplementorsOf:selector |
|
133 |
||
134 |
" |
|
135 |
HTMLDocGenerator htmlDocOfImplementorsOf:#at: |
|
136 |
" |
|
137 |
! |
|
138 |
||
1435 | 139 |
htmlDocOfImplementorsOfAnyMatching:selectorPattern |
140 |
"generate an HTML document string which contains HREFS |
|
141 |
to all implementors of a particular selector pattern" |
|
142 |
||
143 |
^ self new htmlDocOfImplementorsOfAnyMatching:selectorPattern |
|
144 |
||
145 |
" |
|
146 |
HTMLDocGenerator htmlDocOfImplementorsOfAnyMatching:'key*:x:y:' |
|
147 |
" |
|
148 |
! |
|
149 |
||
1249 | 150 |
htmlSelectorList |
151 |
"generate an HTML string for all selectors (for which methods exist) |
|
152 |
in the system" |
|
153 |
||
154 |
^ self new htmlSelectorList |
|
155 |
||
156 |
" |
|
157 |
HTMLDocGenerator htmlSelectorList |
|
158 |
" |
|
159 |
! |
|
160 |
||
161 |
htmlSelectorListMatching:prefix |
|
162 |
"generate an HTML string for all selectors which match a pattern |
|
163 |
(and for which methods exist) in the system" |
|
164 |
||
165 |
^ self new htmlSelectorListMatching:prefix |
|
166 |
! |
|
167 |
||
168 |
htmlSelectorListPrefix:prefix |
|
169 |
"generate an HTML string for all selectors whose names starts with |
|
170 |
a prefix (and for which methods exist) in the system" |
|
171 |
||
172 |
^ self new htmlSelectorListPrefix:prefix |
|
173 |
||
174 |
" |
|
175 |
HTMLDocGenerator htmlSelectorListPrefix:'a' |
|
176 |
" |
|
177 |
! |
|
178 |
||
179 |
manPageFor:aCommandName |
|
180 |
"generate a (unix-) man page for a given command & convert the output to html" |
|
181 |
||
182 |
^ self new manPageFor:aCommandName |
|
183 |
||
184 |
" |
|
185 |
HTMLDocGenerator manPageFor:'ls' |
|
186 |
||
187 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageFor:'ls') |
|
188 |
" |
|
189 |
! |
|
190 |
||
191 |
manPageFor:aManPageTemplateFile manCommand:nroffCommand |
|
192 |
"convert man-command output to html. |
|
193 |
Only the body of the text (without head../head and body../body) is generated" |
|
194 |
||
195 |
^ self new manPageFor:aManPageTemplateFile manCommand:nroffCommand |
|
196 |
||
197 |
" |
|
198 |
HTMLDocGenerator |
|
199 |
manPageForFile:'/usr/man/man2/open.2' |
|
200 |
manCommand:'nroff -man /usr/man/man2/open.2' |
|
201 |
" |
|
202 |
! |
|
203 |
||
204 |
manPageForFile:aManPageTemplateFile |
|
205 |
"convert a .man file to html" |
|
206 |
||
207 |
^ self new manPageForFile:aManPageTemplateFile |
|
208 |
||
209 |
" |
|
210 |
HTMLDocGenerator manPageForFile:'/usr/man/man2/open.2' |
|
211 |
||
212 |
HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:'../../stc/stc.1') |
|
213 |
" |
|
214 |
! ! |
|
215 |
||
1255 | 216 |
!HTMLDocGenerator class methodsFor:'pathnames'! |
217 |
||
218 |
languageSpecificDocDirectory |
|
219 |
|lang| |
|
220 |
||
221 |
lang := Smalltalk language. |
|
222 |
||
223 |
"XXX Kludge for now, map ISO-639 abbreviations to dir names. |
|
224 |
Should rename the directories" |
|
225 |
||
226 |
lang == #en ifTrue:[ |
|
227 |
^ 'english'. |
|
228 |
]. |
|
229 |
lang == #de ifTrue:[ |
|
230 |
^ 'german'. |
|
231 |
]. |
|
232 |
lang == #fr ifTrue:[ |
|
233 |
^ 'french'. |
|
234 |
]. |
|
235 |
lang == #it ifTrue:[ |
|
236 |
^ 'italian'. |
|
237 |
]. |
|
238 |
lang == #jp ifTrue:[ |
|
239 |
^ 'japanese'. |
|
240 |
]. |
|
241 |
^ 'english'. |
|
242 |
||
243 |
" |
|
244 |
self languageSpecificDocDirectory |
|
245 |
" |
|
246 |
! ! |
|
247 |
||
248 |
!HTMLDocGenerator methodsFor:'accessing'! |
|
249 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
250 |
generateBodyOnly:something |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
251 |
"set the value of the instance variable 'generateBodyOnly' (automatically generated)" |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
252 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
253 |
generateBodyOnly := something. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
254 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
255 |
|
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
256 |
httpRequest:aRequest |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
257 |
httpRequestOrNil := aRequest. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
258 |
! |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
259 |
|
1255 | 260 |
pathToLanguageTopOfDocumentation:something |
261 |
"set the value of the instance variable 'pathToLanguageTopOfDocumentation' (automatically generated)" |
|
262 |
||
263 |
pathToLanguageTopOfDocumentation := something. |
|
264 |
! |
|
265 |
||
266 |
pathToTopOfDocumentation:something |
|
267 |
"set the value of the instance variable 'pathToTopOfDocumentation' (automatically generated)" |
|
268 |
||
269 |
pathToTopOfDocumentation := something. |
|
270 |
! ! |
|
271 |
||
1249 | 272 |
!HTMLDocGenerator methodsFor:'document generation'! |
273 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
274 |
generateExampleEnd |
1343 | 275 |
outStream nextPutLine:'</PRE></CODE>'. |
276 |
outStream nextPutLine:'</TD></TR></TABLE>'. |
|
277 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
278 |
self generatingForSTXBrowser ifFalse:[ |
1343 | 279 |
"/ outStream nextPutLine:'</FONT>'. |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
280 |
^ self |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
281 |
]. |
1343 | 282 |
outStream nextPutLine:'</A>'. |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
283 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
284 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
285 |
generateExampleStart |
1343 | 286 |
outStream nextPutLine:'<P>'. |
287 |
outStream nextPutLine:'<TABLE width="100%" bgcolor="#eedddd"><TR><TD>'. |
|
288 |
self generatingForSTXBrowser ifTrue:[ |
|
289 |
outStream nextPutLine:'<A info="execute the example" type="example" showresult>'. |
|
290 |
]. |
|
291 |
outStream nextPutLine:'<CODE><PRE>'. |
|
292 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
293 |
self generatingForSTXBrowser ifFalse:[ |
1343 | 294 |
"/ outStream nextPutLine:'<FONT color=#7F0000>'. |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
295 |
]. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
296 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
297 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
298 |
generateExamples:examples |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
299 |
|inExample| |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
300 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
301 |
inExample := false. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
302 |
outStream nextPutLine:'<h2><a name="EXAMPLES" href="#I_EXAMPLES">Examples:</A></h2>'. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
303 |
outStream nextPutLine:'<BR>'. |
1343 | 304 |
|
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
305 |
examples do:[:line | |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
306 |
line withoutSeparators = '[exBegin]' ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
307 |
inExample ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
308 |
self generateExampleEnd. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
309 |
]. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
310 |
self generateExampleStart. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
311 |
inExample := true. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
312 |
] ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
313 |
line withoutSeparators = '[exEnd]' ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
314 |
inExample ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
315 |
self generateExampleEnd. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
316 |
]. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
317 |
inExample := false. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
318 |
] ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
319 |
outStream nextPutLine:line |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
320 |
] |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
321 |
]. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
322 |
]. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
323 |
inExample ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
324 |
self generateExampleEnd. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
325 |
]. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
326 |
self generateHorizontalLine. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
327 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
328 |
|
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
329 |
generatePrivateClassInfoFor:aClass with:privateClasses on:aStream |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
330 |
|s| |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
331 |
|
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
332 |
s := aStream. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
333 |
|
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
334 |
s nextPutLine:'<pre>'. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
335 |
privateClasses do:[:cls | |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
336 |
|nm fullName| |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
337 |
|
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
338 |
nm := cls nameWithoutPrefix. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
339 |
fullName := cls name. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
340 |
s nextPutAll:' '. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
341 |
(cls owningClass isLoaded not |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
342 |
or:[cls owningClass wasAutoloaded]) ifTrue:[ |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
343 |
self |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
344 |
generateClassDocReferenceFor:fullName |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
345 |
text:nm |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
346 |
autoloading:(cls owningClass name) |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
347 |
] ifFalse:[ |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
348 |
self |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
349 |
generateClassDocReferenceFor:fullName |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
350 |
text:nm. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
351 |
]. |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
352 |
s cr. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
353 |
]. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
354 |
s nextPutLine:'</pre>'. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
355 |
! |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
356 |
|
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
357 |
generateRefLineFor:ref forClass:aClass on:aStream |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
358 |
|idx1 idx2 realRef ns nm href| |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
359 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
360 |
aStream nextPutAll:' '. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
361 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
362 |
idx1 := ref indexOf:$:. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
363 |
idx2 := ref indexOf:$: startingAt:idx1+1. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
364 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
365 |
(idx1 == 0 or:[idx2 == (idx1+1)]) ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
366 |
(ref includesMatchCharacters) ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
367 |
aStream nextPutAll:(self |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
368 |
anchorForHTMLDocAction: |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
369 |
('htmlClassesMatching:''' , ref , ''' backTo:nil') |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
370 |
info: |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
371 |
( 'Show documentation of ' , ref ) |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
372 |
text: |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
373 |
ref). |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
374 |
^ self |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
375 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
376 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
377 |
realRef := ref. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
378 |
((ns := aClass nameSpace) notNil and:[ns ~~ Smalltalk]) ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
379 |
ns isNameSpace ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
380 |
(ns at:realRef asSymbol) notNil ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
381 |
realRef := ns name , '::' , realRef |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
382 |
] |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
383 |
] |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
384 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
385 |
self generateClassDocReferenceFor:realRef text:ref. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
386 |
^ self |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
387 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
388 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
389 |
(ref startsWith:'http:') ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
390 |
aStream nextPutAll:'<a href="' , ref , '"><I>' , ref , '</I></a>'. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
391 |
^ self. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
392 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
393 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
394 |
nm := (ref copyFrom:2 to:idx1-1) withoutSpaces. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
395 |
href := (ref copyFrom:(ref indexOf:$:)+1 to:(ref size - 1)) withoutSpaces. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
396 |
(href startsWith:'man:') ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
397 |
href := (href copyFrom:5) withoutSpaces. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
398 |
aStream nextPutAll:'<a INFO="Show manual page" href="' , self pathToTopOfDocumentation , '/misc/onlyInSTX2.html" action="html:' , self class name , ' manPageFor:''' , href , '''">[<I>' , nm , '</I>]</A>'. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
399 |
^ self. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
400 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
401 |
(href startsWith:'http:') ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
402 |
aStream nextPutAll:'<a href="' , href , '">[<I>' , nm , '</I>]</a>'. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
403 |
^ self |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
404 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
405 |
(href startsWith:'html:') ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
406 |
href := (href copyFrom:6) withoutSpaces. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
407 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
408 |
aStream nextPutAll:'<a href="' , (self pathToDocumentationFile:href) , '">[<I>' , nm , '</I>]</a>'. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
409 |
! |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
410 |
|
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
411 |
generateRefLines:refLines forClass:aClass on:aStream |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
412 |
aStream nextPutLine:'<pre>'. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
413 |
refLines do:[:l | |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
414 |
l isString ifTrue:[ |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
415 |
self generateRefLineFor:l forClass:aClass on:aStream. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
416 |
aStream cr. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
417 |
] ifFalse:[ |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
418 |
l do:[:ref | |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
419 |
self generateRefLineFor:ref forClass:aClass on:aStream. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
420 |
aStream cr. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
421 |
]. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
422 |
]. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
423 |
]. |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
424 |
aStream nextPutLine:'</pre>'. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
425 |
! |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
426 |
|
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
427 |
generateSubclassInfoFor:aClass on:aStream |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
428 |
|s subs| |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
429 |
|
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
430 |
s := aStream. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
431 |
|
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
432 |
subs := aClass subclasses |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
433 |
asOrderedCollection sort:[:a :b | a name < b name]. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
434 |
|
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
435 |
s nextPutLine:'<pre>'. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
436 |
subs do:[:cls | |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
437 |
|nm| |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
438 |
|
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
439 |
nm := cls name. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
440 |
s nextPutAll:' '. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
441 |
cls isLoaded ifFalse:[ |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
442 |
self |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
443 |
generateClassDocReferenceFor:nm |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
444 |
text:nm |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
445 |
autoloading:nm |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
446 |
] ifTrue:[ |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
447 |
self generateClassDocReferenceFor:nm. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
448 |
]. |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
449 |
s cr. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
450 |
]. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
451 |
s nextPutLine:'</pre>'. |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
452 |
! |
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
453 |
|
1249 | 454 |
htmlClassCategoryList |
455 |
"generate a formatted list of all available class categories as |
|
456 |
an HTML string. Each category will be a hyperlink to another |
|
457 |
autogenerated page, containing the classes per category. |
|
458 |
The generated page is supposed to be given to an HTML reader |
|
459 |
with home being set to ../doc/online/xxx/classDoc |
|
460 |
(i.e. the images are to be found one-up in the doc hierarchy)" |
|
461 |
||
492 | 462 |
|categories s prefixList prefix prefixStack prev| |
478 | 463 |
|
1249 | 464 |
categories := Smalltalk allClassCategories asOrderedCollection sort. |
478 | 465 |
|
1249 | 466 |
outStream := s := '' writeStream. |
478 | 467 |
|
1249 | 468 |
self generateHTMLHeadWithTitle:'Class Categories:'. |
478 | 469 |
|
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
470 |
self generateBODYStart. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
471 |
|
1249 | 472 |
self generateUpArrowButtonForTop. |
473 |
self generateHorizontalLine. |
|
474 |
self generateH1:'Class Categories:'. |
|
475 |
s nextPutLine:'<ul>'. |
|
478 | 476 |
|
477 |
prefixList := Set new. |
|
478 |
||
479 |
categories keysAndValuesDo:[:index :element | |
|
480 |
|prev common| |
|
481 |
||
482 |
index ~~ 1 ifTrue:[ |
|
483 |
prev := categories at:(index - 1). |
|
484 |
common := (Array with:prev with:element) longestCommonPrefix. |
|
485 |
(common endsWith:'-') ifTrue:[ |
|
486 |
prefixList add:(common copyWithoutLast:1) |
|
487 |
] ifFalse:[ |
|
553 | 488 |
(common includes:$-) ifTrue:[ |
489 |
prefixList add:(common copyTo:(common lastIndexOf:$-)-1). |
|
490 |
] ifFalse:[ |
|
1143 | 491 |
"/ common = prev ifTrue:[ |
492 |
"/ prefixList add:common |
|
493 |
"/ ] |
|
478 | 494 |
] |
495 |
] |
|
496 |
] |
|
497 |
]. |
|
498 |
||
499 |
prefix := ''. prefixStack := OrderedCollection new. |
|
500 |
prev := ''. |
|
501 |
||
502 |
categories := categories select:[:nm | nm ~= 'obsolete']. |
|
503 |
||
504 |
categories do:[:nm | |
|
505 |
|longest| |
|
506 |
||
507 |
"/ longest prefix .... |
|
508 |
longest := prefixList inject:'' into:[:maxPrefix :prefix | |
|
1143 | 509 |
|prefixWithDash| |
510 |
||
511 |
prefixWithDash := prefix , '-'. |
|
478 | 512 |
nm = prefix ifTrue:[ |
513 |
maxPrefix |
|
514 |
] ifFalse:[ |
|
1143 | 515 |
(nm startsWith:prefixWithDash) |
478 | 516 |
ifTrue:[ |
1143 | 517 |
prefixWithDash size > maxPrefix size |
478 | 518 |
ifTrue:[ |
1143 | 519 |
prefixWithDash |
478 | 520 |
] ifFalse:[ |
521 |
maxPrefix |
|
522 |
] |
|
523 |
] ifFalse:[ |
|
524 |
maxPrefix |
|
525 |
] |
|
526 |
] |
|
527 |
]. |
|
528 |
||
529 |
longest size > 0 ifTrue:[ |
|
530 |
longest = prefix ifTrue:[ |
|
531 |
"/ no change |
|
532 |
] ifFalse:[ |
|
533 |
(longest startsWith:prefix) ifTrue:[ |
|
534 |
prefixStack addLast:longest. |
|
535 |
longest ~= prev ifTrue:[ |
|
536 |
prefixStack size == 1 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
537 |
s nextPutLine:'<p>'. |
478 | 538 |
]. |
1143 | 539 |
s nextPutLine:'<li>' , (longest copyFrom:prefix size + 1). |
478 | 540 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
541 |
s nextPutLine:'<ul>'. |
478 | 542 |
prefix := longest. |
543 |
] ifFalse:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
544 |
s nextPutLine:'</ul>'. |
552 | 545 |
prefixStack notEmpty ifTrue:[ |
546 |
prefixStack removeLast. |
|
547 |
]. |
|
478 | 548 |
|
549 |
[prefixStack notEmpty |
|
550 |
and:[(longest startsWith:prefixStack last) not]] whileTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
551 |
s nextPutLine:'</ul>'. |
478 | 552 |
prefixStack removeLast. |
553 |
]. |
|
554 |
||
555 |
prefixStack notEmpty ifTrue:[ |
|
556 |
prefix := prefixStack last. |
|
557 |
] ifFalse:[ |
|
558 |
prefixStack addLast:longest. |
|
559 |
prefix := longest. |
|
560 |
longest ~= prev ifTrue:[ |
|
561 |
prefixStack size == 1 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
562 |
s nextPutLine:'<p>'. |
478 | 563 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
564 |
s nextPutLine:'<li>' , longest. |
478 | 565 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
566 |
s nextPutLine:'<ul>'. |
478 | 567 |
] |
568 |
]. |
|
569 |
] |
|
570 |
] ifFalse:[ |
|
571 |
[prefixStack size > 0] whileTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
572 |
s nextPutLine:'</ul>'. |
478 | 573 |
prefixStack removeLast. |
574 |
]. |
|
575 |
prefixStack size == 0 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
576 |
s nextPutLine:'<p>'. |
478 | 577 |
]. |
578 |
prefix := ''. |
|
579 |
]. |
|
580 |
||
1249 | 581 |
s nextPutAll:'<li>'. |
582 |
s nextPutLine:(self |
|
583 |
anchorForHTMLDocAction: |
|
584 |
('htmlClassesListOfCategory:''', nm |
|
585 |
, ''' backTo:''htmlClassCategoryList''') |
|
586 |
info: |
|
587 |
('Classes in ' , nm) |
|
588 |
text: |
|
589 |
(nm copyFrom:prefix size + 1)). |
|
478 | 590 |
|
591 |
prev := nm. |
|
592 |
]. |
|
593 |
||
594 |
s nextPutAll:' |
|
595 |
</ul> |
|
596 |
'. |
|
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
597 |
self generateBODYandHTMLEnd. |
478 | 598 |
|
599 |
^ s contents |
|
600 |
||
601 |
" |
|
1249 | 602 |
HTMLDocGenerator new htmlClassCategoryList |
478 | 603 |
" |
604 |
||
632 | 605 |
"Created: / 22.4.1996 / 20:03:30 / cg" |
606 |
"Modified: / 30.10.1997 / 13:16:08 / cg" |
|
478 | 607 |
! |
608 |
||
609 |
htmlClassListPrefix:prefix |
|
632 | 610 |
"generate an HTML document string which contains HREFS for a list |
611 |
of classes which start with some prefix (typically, the first |
|
612 |
character is given)" |
|
613 |
||
478 | 614 |
|classes| |
615 |
||
616 |
classes := Smalltalk allClasses |
|
498 | 617 |
select:[:cls | |
618 |
cls isPrivate not |
|
917
c77bb2d56e05
#isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
619 |
and:[(cls isNameSpace not or:[cls == Smalltalk]) |
528 | 620 |
and:[cls name startsWith:prefix]] |
498 | 621 |
]. |
478 | 622 |
|
498 | 623 |
^ self |
624 |
htmlClasses:classes |
|
632 | 625 |
title:('Classes starting with ''' , prefix asString , ''':'). |
478 | 626 |
|
632 | 627 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
628 |
"Modified: / 30.10.1997 / 13:21:49 / cg" |
|
478 | 629 |
! |
630 |
||
631 |
htmlClasses:classes title:title |
|
632 | 632 |
"generate an HTML document string which contains HREFS for a given list |
633 |
of classes" |
|
634 |
||
478 | 635 |
^ self |
636 |
htmlClasses:classes |
|
637 |
title:title |
|
638 |
backTo:nil |
|
639 |
||
632 | 640 |
"Modified: / 30.10.1997 / 13:21:40 / cg" |
478 | 641 |
! |
642 |
||
643 |
htmlClasses:classes title:title backTo:backRef |
|
632 | 644 |
"generate an HTML document string which contains HREFS for a given list |
645 |
of classes. If backref is nonNil, a back-button to that |
|
646 |
HREF is added at the top. |
|
647 |
The generated page is supposed to be given to an HTML reader |
|
648 |
with home being set to ../doc/online/xxx/classDoc |
|
649 |
(i.e. the images are to be found one-up in the doc hierarchy)" |
|
650 |
||
478 | 651 |
|classNames s| |
652 |
||
653 |
classNames := (classes collect:[:cls | cls name]) asOrderedCollection sort. |
|
654 |
||
1249 | 655 |
outStream := s := '' writeStream. |
478 | 656 |
|
1249 | 657 |
self generateHTMLHeadWithTitle:title. |
658 |
s nextPutLine:'<body>'. |
|
478 | 659 |
backRef notNil ifTrue:[ |
1249 | 660 |
backRef ~~ #none ifTrue:[ |
661 |
self |
|
1255 | 662 |
generateUpArrowButtonWithReference:(self pathToLanguageTopOfDocumentation , '/TOP.html') |
1249 | 663 |
command:backRef |
664 |
imagePath:nil |
|
665 |
altLabel:'back'. |
|
478 | 666 |
] |
667 |
] ifFalse:[ |
|
1249 | 668 |
self |
1255 | 669 |
generateUpArrowButtonWithReference:(self pathToLanguageTopOfDocumentation , '/TOP.html') |
1249 | 670 |
command:nil |
671 |
imagePath:nil |
|
672 |
altLabel:'top'. |
|
478 | 673 |
]. |
674 |
backRef ~~ #none ifTrue:[ |
|
1249 | 675 |
self generateHorizontalLine. |
478 | 676 |
]. |
1249 | 677 |
self generateH1:title. |
678 |
s nextPutLine:'<ul>'. |
|
478 | 679 |
|
1250 | 680 |
classNames do:[:className | |
1249 | 681 |
s nextPutAll:'<li>'. |
1250 | 682 |
self generateClassDocReferenceFor:className. |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
683 |
s cr. |
478 | 684 |
]. |
685 |
||
686 |
s nextPutAll:' |
|
687 |
</ul> |
|
688 |
'. |
|
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
689 |
self generateBODYandHTMLEnd. |
478 | 690 |
|
691 |
^ s contents |
|
692 |
||
632 | 693 |
"Created: / 23.4.1996 / 15:31:55 / cg" |
694 |
"Modified: / 30.10.1997 / 13:21:32 / cg" |
|
478 | 695 |
! |
696 |
||
697 |
htmlClassesListOfCategory:category |
|
632 | 698 |
"generate an HTML document string which contains HREFS for a list |
699 |
of classes which are contained in a particular category." |
|
700 |
||
528 | 701 |
^ self |
702 |
htmlClassesListOfCategory:category |
|
478 | 703 |
backTo:nil |
704 |
||
632 | 705 |
"Modified: / 30.10.1997 / 13:21:23 / cg" |
478 | 706 |
! |
707 |
||
708 |
htmlClassesListOfCategory:category backTo:backRef |
|
632 | 709 |
"generate an HTML document string which contains HREFS for a list |
710 |
of classes which are contained in a particular category." |
|
711 |
||
478 | 712 |
|classes| |
713 |
||
714 |
classes := Smalltalk allClasses |
|
498 | 715 |
select:[:cls | cls isPrivate not |
917
c77bb2d56e05
#isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
716 |
and:[(cls isNameSpace not or:[cls == Smalltalk]) |
528 | 717 |
and:[cls category = category]] |
718 |
]. |
|
478 | 719 |
|
720 |
^ self |
|
632 | 721 |
htmlClasses:classes |
722 |
title:('Classes in: ' , category) |
|
478 | 723 |
backTo:backRef |
724 |
||
632 | 725 |
"Created: / 23.4.1996 / 15:39:39 / cg" |
726 |
"Modified: / 30.10.1997 / 13:21:16 / cg" |
|
478 | 727 |
! |
728 |
||
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
729 |
htmlClassesMatching:aMatchPattern backTo:backRef |
632 | 730 |
"generate an HTML document string which contains HREFS |
731 |
for a list of classes whose name matches a given matchPattern." |
|
732 |
||
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
733 |
|classes cls| |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
734 |
|
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
735 |
classes := Smalltalk allClasses |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
736 |
select:[:cls | cls isPrivate not |
917
c77bb2d56e05
#isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
737 |
and:[(cls isNameSpace not or:[cls == Smalltalk]) |
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
738 |
and:[aMatchPattern match:cls name]] |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
739 |
]. |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
740 |
|
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
741 |
^ self |
632 | 742 |
htmlClasses:classes |
743 |
title:('Classes matching: ' , aMatchPattern) |
|
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
744 |
backTo:backRef |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
745 |
|
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
746 |
" |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
747 |
self htmlClassesMatching:'Tgen::*' backTo:nil |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
748 |
" |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
749 |
|
632 | 750 |
"Modified: / 30.10.1997 / 13:21:06 / cg" |
541
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
751 |
! |
095de1529e29
allow matchPatterns in related information
Claus Gittinger <cg@exept.de>
parents:
540
diff
changeset
|
752 |
|
478 | 753 |
htmlDocOf:aClass |
632 | 754 |
"generate an HTML document string which contains a classes documentation" |
755 |
||
478 | 756 |
^ self htmlDocOf:aClass back:nil backRef:nil |
757 |
||
758 |
" |
|
759 |
self htmlDocOf:PostscriptPrinterStream |
|
760 |
" |
|
761 |
||
632 | 762 |
"Modified: / 30.10.1997 / 13:22:19 / cg" |
478 | 763 |
! |
764 |
||
765 |
htmlDocOf:aClass back:backCmd |
|
632 | 766 |
"generate an HTML document string which contains a classes documentation" |
767 |
||
478 | 768 |
^ self htmlDocOf:aClass back:backCmd backRef:nil |
769 |
||
632 | 770 |
"Modified: / 30.10.1997 / 13:22:27 / cg" |
478 | 771 |
! |
772 |
||
773 |
htmlDocOf:aClass back:backCmd backRef:backRef |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
774 |
"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
|
775 |
to a command or document. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
776 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
777 |
Extract sections from the classes documentation method, |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
778 |
where the following lines start a special subsection: |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
779 |
[see also:] - references to other classes and/or documents |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
780 |
[start with:] - one-liners to start a demonstration |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
781 |
[author:] - author(s) of this class |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
782 |
[warning:] - usage warnings if any |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
783 |
[hints:] - usage hints if any |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
784 |
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
|
785 |
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
|
786 |
to an empty line. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
787 |
|
632 | 788 |
Also extract examples from the classes example method, |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
789 |
where executable examples are made from sections enclosed in: |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
790 |
[exBegin] |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
791 |
... |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
792 |
[exEnd] |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
793 |
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
|
794 |
everything else is plain documentation text. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
795 |
" |
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
796 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
797 |
^ self |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
798 |
htmlDocOf:aClass |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
799 |
back:backCmd |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
800 |
backRef:backRef |
1255 | 801 |
imagePath:(self pathToTopOfDocumentation , '/icons') |
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
802 |
! |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
803 |
|
1328 | 804 |
htmlDocOf:aClass back:backCmdArg backRef:backRefArg imagePath:imagePathArg |
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
805 |
"generate a nice HTML page from a class, with a back-reference |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
806 |
to a command or document. |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
807 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
808 |
Extract sections from the classes documentation method, |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
809 |
where the following lines start a special subsection: |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
810 |
[see also:] - references to other classes and/or documents |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
811 |
[start with:] - one-liners to start a demonstration |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
812 |
[author:] - author(s) of this class |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
813 |
[warning:] - usage warnings if any |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
814 |
[hints:] - usage hints if any |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
815 |
Each section ends with an empty line - however, for formatting, |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
816 |
a line consisting of a single backslash character will be converted |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
817 |
to an empty line. |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
818 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
819 |
Also extract examples from the classes example method, |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
820 |
where executable examples are made from sections enclosed in: |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
821 |
[exBegin] |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
822 |
... |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
823 |
[exEnd] |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
824 |
these parts are displayed in courier and will be made executable. |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
825 |
everything else is plain documentation text. |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
826 |
" |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
827 |
|
478 | 828 |
|supers s indent m docu examples firstIndent firstNonEmpty |
1328 | 829 |
collectionOfCategories collectionOfClassCategories subs refLines demoLines warnLines hintLines authorLines first wasLoaded didLoadBin |
1249 | 830 |
privateClasses owner className metaClass shortName shortMetaName| |
478 | 831 |
|
1328 | 832 |
backRef := backRefArg. |
833 |
backCmd := backCmdArg. |
|
834 |
imagePath := imagePathArg. |
|
835 |
||
600 | 836 |
aClass isNil ifTrue:[ |
837 |
^ '' "/ just in case ... |
|
838 |
]. |
|
839 |
||
1328 | 840 |
outStream := s := '' writeStream. |
841 |
className := aClass name. |
|
842 |
shortName := aClass nameWithoutPrefix. |
|
843 |
metaClass := aClass class. |
|
844 |
shortMetaName := metaClass nameWithoutPrefix. |
|
845 |
||
846 |
self generateHTMLHeadWithTitle:('Class: ' , className). |
|
847 |
self generateBODYStart. |
|
848 |
self generateBackButton. |
|
849 |
||
1363 | 850 |
(aClass isNameSpace and:[ aClass ~~ Smalltalk ]) ifTrue:[ |
1328 | 851 |
s nextPutLine:'<h1>'. |
852 |
s nextPutAll:'NameSpace: '; |
|
853 |
nextPutLine:(shortName). |
|
854 |
s nextPutLine:'</h1>'. |
|
855 |
self generateBODYandHTMLEnd. |
|
856 |
^ s contents. |
|
857 |
]. |
|
858 |
||
478 | 859 |
(wasLoaded := aClass isLoaded) ifFalse:[ |
860 |
"/ load it - but not a binary |
|
861 |
didLoadBin := Smalltalk loadBinaries. |
|
862 |
Smalltalk loadBinaries:false. |
|
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
863 |
[ |
1256 | 864 |
Autoload autoloadFailedSignal handle:[:ex | |
1309 | 865 |
^ 'Autoload of ' , aClass name , ' failed - no documentation available.' |
1256 | 866 |
] do:[ |
867 |
aClass autoload. |
|
868 |
]. |
|
1140
96ccc944d23a
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
869 |
] ensure:[ |
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
870 |
didLoadBin ifTrue:[Smalltalk loadBinaries:true]. |
1256 | 871 |
]. |
478 | 872 |
]. |
873 |
||
499 | 874 |
owner := aClass owningClass. |
569 | 875 |
privateClasses := aClass privateClassesSorted. |
499 | 876 |
|
478 | 877 |
"/ |
878 |
"/ extract documentation or comment, if there is any |
|
879 |
"/ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
880 |
m := metaClass compiledMethodAt:#documentation. |
478 | 881 |
m notNil ifTrue:[ |
882 |
docu := m comment. |
|
883 |
] ifFalse:[ |
|
884 |
"try comment" |
|
885 |
docu := aClass comment. |
|
886 |
]. |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
887 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
888 |
(docu notNil and:[docu isEmpty]) ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
889 |
docu := nil |
478 | 890 |
]. |
891 |
docu notNil ifTrue:[ |
|
1249 | 892 |
docu := self withSpecialHTMLCharactersEscaped:docu. |
478 | 893 |
docu := docu asStringCollection. |
894 |
||
895 |
"/ |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
896 |
"/ search for a [see also:] section |
478 | 897 |
"/ |
898 |
refLines := self extractSpecial:'[see also:]' from:docu. |
|
899 |
||
900 |
"/ |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
901 |
"/ search for a [start with:] section |
478 | 902 |
"/ |
903 |
demoLines := self extractSpecial:'[start with:]' from:docu. |
|
904 |
||
905 |
"/ |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
906 |
"/ search for a [author:] section |
478 | 907 |
"/ |
908 |
authorLines := self extractSpecial:'[author:]' from:docu. |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
909 |
authorLines isNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
910 |
authorLines := self extractSpecial:'[authors:]' from:docu. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
911 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
912 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
913 |
"/ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
914 |
"/ search for a [warning:] section |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
915 |
"/ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
916 |
warnLines := self extractSpecial:'[warning:]' from:docu. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
917 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
918 |
"/ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
919 |
"/ search for a [hints:] section |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
920 |
"/ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
921 |
hintLines := self extractSpecial:'[hints:]' from:docu. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
922 |
hintLines isNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
923 |
hintLines := self extractSpecial:'[hint:]' from:docu. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
924 |
]. |
478 | 925 |
|
649 | 926 |
docu notEmpty ifTrue:[ |
927 |
"/ |
|
928 |
"/ strip off empty lines |
|
929 |
"/ |
|
650
f3cbff8e76ae
oops - another check for empty doc
Claus Gittinger <cg@exept.de>
parents:
649
diff
changeset
|
930 |
[docu notEmpty and:[(docu at:1) size == 0]] whileTrue:[ |
649 | 931 |
docu removeIndex:1 |
932 |
]. |
|
650
f3cbff8e76ae
oops - another check for empty doc
Claus Gittinger <cg@exept.de>
parents:
649
diff
changeset
|
933 |
[docu notEmpty and:[(docu at:docu size) size == 0]] whileTrue:[ |
649 | 934 |
docu removeIndex:(docu size) |
935 |
]. |
|
478 | 936 |
]. |
937 |
||
938 |
docu notEmpty ifTrue:[ |
|
939 |
firstIndent := docu first leftIndent. |
|
940 |
firstIndent > 0 ifTrue:[ |
|
941 |
docu := docu collect:[:line | |
|
942 |
line leftIndent >= firstIndent ifTrue:[ |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
943 |
line copyFrom:firstIndent + 1. |
478 | 944 |
] ifFalse:[ |
945 |
line |
|
946 |
] |
|
947 |
]. |
|
948 |
]. |
|
949 |
firstNonEmpty := docu findFirst:[:line | line notEmpty]. |
|
950 |
firstNonEmpty > 1 ifTrue:[ |
|
951 |
docu := docu copyFrom:firstNonEmpty |
|
952 |
] |
|
953 |
]. |
|
954 |
docu := docu asString. |
|
955 |
]. |
|
956 |
||
957 |
refLines notNil ifTrue:[ |
|
958 |
refLines := refLines collect:[:l | |
|
959 |
|t| |
|
960 |
||
961 |
((t := l withoutSeparators) startsWith:'(') ifTrue:[ |
|
962 |
t |
|
963 |
] ifFalse:[ |
|
1336 | 964 |
t := l asCollectionOfWords. |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
965 |
(t size == 1 |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
966 |
and:[ (t first includes:$:) not ]) ifTrue:[ |
1336 | 967 |
t first |
968 |
] ifFalse:[ |
|
969 |
t |
|
970 |
] |
|
478 | 971 |
] |
972 |
]. |
|
973 |
]. |
|
974 |
||
975 |
"/ |
|
976 |
"/ extract examples if there are any |
|
977 |
"/ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
978 |
m := metaClass compiledMethodAt:#examples. |
478 | 979 |
m notNil ifTrue:[ |
980 |
examples := m comment. |
|
981 |
examples notNil ifTrue:[ |
|
982 |
examples isEmpty ifTrue:[ |
|
983 |
examples := nil |
|
984 |
]. |
|
985 |
]. |
|
986 |
examples notNil ifTrue:[ |
|
1249 | 987 |
examples := self withSpecialHTMLCharactersEscaped:examples. |
478 | 988 |
examples := examples asStringCollection. |
989 |
||
990 |
"/ |
|
991 |
"/ strip off empty lines |
|
992 |
"/ |
|
993 |
[examples first size == 0] whileTrue:[ |
|
994 |
examples removeIndex:1 |
|
995 |
]. |
|
996 |
[examples last size == 0] whileTrue:[ |
|
997 |
examples removeIndex:(examples size) |
|
998 |
]. |
|
999 |
||
1000 |
examples notEmpty ifTrue:[ |
|
1001 |
firstIndent := examples first withTabsExpanded leftIndent. |
|
1002 |
firstIndent > 0 ifTrue:[ |
|
1003 |
examples := examples collect:[:line | |
|
1004 |
|l| |
|
1005 |
||
1006 |
l := line withTabsExpanded. |
|
1007 |
l leftIndent >= firstIndent ifTrue:[ |
|
1008 |
l copyFrom:firstIndent. |
|
1009 |
] ifFalse:[ |
|
1010 |
l |
|
1011 |
] |
|
1012 |
]. |
|
1013 |
]. |
|
1014 |
firstNonEmpty := examples findFirst:[:line | line notEmpty]. |
|
1015 |
firstNonEmpty > 1 ifTrue:[ |
|
1016 |
examples := examples copyFrom:firstNonEmpty |
|
1017 |
] |
|
1018 |
]. |
|
1019 |
] |
|
1020 |
]. |
|
1021 |
||
732 | 1022 |
collectionOfClassCategories := metaClass categories asSortedCollection. |
478 | 1023 |
collectionOfClassCategories size > 0 ifTrue:[ |
1024 |
collectionOfClassCategories := collectionOfClassCategories asOrderedCollection. |
|
1025 |
collectionOfClassCategories remove:'documentation' ifAbsent:nil. |
|
1026 |
]. |
|
732 | 1027 |
collectionOfCategories := aClass categories asSortedCollection. |
478 | 1028 |
collectionOfCategories size > 0 ifTrue:[ |
1029 |
collectionOfCategories := collectionOfCategories asOrderedCollection. |
|
1030 |
]. |
|
1031 |
||
1032 |
(aClass == Autoload or:[aClass == Object]) ifTrue:[ |
|
1033 |
subs := #() |
|
1034 |
] ifFalse:[ |
|
1035 |
subs := aClass subclasses |
|
1036 |
asOrderedCollection sort:[:a :b | a name < b name]. |
|
1037 |
]. |
|
1038 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1039 |
s nextPutLine:'<h1>'. |
478 | 1040 |
s nextPutAll:'Class: '; |
1249 | 1041 |
nextPutAll:'<a INFO="Open a Browser on ' , shortName , '" type="example" action="Smalltalk browseInClass:' , className , '">'; |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1042 |
nextPutAll:(shortName); nextPutLine:'</a>'. |
499 | 1043 |
|
1044 |
owner notNil ifTrue:[ |
|
1045 |
s nextPutAll:' (private in '; |
|
1249 | 1046 |
nextPutAll:'<a INFO="Open a Browser on ' , owner nameWithoutPrefix , '" type="example" action="Smalltalk browseInClass:' , owner name , '">'; |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1047 |
nextPutAll:(owner nameWithoutPrefix); nextPutLine:'</a>)'. |
523 | 1048 |
] ifFalse:[ |
1049 |
aClass nameSpace ~~ Smalltalk ifTrue:[ |
|
1050 |
s nextPutAll:' (in ' , aClass nameSpace name , ')' |
|
1051 |
] |
|
499 | 1052 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1053 |
s nextPutLine:'</h1>'. |
478 | 1054 |
|
499 | 1055 |
owner notNil ifTrue:[ |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1056 |
s nextPutLine:'This class is only visible from within'. |
1249 | 1057 |
s nextPutAll:owner nameWithoutPrefix. |
499 | 1058 |
owner owningClass notNil ifTrue:[ |
1249 | 1059 |
s nextPutAll:' (which is itself a private class of '. |
499 | 1060 |
s nextPutAll:owner owningClass nameWithoutPrefix. |
1249 | 1061 |
s nextPutAll:')' |
499 | 1062 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1063 |
s nextPutLine:'.' |
499 | 1064 |
]. |
1065 |
||
478 | 1066 |
"/ |
1067 |
"/ index |
|
1068 |
"/ |
|
1069 |
"/ s nextPutAll:'Index:'; cr. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1070 |
s nextPutLine:'<ul>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1071 |
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
|
1072 |
|
478 | 1073 |
docu notNil ifTrue:[ |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1074 |
s nextPutLine:'<li><a href="#DESCRIPTION" name="I_DESCRIPTION">Description</a>'. |
478 | 1075 |
]. |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1076 |
warnLines notNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1077 |
warnLines := warnLines asStringCollection. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1078 |
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
|
1079 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1080 |
hintLines notNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1081 |
hintLines := hintLines asStringCollection. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1082 |
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
|
1083 |
]. |
478 | 1084 |
|
1085 |
refLines notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1086 |
s nextPutLine:'<li><a href="#SEEALSO" name="I_SEEALSO">Related information</a>'. |
478 | 1087 |
]. |
1088 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1089 |
"/ 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
|
1090 |
"/ s nextPutLine:'<li><a href="#CLASSVARIABLES" name="I_CLASSVARIABLES">Class variables</a>'. |
478 | 1091 |
|
1092 |
collectionOfClassCategories size > 0 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1093 |
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
|
1094 |
s nextPutLine:'<ul>'. |
478 | 1095 |
collectionOfClassCategories sort do:[:cat | |
523 | 1096 |
s nextPutLine:'<li><a name="I_' , shortMetaName , '_category_' , cat , '"' , |
1097 |
' href="#' , shortMetaName , '_category_' , cat , |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1098 |
'">' , cat , '</a> '. |
478 | 1099 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1100 |
s nextPutLine:'</ul>'. |
478 | 1101 |
]. |
1102 |
collectionOfCategories size > 0 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1103 |
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
|
1104 |
s nextPutLine:'<ul>'. |
478 | 1105 |
collectionOfCategories sort do:[:cat | |
523 | 1106 |
s nextPutLine:'<li><a name="I_' , shortName , '_category_' , cat , '"' , |
1107 |
' href="#' , shortName , '_category_' , cat , |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1108 |
'">' , cat , '</a> '. |
478 | 1109 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1110 |
s nextPutLine:'</ul>'. |
478 | 1111 |
]. |
1112 |
||
499 | 1113 |
privateClasses size > 0 ifTrue:[ |
1114 |
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
|
1115 |
s nextPutLine:'<li><a href="#PRIVATECLASSES" name="I_PRIVATECLASSES">Private classes</a>'. |
499 | 1116 |
]. |
1117 |
||
478 | 1118 |
(aClass == Object or:[aClass == Autoload]) ifTrue:[ |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1119 |
s nextPutLine:'<li><a href="#SUBCLASSES" name="I_SUBCLASSES">Subclasses</a>'. |
478 | 1120 |
]. |
1121 |
demoLines notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1122 |
s nextPutLine:'<li><a href="#DEMOSTARTUP" name="I_DEMOSTARTUP">Demonstration</a>'. |
478 | 1123 |
]. |
1124 |
examples notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1125 |
s nextPutLine:'<li><a href="#EXAMPLES" name="I_EXAMPLES">Examples</a>'. |
478 | 1126 |
]. |
1249 | 1127 |
s nextPutLine:'</ul>'. |
1128 |
self generateHorizontalLine. |
|
478 | 1129 |
|
1130 |
"/ |
|
1131 |
"/ hierarchy |
|
1132 |
"/ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1133 |
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
|
1134 |
s nextPutLine:'<pre>'. |
478 | 1135 |
indent := 3. |
1136 |
first := true. |
|
1137 |
supers := aClass allSuperclasses. |
|
805 | 1138 |
(supers size > 0) ifTrue:[ |
637 | 1139 |
supers reverseDo:[:cls | |
1250 | 1140 |
|className| |
478 | 1141 |
|
1250 | 1142 |
className := cls name. |
478 | 1143 |
first ifFalse:[ |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1144 |
s spaces:indent; nextPutLine:'|'. |
478 | 1145 |
s spaces:indent; nextPutAll:'+--'. |
1146 |
indent := indent + 3. |
|
1147 |
] ifTrue:[ |
|
1148 |
s spaces:indent |
|
1149 |
]. |
|
1150 |
first := false. |
|
1151 |
||
1250 | 1152 |
self generateClassDocReferenceFor:className. |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
1153 |
s cr. |
478 | 1154 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1155 |
s spaces:indent; nextPutLine:'|'. |
478 | 1156 |
s spaces:indent. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1157 |
s nextPutAll:'+--<B>'; nextPutAll:className; nextPutLine:'</B>'. |
478 | 1158 |
indent := indent + 3. |
1159 |
] ifFalse:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1160 |
s spaces:indent; nextPutLine:'nil'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1161 |
s spaces:indent; nextPutLine:'|'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1162 |
s spaces:indent; nextPutAll:'+--<B>'; nextPutAll:className; nextPutLine:'</B>'. |
478 | 1163 |
aClass ~~ Object ifTrue:[ |
1164 |
s cr. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1165 |
s nextPutLine:' <B>This class inherits NOTHING - most messages will lead into doesNotUnderstand:</B>' |
478 | 1166 |
]. |
1167 |
indent := indent + 3. |
|
1168 |
]. |
|
1169 |
||
1170 |
subs notEmpty ifTrue:[ |
|
1171 |
subs do:[:aSubclass | |
|
1250 | 1172 |
|className| |
478 | 1173 |
|
1250 | 1174 |
className := aSubclass name. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1175 |
s spaces:indent; nextPutLine:'|'. |
478 | 1176 |
s spaces:indent; nextPutAll:'+--'. |
1250 | 1177 |
self generateClassDocReferenceFor:className. |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
1178 |
s cr. |
478 | 1179 |
] |
1180 |
] ifFalse:[ |
|
1181 |
aClass == Object ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1182 |
s spaces:indent; nextPutLine:'|'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1183 |
s spaces:indent; nextPutLine:'+-- ... almost every other class ...' |
478 | 1184 |
] |
1185 |
]. |
|
1186 |
||
1187 |
||
1249 | 1188 |
s nextPutLine:'</pre>'. |
1189 |
self generateHorizontalLine. |
|
478 | 1190 |
|
1191 |
"/ |
|
1192 |
"/ category, version & package |
|
1193 |
"/ |
|
1248 | 1194 |
aClass category notNil ifTrue:[ |
1195 |
s nextPutLine:'<dl>'. |
|
1196 |
s nextPutLine:'<dt><a name="CATEGORY"><b>Category:</b></A>'. |
|
1197 |
s nextPutLine:'<dd><b>', aClass category , '</b>'. |
|
1198 |
s nextPutLine:'</dl>'. |
|
1199 |
]. |
|
478 | 1200 |
|
499 | 1201 |
owner notNil ifTrue:[ |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1202 |
s nextPutLine:'<dl>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1203 |
s nextPutLine:'<dt><a name="OWNER"><b>Owner:</b></A>'. |
1250 | 1204 |
s nextPutAll:'<dd><b>'. |
1205 |
self generateClassDocReferenceFor:owner name. |
|
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
1206 |
s cr. |
1250 | 1207 |
"/ s nextPutLine:(self |
1208 |
"/ anchorForHTMLDocAction: |
|
1209 |
"/ ('htmlDocOf:', owner name ) |
|
1210 |
"/ info: |
|
1211 |
"/ ( 'Show documentation of ' , owner nameWithoutPrefix ) |
|
1212 |
"/ text: |
|
1213 |
"/ owner nameWithoutPrefix). |
|
1214 |
s nextPutLine:'</b>'. |
|
499 | 1215 |
] ifFalse:[ |
530
d27016ae003f
try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents:
528
diff
changeset
|
1216 |
self htmlRevisionDocOf:aClass to:s. |
478 | 1217 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1218 |
s nextPutLine:'</dl>'. |
478 | 1219 |
|
1220 |
authorLines notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1221 |
s nextPutLine:'<dl><dt><a name="AUTHOR"><b>Author:</b></A>'. |
478 | 1222 |
authorLines do:[:l| |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1223 |
s nextPutLine:'<dd><b>', l , '</b>'. |
478 | 1224 |
]. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1225 |
s nextPutLine:'</dl>'. |
478 | 1226 |
]. |
1227 |
||
1249 | 1228 |
self generateHorizontalLine. |
478 | 1229 |
|
1230 |
docu notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1231 |
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
|
1232 |
s nextPutLine:'<BR>'. |
478 | 1233 |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1234 |
s nextPutLine:'<pre>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1235 |
s nextPutLine:docu. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1236 |
s nextPutLine:'</pre>'. |
1249 | 1237 |
self generateHorizontalLine. |
478 | 1238 |
]. |
1239 |
||
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1240 |
warnLines notNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1241 |
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
|
1242 |
s nextPutLine:'<BR>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1243 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1244 |
s nextPutLine:'<pre>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1245 |
firstIndent := warnLines first leftIndent. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1246 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1247 |
warnLines do:[:aLine | |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1248 |
aLine leftIndent >= firstIndent ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1249 |
s nextPutLine:(aLine copyFrom:firstIndent+1) |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1250 |
] ifFalse:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1251 |
s nextPutLine:aLine |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1252 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1253 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1254 |
s nextPutLine:'</pre>'. |
1249 | 1255 |
self generateHorizontalLine. |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1256 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1257 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1258 |
hintLines notNil ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1259 |
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
|
1260 |
s nextPutLine:'<BR>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1261 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1262 |
s nextPutLine:'<pre>'. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1263 |
firstIndent := hintLines first leftIndent. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1264 |
|
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1265 |
hintLines do:[:aLine | |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1266 |
aLine leftIndent >= firstIndent ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1267 |
s nextPutLine:(aLine copyFrom:firstIndent+1) |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1268 |
] ifFalse:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1269 |
s nextPutLine:aLine |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1270 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1271 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1272 |
s nextPutLine:'</pre>'. |
1249 | 1273 |
self generateHorizontalLine. |
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1274 |
]. |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
1275 |
|
478 | 1276 |
"/ |
1277 |
"/ see also |
|
1278 |
"/ |
|
1279 |
refLines notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1280 |
s nextPutLine:'<h2><a name="SEEALSO" href="#I_SEEALSO">Related information:</A></h2>'. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1281 |
self generateRefLines:refLines forClass:aClass on:s. |
1249 | 1282 |
self generateHorizontalLine. |
478 | 1283 |
]. |
1284 |
||
1285 |
||
1286 |
"/ |
|
1287 |
"/ inst & classVars |
|
1288 |
"/ to be added |
|
1289 |
||
1290 |
||
1291 |
"/ |
|
1292 |
"/ protocol |
|
1293 |
"/ |
|
1294 |
self printOutHTMLProtocolOf:aClass on:s. |
|
1295 |
||
1296 |
"/ |
|
1297 |
"/ subclasses (only for Object and Autoload) |
|
1298 |
"/ |
|
1299 |
(aClass == Object or:[aClass == Autoload]) ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1300 |
s nextPutLine:'<h2><a name="SUBCLASSES" href="#I_SUBCLASSES">Subclasses (direct subclasses only):</A></h2>'. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1301 |
self generateSubclassInfoFor:aClass on:s. |
1249 | 1302 |
self generateHorizontalLine. |
478 | 1303 |
]. |
1304 |
||
1305 |
"/ |
|
499 | 1306 |
"/ private classes |
1307 |
"/ |
|
1308 |
privateClasses size > 0 ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1309 |
s nextPutLine:'<h2><a name="PRIVATECLASSES" href="#I_PRIVATECLASSES">Private classes:</A></h2>'. |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
1310 |
self generatePrivateClassInfoFor:aClass with:privateClasses on:s. |
1249 | 1311 |
self generateHorizontalLine. |
499 | 1312 |
]. |
1313 |
||
1314 |
"/ |
|
478 | 1315 |
"/ demonstration |
1316 |
"/ |
|
1317 |
demoLines notNil ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1318 |
s nextPutLine:'<h2><a name="DEMOSTARTUP" href="#I_DEMOSTARTUP">Demonstration:</A></h2>'. |
478 | 1319 |
demoLines do:[:l | |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1320 |
s nextPutLine:'<a INFO="demonstration" type="example">'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1321 |
s nextPutLine:'<code><pre>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1322 |
s nextPutLine:' ' , l withoutSeparators. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1323 |
s nextPutLine:'</pre></code>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1324 |
s nextPutLine:'</a>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1325 |
s nextPutLine:'<br>'. |
478 | 1326 |
]. |
1249 | 1327 |
self generateHorizontalLine. |
478 | 1328 |
]. |
1329 |
||
1330 |
"/ |
|
1331 |
"/ add examples if there are any |
|
1332 |
"/ |
|
1333 |
examples notNil ifTrue:[ |
|
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1334 |
self generateExamples:examples. |
478 | 1335 |
]. |
1336 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1337 |
self generateBODYandHTMLEnd. |
478 | 1338 |
|
1339 |
wasLoaded ifFalse:[ |
|
1340 |
aClass unload |
|
1341 |
]. |
|
1342 |
||
1343 |
^ s contents |
|
1344 |
||
1345 |
" |
|
1346 |
self htmlDocOf:Object |
|
1347 |
self htmlDocOf:Array |
|
1348 |
self htmlDocOf:Filename |
|
1349 |
self htmlDocOf:Block |
|
1350 |
" |
|
1351 |
||
632 | 1352 |
"Created: / 24.4.1996 / 15:01:59 / cg" |
732 | 1353 |
"Modified: / 25.11.1998 / 12:40:51 / cg" |
478 | 1354 |
! |
1355 |
||
1356 |
htmlDocOf:aClass backRef:backRef |
|
632 | 1357 |
"generate an HTML document string which contains a classes documentation" |
1358 |
||
478 | 1359 |
^ self htmlDocOf:aClass back:nil backRef:backRef |
1360 |
||
632 | 1361 |
"Created: / 24.4.1996 / 15:03:25 / cg" |
1362 |
"Modified: / 30.10.1997 / 13:23:12 / cg" |
|
478 | 1363 |
! |
1364 |
||
1365 |
htmlDocOfImplementorsOf:selector |
|
632 | 1366 |
"generate an HTML document string which contains HREFS |
1367 |
to all implementors of a particular selector" |
|
1368 |
||
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1369 |
|sel s classes| |
478 | 1370 |
|
1249 | 1371 |
sel := self withSpecialHTMLCharactersEscaped:selector. |
478 | 1372 |
|
1249 | 1373 |
outStream := s := '' writeStream. |
478 | 1374 |
|
1249 | 1375 |
self generateHTMLHeadWithTitle:('Implementations of: ' , sel). |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1376 |
self generateBODYStart. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1377 |
|
1249 | 1378 |
self generateUpArrowButtonForTop. |
1379 |
self generateHorizontalLine. |
|
1380 |
self generateH1:sel. |
|
478 | 1381 |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1382 |
s nextPutLine:'<dl>'. |
478 | 1383 |
|
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1384 |
classes := IdentitySet new. |
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1385 |
|
478 | 1386 |
sel := selector asSymbol. |
1249 | 1387 |
Smalltalk allClassesAndMetaclassesDo:[:cls | |
499 | 1388 |
cls isPrivate ifFalse:[ |
1138
aa7687ec256f
implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents:
917
diff
changeset
|
1389 |
(cls includesSelector:sel) ifTrue:[ |
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1390 |
classes add:cls |
499 | 1391 |
] |
478 | 1392 |
] |
1393 |
]. |
|
1394 |
||
1249 | 1395 |
(classes asOrderedCollection sort:[:a :b | a name < b name]) |
1396 |
do:[:cls | |
|
1397 |
self |
|
1398 |
printOutHTMLMethodProtocol:(cls compiledMethodAt:sel) |
|
1399 |
on:s |
|
1400 |
showClassName:true |
|
1401 |
classRef:true. |
|
1402 |
s nextPutLine:'<p>'. |
|
1403 |
]. |
|
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1404 |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1405 |
s nextPutLine:'</dl>'. |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1406 |
self generateBODYandHTMLEnd. |
478 | 1407 |
|
1408 |
^ s contents |
|
1409 |
||
632 | 1410 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
727
1729dca2ab7a
sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents:
650
diff
changeset
|
1411 |
"Modified: / 30.10.1998 / 22:15:30 / cg" |
478 | 1412 |
! |
1413 |
||
1435 | 1414 |
htmlDocOfImplementorsOfAnyMatching:selectorPattern |
1415 |
"generate an HTML document string which contains HREFS |
|
1416 |
to all implementors of a particular selector" |
|
1417 |
||
1418 |
|s sel classes| |
|
1419 |
||
1420 |
outStream := s := '' writeStream. |
|
1421 |
||
1422 |
sel := self withSpecialHTMLCharactersEscaped:selectorPattern. |
|
1423 |
self generateHTMLHeadWithTitle:('Implementations of: ' , sel). |
|
1424 |
self generateBODYStart. |
|
1425 |
||
1426 |
self generateUpArrowButtonForTop. |
|
1427 |
self generateHorizontalLine. |
|
1428 |
||
1429 |
self generateH1:sel. |
|
1430 |
||
1431 |
s nextPutLine:'<dl>'. |
|
1432 |
||
1433 |
classes := IdentitySet new. |
|
1434 |
||
1435 |
Smalltalk allClassesAndMetaclassesDo:[:cls | |
|
1436 |
cls isPrivate ifFalse:[ |
|
1437 |
(cls methodDictionary keys contains:[:sel | selectorPattern match:sel]) ifTrue:[ |
|
1438 |
classes add:cls |
|
1439 |
] |
|
1440 |
] |
|
1441 |
]. |
|
1442 |
||
1443 |
(classes asOrderedCollection sort:[:a :b | a name < b name]) |
|
1444 |
do:[:cls | |
|
1445 |
cls methodDictionary keys do:[:eachSel | |
|
1446 |
(selectorPattern match:eachSel) ifTrue:[ |
|
1447 |
self |
|
1448 |
printOutHTMLMethodProtocol:(cls compiledMethodAt:eachSel) |
|
1449 |
on:s |
|
1450 |
showClassName:true |
|
1451 |
classRef:true. |
|
1452 |
s nextPutLine:'<p>'. |
|
1453 |
]. |
|
1454 |
]. |
|
1455 |
]. |
|
1456 |
||
1457 |
s nextPutLine:'</dl>'. |
|
1458 |
self generateBODYandHTMLEnd. |
|
1459 |
||
1460 |
^ s contents |
|
1461 |
! |
|
1462 |
||
478 | 1463 |
htmlSelectorList |
632 | 1464 |
"generate an HTML string for all selectors (for which methods exist) |
1465 |
in the system" |
|
1466 |
||
478 | 1467 |
|selectors| |
1468 |
||
1469 |
selectors := IdentitySet new. |
|
1249 | 1470 |
Smalltalk allClassesAndMetaclassesDo:[:cls | |
1471 |
selectors addAll:cls selectors. |
|
478 | 1472 |
]. |
1473 |
selectors := selectors asOrderedCollection sort. |
|
1474 |
||
1249 | 1475 |
^ self |
1476 |
htmlSelectors:selectors |
|
1477 |
title:('All Selectors:'). |
|
478 | 1478 |
|
1479 |
" |
|
1480 |
self htmlSelectorList |
|
1481 |
" |
|
1482 |
||
632 | 1483 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
1484 |
"Modified: / 5.6.1996 / 12:27:09 / stefan" |
|
1485 |
"Modified: / 30.10.1997 / 13:25:19 / cg" |
|
478 | 1486 |
! |
1487 |
||
1488 |
htmlSelectorListMatching:pattern |
|
632 | 1489 |
"generate an HTML string for all selectors which match a pattern |
1490 |
(and for which methods exist) in the system" |
|
1491 |
||
478 | 1492 |
|selectors| |
1493 |
||
1494 |
selectors := IdentitySet new. |
|
1249 | 1495 |
Smalltalk allClassesAndMetaclassesDo:[:cls | |
478 | 1496 |
cls methodDictionary keysDo:[:sel | |
1497 |
(pattern match:sel) ifTrue:[ |
|
1498 |
selectors add:sel. |
|
1499 |
] |
|
1500 |
] |
|
1501 |
]. |
|
1502 |
selectors := selectors asOrderedCollection sort. |
|
1503 |
||
1249 | 1504 |
^ self |
1505 |
htmlSelectors:selectors |
|
1506 |
title:('Selectors matching ''' , pattern , ''':'). |
|
478 | 1507 |
|
1508 |
" |
|
1509 |
self htmlSelectorListMatching:'*do*' |
|
1510 |
" |
|
1511 |
||
632 | 1512 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
1513 |
"Modified: / 5.6.1996 / 12:29:27 / stefan" |
|
1514 |
"Modified: / 30.10.1997 / 13:25:50 / cg" |
|
478 | 1515 |
! |
1516 |
||
1517 |
htmlSelectorListPrefix:prefix |
|
632 | 1518 |
"generate an HTML string for all selectors whose names starts with |
1519 |
a prefix (and for which methods exist) in the system" |
|
1520 |
||
478 | 1521 |
|selectors| |
1522 |
||
1523 |
selectors := IdentitySet new. |
|
1249 | 1524 |
Smalltalk allClassesAndMetaclassesDo:[:cls | |
478 | 1525 |
cls methodDictionary keysDo:[:sel | |
1526 |
(sel startsWith:prefix) ifTrue:[ |
|
1527 |
selectors add:sel. |
|
1528 |
] |
|
1529 |
] |
|
1530 |
]. |
|
1531 |
selectors := selectors asOrderedCollection sort. |
|
1532 |
||
1249 | 1533 |
^ self |
1534 |
htmlSelectors:selectors |
|
1535 |
title:('Selectors starting with ''' , prefix asString , ''':'). |
|
478 | 1536 |
|
1537 |
" |
|
1538 |
self htmlSelectorListPrefix:'a' |
|
1539 |
" |
|
1540 |
||
632 | 1541 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
1542 |
"Modified: / 5.6.1996 / 12:31:13 / stefan" |
|
1543 |
"Modified: / 30.10.1997 / 13:26:15 / cg" |
|
478 | 1544 |
! |
1545 |
||
1546 |
htmlSelectors:selectors title:title |
|
632 | 1547 |
"generate an HTML string for a given list of selectors" |
1548 |
||
492 | 1549 |
|s| |
478 | 1550 |
|
1249 | 1551 |
s := outStream := '' writeStream. |
478 | 1552 |
|
1249 | 1553 |
self generateHTMLHeadWithTitle:title. |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1554 |
self generateBODYStart. |
478 | 1555 |
|
1249 | 1556 |
self generateUpArrowButtonForTop. |
1557 |
self generateHorizontalLine. |
|
1558 |
self generateH1:title. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1559 |
s nextPutLine:'<ul>'. |
478 | 1560 |
|
1561 |
selectors do:[:sel | |
|
1249 | 1562 |
|selString| |
478 | 1563 |
|
1249 | 1564 |
selString := self withSpecialHTMLCharactersEscaped:sel. |
1565 |
s nextPutAll:'<li>'. |
|
1566 |
s nextPutLine:(self |
|
1567 |
anchorForHTMLDocAction: |
|
1568 |
('htmlDocOfImplementorsOf:''' , selString , '''' ) |
|
1569 |
info: |
|
1570 |
('Implementors of: ' , selString) |
|
1571 |
text: |
|
1572 |
selString). |
|
478 | 1573 |
]. |
1574 |
||
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1575 |
s nextPutLine:'</ul>'. |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
1576 |
self generateBODYandHTMLEnd. |
478 | 1577 |
|
1578 |
^ s contents |
|
1579 |
||
632 | 1580 |
"Created: / 22.4.1996 / 20:03:31 / cg" |
1581 |
"Modified: / 30.10.1997 / 13:26:34 / cg" |
|
1251 | 1582 |
! ! |
1583 |
||
1280 | 1584 |
!HTMLDocGenerator methodsFor:'document generation-helpers'! |
1251 | 1585 |
|
1586 |
htmlRevisionDocOf:aClass to:s |
|
1587 |
"extract a classes versionInfo and return an HTML document string |
|
1588 |
for that." |
|
1589 |
||
1590 |
|revInfo pckgInfo text path| |
|
1591 |
||
1592 |
revInfo := aClass revisionInfo. |
|
1593 |
pckgInfo := aClass packageSourceCodeInfo. |
|
1594 |
||
1595 |
s nextPutLine:'<dl><dt><a name="VERSION"><b>Version:</b></A>'. |
|
1596 |
||
1597 |
(revInfo isNil and:[pckgInfo isNil]) ifTrue:[ |
|
1598 |
s nextPutLine:'<dd>no revision info'. |
|
1599 |
] ifFalse:[ |
|
1600 |
||
1601 |
revInfo isNil ifTrue:[revInfo := IdentityDictionary new]. |
|
1602 |
pckgInfo isNil ifTrue:[pckgInfo := IdentityDictionary new]. |
|
1603 |
||
1604 |
s nextPutLine:'<dd>rev: <b>'. |
|
1605 |
||
1606 |
"/ fetch the revision-info; prefer revisionInfo |
|
1607 |
text := revInfo at:#revision ifAbsent:(pckgInfo at:#revision ifAbsent:'?'). |
|
1608 |
s nextPutLine:text. |
|
1609 |
||
1610 |
"/ fetch the date & time; prefer revisionInfo |
|
1611 |
text := revInfo at:#date ifAbsent:(pckgInfo at:#date ifAbsent:'?'). |
|
1612 |
s nextPutAll:'</b> date: <b>' , text. |
|
1613 |
text := revInfo at:#time ifAbsent:(pckgInfo at:#time ifAbsent:'?'). |
|
1614 |
s nextPutLine:' ', text , '</b>'. |
|
1615 |
||
1616 |
text := revInfo at:#user ifAbsent:(pckgInfo at:#user ifAbsent:'?'). |
|
1617 |
s nextPutLine:'<dd>user: <b>' , text , '</b>'. |
|
1618 |
||
1619 |
text := revInfo at:#fileName ifAbsent:(pckgInfo at:#fileNamer ifAbsent:'?'). |
|
1620 |
s nextPutAll:'<dd>file: <b>' , text. |
|
1621 |
||
1622 |
text := revInfo at:#directory ifAbsent:(pckgInfo at:#directory ifAbsent:nil). |
|
1623 |
text isNil ifTrue:[ |
|
1624 |
path := revInfo at:#repositoryPathName ifAbsent:(pckgInfo at:#repositoryPathName ifAbsent:nil). |
|
1625 |
path notNil ifTrue:[ |
|
1626 |
SourceCodeManager notNil ifTrue:[ |
|
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
1627 |
text := SourceCodeManager directoryFromContainerPath:path forClass:aClass. |
1251 | 1628 |
]. |
1629 |
text isNil ifTrue:[text := '?']. |
|
1630 |
] ifFalse:[ |
|
1631 |
text := '?' |
|
1632 |
] |
|
1633 |
]. |
|
1634 |
s nextPutLine:'</b> directory: <b>' , text , '</b>'. |
|
1635 |
||
1636 |
text := revInfo at:#module ifAbsent:(pckgInfo at:#module ifAbsent:nil). |
|
1637 |
text isNil ifTrue:[ |
|
1638 |
path := revInfo at:#repositoryPathName ifAbsent:(pckgInfo at:#repositoryPathName ifAbsent:nil). |
|
1639 |
path notNil ifTrue:[ |
|
1640 |
SourceCodeManager notNil ifTrue:[ |
|
1346
8657706d79ba
generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
1641 |
text := SourceCodeManager moduleFromContainerPath:path forClass:aClass. |
1251 | 1642 |
]. |
1643 |
text isNil ifTrue:[text := '?']. |
|
1644 |
] ifFalse:[ |
|
1645 |
text := '?' |
|
1646 |
] |
|
1647 |
]. |
|
1648 |
s nextPutAll:'<dd>module: <b>' , text. |
|
1649 |
||
1650 |
text := revInfo at:#library ifAbsent:(pckgInfo at:#library ifAbsent:'*none*'). |
|
1651 |
s nextPutLine:'</b> stc-classLibrary: <b>' , text , '</b>'. |
|
1652 |
]. |
|
1653 |
||
1654 |
"Created: / 8.1.1997 / 13:43:28 / cg" |
|
1655 |
"Modified: / 30.10.1997 / 13:24:39 / cg" |
|
478 | 1656 |
! |
1657 |
||
1658 |
printOutHTMLCategoryProtocol:aCategory of:aClass on:aStream |
|
632 | 1659 |
"append documentation on each method in a particular methodCategory |
1660 |
of the given class in HTML onto aStream." |
|
1661 |
||
523 | 1662 |
|any dict selectors methods shortName| |
1663 |
||
1664 |
shortName := aClass nameWithoutPrefix. |
|
478 | 1665 |
|
1666 |
dict := aClass methodDictionary. |
|
1667 |
||
1668 |
dict notNil ifTrue:[ |
|
1669 |
any := false. |
|
1670 |
dict do:[:aMethod | |
|
1671 |
(aCategory = aMethod category) ifTrue:[ |
|
1672 |
any := true |
|
1673 |
] |
|
1674 |
]. |
|
1675 |
||
1676 |
any ifTrue:[ |
|
523 | 1677 |
aStream nextPutLine:'<a name="' , shortName , '_category_' , aCategory , |
1678 |
'" href="#I_' , shortName , '_category_' , aCategory , |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1679 |
'"><b>' , aCategory , '</b></A>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1680 |
aStream nextPutLine:'<dl>'. |
478 | 1681 |
|
1682 |
selectors := dict keys asArray. |
|
1683 |
methods := dict values. |
|
1684 |
selectors sortWith:methods. |
|
1685 |
methods do:[:aMethod | |
|
1686 |
(aCategory = aMethod category) ifTrue:[ |
|
1216
b854fdc89d2a
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
1178
diff
changeset
|
1687 |
Error catch:[ |
478 | 1688 |
self printOutHTMLMethodProtocol:aMethod on:aStream. |
1689 |
]. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1690 |
aStream nextPutLine:'<p>'. |
478 | 1691 |
] |
1692 |
]. |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1693 |
aStream nextPutLine:'</dl>'. |
478 | 1694 |
] |
1695 |
] |
|
1696 |
||
1697 |
" |
|
1698 |
self printOutHTMLProtocolOf:Float on:Stdout |
|
1699 |
" |
|
1700 |
||
632 | 1701 |
"Created: / 22.4.1996 / 20:03:30 / cg" |
1702 |
"Modified: / 5.6.1996 / 13:41:27 / stefan" |
|
1703 |
"Modified: / 30.10.1997 / 13:27:58 / cg" |
|
478 | 1704 |
! |
1705 |
||
1706 |
printOutHTMLMethodProtocol:aMethod on:aStream |
|
1707 |
"given the source in aString, print the methods message specification |
|
1708 |
and any method comments - without source; used to generate documentation |
|
1709 |
pages" |
|
1710 |
||
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1711 |
^ self |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1712 |
printOutHTMLMethodProtocol:aMethod |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1713 |
on:aStream |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1714 |
showClassName:false |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1715 |
classRef:false |
478 | 1716 |
|
1717 |
"Modified: 22.4.1996 / 18:01:56 / cg" |
|
1718 |
"Created: 22.4.1996 / 20:03:30 / cg" |
|
1719 |
! |
|
1720 |
||
1721 |
printOutHTMLMethodProtocol:aMethod on:aStream showClassName:showClassName classRef:withClassRef |
|
1722 |
"given the source in aString, print the methods message specification |
|
1723 |
and any method comments - without source; used to generate documentation |
|
1724 |
pages" |
|
1725 |
||
1344 | 1726 |
|p| |
1727 |
||
1728 |
"/ p := imagePath. |
|
1729 |
"/ p isNil ifTrue:[ |
|
1730 |
"/ p := self pathToTopOfDocumentation , '/icons' |
|
1731 |
"/ ]. |
|
1732 |
p := self pathToTopOfDocumentation , '/pictures'. |
|
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1733 |
^ self |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1734 |
printOutHTMLMethodProtocol:aMethod |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1735 |
on:aStream |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1736 |
showClassName:showClassName |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1737 |
classRef:withClassRef |
1344 | 1738 |
picturePath:p |
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1739 |
! |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1740 |
|
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1741 |
printOutHTMLMethodProtocol:aMethod on:aStream showClassName:showClassName classRef:withClassRef picturePath:picturePath |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1742 |
"given the source in aString, print the methods message specification |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1743 |
and any method comments - without source; used to generate documentation |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1744 |
pages" |
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1745 |
|
1249 | 1746 |
|comment cls sel partStream args argStream who methodSpecLine |
478 | 1747 |
firstIndent firstNonEmpty isSubres isObsolete smallOrEmpty |
1400 | 1748 |
ballColor anchorName parseTree expr obsoleteInfo| |
478 | 1749 |
|
1750 |
who := aMethod who. |
|
505
d8d7556d05ee
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1751 |
cls := who methodClass. |
d8d7556d05ee
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
500
diff
changeset
|
1752 |
sel := who methodSelector. |
478 | 1753 |
partStream := sel keywords readStream. |
1754 |
||
1755 |
(args := aMethod methodArgNames) notNil ifTrue:[ |
|
1756 |
argStream := aMethod methodArgNames readStream. |
|
1757 |
||
1249 | 1758 |
methodSpecLine := ''. |
478 | 1759 |
1 to:sel numArgs do:[:index | |
1249 | 1760 |
methodSpecLine size > 0 ifTrue:[ |
478 | 1761 |
methodSpecLine := methodSpecLine , ' ' |
1762 |
]. |
|
1763 |
methodSpecLine := methodSpecLine , '<B>' , partStream next , '</B>'. |
|
1764 |
methodSpecLine := methodSpecLine , ' <I>' , argStream next , '</I>'. |
|
1765 |
]. |
|
1766 |
] ifFalse:[ |
|
1767 |
methodSpecLine := '<B>' , partStream next , '</B>' |
|
1768 |
]. |
|
1769 |
||
632 | 1770 |
"/ use string-asSymbol (instead of the obvious symbol itself) |
1771 |
"/ in the checks below, to avoid tricking myself, |
|
1772 |
"/ when the documentation on this method is generated |
|
1773 |
"/ (otherwise, I'll say that this method is both |
|
1774 |
"/ a subres and and obsolete method ...) |
|
1775 |
||
1360 | 1776 |
isSubres := (aMethod sends:#'subclassResponsibility'). |
478 | 1777 |
|
1778 |
isObsolete := false. |
|
632 | 1779 |
((aMethod sends:'obsoleteMethodWarning' asSymbol) |
1780 |
or:[(aMethod sends:'obsoleteMethodWarning:' asSymbol) |
|
1781 |
or:[(aMethod sends:'obsoleteMethodWarning:from:' asSymbol)]]) ifTrue:[ |
|
1400 | 1782 |
(sel startsWith:'obsoleteMethodWarning') ifFalse:[ |
1783 |
true "cls ~~ Object" ifTrue:[ |
|
1784 |
isObsolete := true. |
|
1785 |
ParseTreeSearcher notNil ifTrue:[ |
|
1786 |
parseTree := cls parseTreeFor:sel. |
|
1787 |
parseTree notNil ifTrue: [ |
|
1788 |
expr := ParseTreeSearcher treeMatching:'`@e1 obsoleteMethodWarning:`@e2' in: parseTree. |
|
1789 |
expr isNil ifTrue:[ |
|
1790 |
expr := ParseTreeSearcher treeMatching:'`@e1 obsoleteMethodWarning:`@e2 from:`@e3' in: parseTree. |
|
1791 |
]. |
|
1792 |
expr notNil ifTrue:[ |
|
1793 |
|arg1| |
|
1794 |
||
1795 |
arg1 := expr arguments first. |
|
1796 |
arg1 isLiteral ifTrue:[ |
|
1797 |
arg1 value isString ifTrue:[ |
|
1798 |
obsoleteInfo := arg1 value. |
|
1799 |
]. |
|
1800 |
]. |
|
1801 |
]. |
|
1802 |
]. |
|
1803 |
]. |
|
1804 |
]. |
|
478 | 1805 |
] |
1806 |
]. |
|
1807 |
||
1808 |
smallOrEmpty := ''. |
|
1809 |
aMethod isPrivate ifTrue:[ |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1810 |
methodSpecLine := '<i>private</i> ' , methodSpecLine. |
478 | 1811 |
"/ smallOrEmpty := '-small'. |
1812 |
] ifFalse:[ |
|
1813 |
aMethod isProtected ifTrue:[ |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1814 |
methodSpecLine := '<i>protected</i> ' , methodSpecLine. |
478 | 1815 |
"/ smallOrEmpty := '-small'. |
1816 |
] ifFalse:[ |
|
1817 |
aMethod isIgnored ifTrue:[ |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1818 |
methodSpecLine := '[ ' , methodSpecLine , ' ] (<i>invisible</i>)'. |
478 | 1819 |
"/ smallOrEmpty := '-small'. |
1820 |
] |
|
1821 |
] |
|
1822 |
]. |
|
1823 |
||
632 | 1824 |
aStream nextPutLine:'<DT>'. |
478 | 1825 |
|
1826 |
||
1827 |
cls isMeta ifTrue:[ |
|
1828 |
ballColor := 'yellow' |
|
1829 |
] ifFalse:[ |
|
1830 |
ballColor := 'red' |
|
1831 |
]. |
|
1832 |
||
907
1a6b647d1b43
picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
1833 |
aStream nextPutLine:'<IMG src="' , picturePath , '/' , ballColor , '-ball' , smallOrEmpty , '.gif" alt="o " width=6 height=6>'. |
1335 | 1834 |
aStream nextPutAll:' '. |
478 | 1835 |
|
1249 | 1836 |
sel := self withSpecialHTMLCharactersEscaped:sel. |
1837 |
anchorName := cls name , '_' , sel. |
|
478 | 1838 |
|
1839 |
withClassRef ifTrue:[ |
|
1250 | 1840 |
aStream nextPutAll:(self |
1841 |
anchorForHTMLDocAction: |
|
1842 |
('htmlDocOf:', cls theNonMetaclass name ) |
|
1843 |
info: |
|
1844 |
('Show documentation of ' , cls theNonMetaclass name ) |
|
1845 |
text: |
|
1846 |
cls name |
|
1847 |
name:anchorName). |
|
1848 |
aStream nextPutLine:' ' , methodSpecLine. |
|
478 | 1849 |
] ifFalse:[ |
1850 |
showClassName ifTrue:[ |
|
1851 |
methodSpecLine := cls name , ' ' , methodSpecLine |
|
1852 |
]. |
|
1853 |
||
1249 | 1854 |
aStream nextPutLine:'<a name="' , anchorName , '" ' , |
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1855 |
"/ 'href="' , cls name , '_' , sel , '"' , |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1856 |
'>' , methodSpecLine , '</a>'. |
478 | 1857 |
]. |
632 | 1858 |
aStream nextPutLine:'<DD>'. |
478 | 1859 |
|
1308
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
1860 |
(comment := self methodCommentOf:aMethod) notNil ifTrue:[ |
1249 | 1861 |
comment := self withSpecialHTMLCharactersEscaped:comment. |
478 | 1862 |
|
1863 |
comment notEmpty ifTrue:[ |
|
1864 |
comment := comment asStringCollection. |
|
1865 |
firstIndent := comment first leftIndent. |
|
1866 |
firstIndent > 0 ifTrue:[ |
|
1867 |
comment := comment collect:[:line | |
|
1868 |
line leftIndent >= firstIndent ifTrue:[ |
|
1869 |
line copyFrom:firstIndent. |
|
1870 |
] ifFalse:[ |
|
1871 |
line |
|
1872 |
] |
|
1873 |
]. |
|
1874 |
]. |
|
1875 |
firstNonEmpty := comment findFirst:[:line | line notEmpty]. |
|
1876 |
firstNonEmpty > 1 ifTrue:[ |
|
1877 |
comment := comment copyFrom:firstNonEmpty |
|
1878 |
]. |
|
1879 |
comment := comment asString. |
|
1880 |
]. |
|
1881 |
||
1882 |
comment asStringCollection do:[:line | |
|
1178 | 1883 |
aStream |
1884 |
"/ nextPutAll:'<I>'; |
|
1885 |
nextPutAll:line; |
|
1886 |
"/ nextPutAll:'</I>'; |
|
1887 |
nextPutLine:'<BR>'. |
|
478 | 1888 |
]. |
1889 |
]. |
|
1890 |
||
1891 |
isSubres ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1892 |
aStream nextPutLine:'<BR>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1893 |
aStream nextPutLine:'<I>** This method raises an error - it must be redefined in concrete classes **</I>'. |
478 | 1894 |
]. |
1895 |
isObsolete ifTrue:[ |
|
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1896 |
aStream nextPutLine:'<BR>'. |
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1897 |
aStream nextPutLine:'<I>** This is an obsolete interface - do not use it (it may vanish in future versions) **</I>'. |
1400 | 1898 |
obsoleteInfo notNil ifTrue:[ |
1899 |
aStream nextPutLine:'<BR>'. |
|
1900 |
aStream nextPutLine:'<I>** ' , obsoleteInfo , ' **</I>'. |
|
1901 |
]. |
|
478 | 1902 |
]. |
1903 |
||
632 | 1904 |
"Created: / 22.4.1996 / 20:03:30 / cg" |
1905 |
"Modified: / 30.10.1997 / 13:09:45 / cg" |
|
478 | 1906 |
! |
1907 |
||
1908 |
printOutHTMLProtocolOf:aClass on:aStream |
|
632 | 1909 |
"append documentation of the given class in HTML onto aStream." |
1910 |
||
478 | 1911 |
|collectionOfCategories any| |
1912 |
||
1913 |
"/ self printOutDefinitionOn:aPrintStream. |
|
1914 |
||
732 | 1915 |
collectionOfCategories := aClass class categories asSortedCollection. |
478 | 1916 |
any := false. |
523 | 1917 |
|
1918 |
collectionOfCategories size > 0 ifTrue:[ |
|
1919 |
collectionOfCategories := collectionOfCategories asOrderedCollection. |
|
1920 |
collectionOfCategories remove:'documentation' ifAbsent:[]. |
|
1921 |
collectionOfCategories size > 0 ifTrue:[ |
|
1922 |
collectionOfCategories sort. |
|
642
077371c28483
oops - missing trailing dQuotes - html output failed on netscape
dq
parents:
637
diff
changeset
|
1923 |
aStream nextPutLine:'<h2><a name="CLASSPROTOCOL" href="#I_CLASSPROTOCOL">Class protocol:</a></h2>'. |
523 | 1924 |
collectionOfCategories do:[:aCategory | |
478 | 1925 |
self printOutHTMLCategoryProtocol:aCategory of:aClass class on:aStream. |
1926 |
any := true. |
|
523 | 1927 |
]. |
478 | 1928 |
"/ any ifFalse:[ |
1929 |
"/ aStream nextPutAll:'no new protocol' |
|
1930 |
"/ ]. |
|
1249 | 1931 |
self generateHorizontalLine. |
523 | 1932 |
] |
478 | 1933 |
]. |
1934 |
||
1935 |
||
732 | 1936 |
collectionOfCategories := aClass categories asSortedCollection. |
478 | 1937 |
any := false. |
523 | 1938 |
collectionOfCategories size > 0 ifTrue:[ |
478 | 1939 |
collectionOfCategories := collectionOfCategories asOrderedCollection sort. |
511
ef2631a2cc1c
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
505
diff
changeset
|
1940 |
aStream nextPutLine:'<h2><a name="INSTANCEPROTOCOL" href="#I_INSTANCEPROTOCOL">Instance protocol:</A></h2>'. |
478 | 1941 |
collectionOfCategories do:[:aCategory | |
1942 |
self printOutHTMLCategoryProtocol:aCategory of:aClass on:aStream |
|
1943 |
]. |
|
1944 |
"/ any ifFalse:[ |
|
1945 |
"/ aStream nextPutAll:'no new protocol' |
|
1946 |
"/ ]. |
|
1249 | 1947 |
self generateHorizontalLine. |
478 | 1948 |
] |
1949 |
||
1950 |
" |
|
1951 |
self printOutHTMLProtocolOf:Float on:Stdout |
|
1952 |
" |
|
1953 |
||
632 | 1954 |
"Created: / 22.4.1996 / 20:03:30 / cg" |
732 | 1955 |
"Modified: / 25.11.1998 / 12:40:59 / cg" |
478 | 1956 |
! ! |
1957 |
||
1265 | 1958 |
!HTMLDocGenerator methodsFor:'format conversion-man pages'! |
575 | 1959 |
|
1960 |
manPageFor:aCommand |
|
632 | 1961 |
"generate a (unix-) man page for a given command & convert the output to html" |
575 | 1962 |
|
1963 |
^ self |
|
1964 |
manPageFor:aCommand |
|
1965 |
inSection:nil |
|
1966 |
||
632 | 1967 |
"Modified: / 30.10.1997 / 13:29:31 / cg" |
575 | 1968 |
! |
1969 |
||
1970 |
manPageFor:aCommand inSection:sectionOrNil |
|
632 | 1971 |
"generate a (unix-) man page for some entry in a section |
575 | 1972 |
& convert the output to html" |
1973 |
||
1974 |
|manCmd| |
|
1975 |
||
1976 |
sectionOrNil isNil ifTrue:[ |
|
1977 |
manCmd := 'man ' , aCommand |
|
1978 |
] ifFalse:[ |
|
1979 |
manCmd := 'man ' , sectionOrNil printString , ' ' , aCommand |
|
1980 |
]. |
|
1981 |
^ self |
|
1982 |
manPageFor:aCommand |
|
1983 |
manCommand:manCmd. |
|
1984 |
||
632 | 1985 |
"Created: / 9.9.1996 / 17:45:08 / cg" |
1986 |
"Modified: / 30.10.1997 / 13:29:44 / cg" |
|
575 | 1987 |
! |
1988 |
||
1989 |
manPageFor:aCommand manCommand:manCommand |
|
577 | 1990 |
"convert man-command output to html. |
632 | 1991 |
Only the body of the text (without head../head and body../body) is generated" |
575 | 1992 |
|
1249 | 1993 |
|manPageStream text| |
575 | 1994 |
|
1249 | 1995 |
manPageStream := PipeStream readingFrom:manCommand. |
1996 |
manPageStream notNil ifTrue:[ |
|
1997 |
[ |
|
1998 |
text := self manPageFromStream:manPageStream. |
|
1999 |
] ensure:[ |
|
2000 |
manPageStream shutDown. |
|
2001 |
] |
|
575 | 2002 |
]. |
2003 |
||
1249 | 2004 |
text isEmptyOrNil ifTrue:[ |
2005 |
^ self noManPageForCommand:aCommand usingManCommand:manCommand. |
|
575 | 2006 |
]. |
2007 |
||
1249 | 2008 |
^ '<pre> |
2009 |
' , text , ' |
|
575 | 2010 |
</pre> |
2011 |
' |
|
2012 |
||
2013 |
" |
|
2014 |
self manPageFor:'cvs' |
|
2015 |
" |
|
2016 |
||
632 | 2017 |
"Modified: / 28.6.1996 / 21:28:47 / stefan" |
2018 |
"Created: / 9.9.1996 / 17:43:16 / cg" |
|
2019 |
"Modified: / 30.10.1997 / 13:30:22 / cg" |
|
575 | 2020 |
! |
2021 |
||
2022 |
manPageForFile:aFilename |
|
2023 |
"convert a .man file to html" |
|
2024 |
||
2025 |
^ self |
|
2026 |
manPageFor:aFilename asFilename name |
|
2027 |
manCommand:('nroff -man ' , aFilename asFilename pathName). |
|
2028 |
||
2029 |
" |
|
2030 |
self manPageForFile:'../../stc/stc.1' |
|
2031 |
" |
|
2032 |
" |
|
2033 |
HTMLDocumentView openFullOnText:(self manPageForFile:'../../stc/stc.1') |
|
2034 |
" |
|
2035 |
||
2036 |
"Modified: 4.4.1997 / 10:44:05 / cg" |
|
1249 | 2037 |
! |
2038 |
||
2039 |
manPageFromStream:manPageStream |
|
2040 |
"convert man-command output to html. |
|
2041 |
Only the body of the text (without head../head and body../body) is generated. |
|
2042 |
This method looks for |
|
2043 |
char-backspace-char -> bold |
|
2044 |
char-backspace-underline -> italic" |
|
2045 |
||
2046 |
|state ch keep| |
|
2047 |
||
2048 |
outStream := '' writeStream. |
|
2049 |
state := nil. |
|
2050 |
keep := nil. |
|
2051 |
[manPageStream atEnd] whileFalse:[ |
|
2052 |
ch := manPageStream next. |
|
2053 |
||
2054 |
ch notNil ifTrue:[ |
|
2055 |
state == nil ifTrue:[ |
|
2056 |
ch == Character backspace ifTrue:[ |
|
2057 |
state := #back |
|
2058 |
] ifFalse:[ |
|
2059 |
keep notNil ifTrue:[ |
|
2060 |
self nextPutAllEscaped:keep. |
|
2061 |
]. |
|
2062 |
keep := ch |
|
2063 |
] |
|
2064 |
] ifFalse:[ |
|
2065 |
state == #back ifTrue:[ |
|
2066 |
ch == keep ifTrue:[ |
|
2067 |
self nextPutBold:ch. |
|
2068 |
] ifFalse:[ |
|
2069 |
ch == $_ ifTrue:[ |
|
2070 |
keep notNil ifTrue:[ |
|
2071 |
self nextPutItalic:keep. |
|
2072 |
]. |
|
2073 |
] ifFalse:[ |
|
2074 |
keep == $_ ifTrue:[ |
|
2075 |
self nextPutItalic:ch. |
|
2076 |
] ifFalse:[ |
|
2077 |
keep notNil ifTrue:[ |
|
2078 |
self nextPutAllEscaped:keep. |
|
2079 |
self nextPutAllEscaped:ch. |
|
2080 |
]. |
|
2081 |
]. |
|
2082 |
]. |
|
2083 |
]. |
|
2084 |
state := keep := nil. |
|
2085 |
] |
|
2086 |
] |
|
2087 |
] |
|
2088 |
]. |
|
2089 |
||
2090 |
keep notNil ifTrue:[ |
|
2091 |
self nextPutAllEscaped:keep. |
|
2092 |
]. |
|
2093 |
^ outStream contents. |
|
2094 |
||
2095 |
" |
|
2096 |
HTMLDocGenerator new manPageFor:'cvs' |
|
2097 |
" |
|
2098 |
! |
|
2099 |
||
2100 |
noManPageForCommand:aCommand usingManCommand:manCommand |
|
2101 |
^ ' |
|
2102 |
No manual page for "<CODE><B>' , aCommand , '</B></CODE>" available. |
|
2103 |
<BR> |
|
2104 |
(The failed command was: "<CODE>' , manCommand , '"</CODE>.) |
|
2105 |
'. |
|
575 | 2106 |
! ! |
2107 |
||
1249 | 2108 |
!HTMLDocGenerator methodsFor:'helpers'! |
2109 |
||
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2110 |
anchorFor:href info:infoMessageOrNil text:text name:nameOrNil |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2111 |
|infoPart namePart| |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2112 |
|
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2113 |
infoPart := namePart := ''. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2114 |
|
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2115 |
infoMessageOrNil notNil ifTrue:[ |
1332
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
2116 |
infoPart := self infoParameterFor:infoMessageOrNil. |
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2117 |
]. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2118 |
nameOrNil notNil ifTrue:[ |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2119 |
namePart := 'NAME="' , nameOrNil , '" '. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2120 |
]. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2121 |
^ '<A HREF="' , href , '" ' |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2122 |
, namePart |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2123 |
, infoPart |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2124 |
, '>' , text |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2125 |
,'</A>'. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2126 |
|
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2127 |
" |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2128 |
self new anchorFor:'foo' info:'bla' text:'text' name:nil |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2129 |
" |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2130 |
! |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2131 |
|
1249 | 2132 |
anchorForHTMLAction:actionString info:infoMessageOrNil text:text |
1250 | 2133 |
^ self |
2134 |
anchorForHTMLAction:actionString |
|
2135 |
info:infoMessageOrNil |
|
2136 |
text:text |
|
2137 |
name:nil |
|
1249 | 2138 |
|
1250 | 2139 |
" |
2140 |
self new anchorForHTMLAction:'foo' info:'bla' text:'text' |
|
2141 |
" |
|
2142 |
! |
|
2143 |
||
2144 |
anchorForHTMLAction:actionString info:infoMessageOrNil text:text name:nameOrNil |
|
2145 |
|infoPart namePart| |
|
2146 |
||
2147 |
infoPart := namePart := ''. |
|
2148 |
||
1249 | 2149 |
infoMessageOrNil notNil ifTrue:[ |
1332
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
2150 |
infoPart := self infoParameterFor:infoMessageOrNil. |
1249 | 2151 |
]. |
1250 | 2152 |
nameOrNil notNil ifTrue:[ |
2153 |
namePart := 'NAME="' , nameOrNil , '" '. |
|
2154 |
]. |
|
1255 | 2155 |
^ '<A HREF="' , self pathToTopOfDocumentation , '/misc/onlyInSTX2.html" ' |
1250 | 2156 |
, namePart |
1249 | 2157 |
, infoPart |
1250 | 2158 |
, 'ACTION="html:' |
1249 | 2159 |
, actionString |
2160 |
, '">' , text |
|
1250 | 2161 |
,'</A>'. |
1249 | 2162 |
|
2163 |
" |
|
2164 |
self new anchorForHTMLAction:'foo' info:'bla' text:'text' |
|
2165 |
" |
|
2166 |
! |
|
2167 |
||
2168 |
anchorForHTMLDocAction:actionString info:infoMessageOrNil text:text |
|
2169 |
^ self |
|
1250 | 2170 |
anchorForHTMLDocAction:actionString |
2171 |
info:infoMessageOrNil |
|
2172 |
text:text |
|
2173 |
name:nil |
|
1249 | 2174 |
|
2175 |
" |
|
2176 |
self new anchorForHTMLDocAction:'foo' info:'bla' text:'text' |
|
2177 |
" |
|
2178 |
! |
|
2179 |
||
1250 | 2180 |
anchorForHTMLDocAction:actionString info:infoMessageOrNil text:text name:anchorName |
2181 |
^ self |
|
2182 |
anchorForHTMLAction:(self class name , ' ' , actionString) |
|
2183 |
info:infoMessageOrNil |
|
2184 |
text:text |
|
2185 |
name:anchorName |
|
2186 |
||
2187 |
" |
|
2188 |
self new anchorForHTMLDocAction:'foo' info:'bla' text:'text' name:'baz' |
|
2189 |
" |
|
2190 |
! |
|
2191 |
||
1249 | 2192 |
anchorForHTMLDocAction:actionString text:text |
2193 |
^ self anchorForHTMLDocAction:actionString info:nil text:text |
|
2194 |
||
2195 |
" |
|
2196 |
self new anchorForHTMLDocAction:'foo' text:'text' |
|
2197 |
" |
|
2198 |
! |
|
478 | 2199 |
|
2200 |
extractSpecial:pattern from:docu |
|
2201 |
"given a collection of docu lines (from documentation methods comment), |
|
2202 |
extract things like [see also:], [author:] etc. |
|
2203 |
If found, remove the lines from the string collection, |
|
2204 |
and return the extracted ones. Otherwise return nil." |
|
2205 |
||
2206 |
|srchIdx idx lines l| |
|
2207 |
||
2208 |
srchIdx := docu findFirst:[:l | l asLowercase withoutSeparators = pattern]. |
|
2209 |
srchIdx ~~ 0 ifTrue:[ |
|
2210 |
lines := OrderedCollection new. |
|
2211 |
||
2212 |
idx := srchIdx+1. |
|
2213 |
[idx <= docu size] whileTrue:[ |
|
2214 |
l := docu at:idx. |
|
2215 |
(l isNil or:[l withoutSeparators size == 0]) ifTrue:[ |
|
2216 |
idx := docu size + 1. |
|
2217 |
] ifFalse:[ |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
2218 |
l withoutSeparators = '\' ifTrue:[ |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
2219 |
l := '' |
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
2220 |
]. |
478 | 2221 |
lines add:l |
2222 |
]. |
|
2223 |
idx := idx + 1. |
|
2224 |
]. |
|
2225 |
||
2226 |
docu removeFromIndex:srchIdx toIndex:srchIdx+lines size |
|
2227 |
]. |
|
2228 |
^ lines |
|
2229 |
||
2230 |
"Created: 25.4.1996 / 14:16:01 / cg" |
|
540
c20e12db0340
added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents:
530
diff
changeset
|
2231 |
"Modified: 11.1.1997 / 13:03:38 / cg" |
1249 | 2232 |
! |
2233 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2234 |
generateBODYEnd |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2235 |
generateBodyOnly == true ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2236 |
outStream nextPutLine:'</body>'. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2237 |
] |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2238 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2239 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2240 |
generateBODYStart |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2241 |
generateBodyOnly == true ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2242 |
outStream nextPutLine:'<body>'. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2243 |
] |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2244 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2245 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2246 |
generateBODYandHTMLEnd |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2247 |
self generateBODYEnd. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2248 |
self generateHTMLEnd. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2249 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2250 |
|
1328 | 2251 |
generateBackButton |
2252 |
|backHRef backLabel| |
|
2253 |
||
2254 |
backRef isNil ifTrue:[ |
|
2255 |
backHRef := self pathToLanguageTopOfDocumentation , '/TOP.html'. |
|
2256 |
backLabel := 'top'. |
|
2257 |
] ifFalse:[ |
|
2258 |
backHRef := backRef. |
|
2259 |
backLabel := 'back'. |
|
2260 |
]. |
|
2261 |
backCmd notNil ifTrue:[ |
|
2262 |
self |
|
2263 |
generateUpArrowButtonWithReference:backHRef |
|
2264 |
command:backCmd |
|
2265 |
imagePath:imagePath |
|
2266 |
altLabel:backLabel. |
|
2267 |
self generateHorizontalLine. |
|
2268 |
] ifFalse:[ |
|
2269 |
backHRef ~~ #none ifTrue:[ |
|
2270 |
self |
|
2271 |
generateUpArrowButtonWithReference:backHRef |
|
2272 |
command:nil |
|
2273 |
imagePath:imagePath |
|
2274 |
altLabel:backLabel. |
|
2275 |
self generateHorizontalLine. |
|
2276 |
] |
|
2277 |
]. |
|
2278 |
! |
|
2279 |
||
1250 | 2280 |
generateClassDocReferenceFor:className |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2281 |
self generateClassDocReferenceFor:className text:className |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2282 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2283 |
|
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2284 |
generateClassDocReferenceFor:className text:text |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2285 |
self generateClassDocReferenceFor:className text:text autoloading:nil |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2286 |
! |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2287 |
|
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2288 |
generateClassDocReferenceFor:className text:text autoloading:autoloadedClass |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2289 |
|href serviceLinkName action| |
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2290 |
|
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2291 |
self generatingForSTXBrowser ifFalse:[ |
1310 | 2292 |
httpRequestOrNil notNil ifTrue:[ |
2293 |
serviceLinkName := httpRequestOrNil serviceLinkName. |
|
2294 |
]. |
|
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2295 |
href := self |
1312
88d8f1ea1645
fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents:
1311
diff
changeset
|
2296 |
anchorFor:(serviceLinkName, '/classDocOf,', (HTTPRequest escape:className) ) |
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2297 |
info:('Show documentation of ' , className ) |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2298 |
text:text |
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2299 |
name:nil |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2300 |
] ifTrue:[ |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2301 |
action := self class name , ' htmlDocOf:' , className. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2302 |
autoloadedClass notNil ifTrue:[ |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2303 |
action := autoloadedClass , ' autoload,', action. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2304 |
]. |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2305 |
|
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2306 |
href := self |
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2307 |
anchorForHTMLAction: |
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2308 |
action |
1250 | 2309 |
info: |
2310 |
('Show documentation of ' , className ) |
|
2311 |
text: |
|
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2312 |
text. |
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2313 |
]. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2314 |
|
1337
5d537c9b1326
references (related information)
Claus Gittinger <cg@exept.de>
parents:
1336
diff
changeset
|
2315 |
outStream nextPutAll:href. |
1250 | 2316 |
! |
2317 |
||
1249 | 2318 |
generateH1:headerLine |
2319 |
outStream nextPutLine:'<h1>'. |
|
2320 |
outStream nextPutLine:headerLine. |
|
2321 |
outStream nextPutLine:'</h1>'. |
|
2322 |
! |
|
2323 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2324 |
generateHTMLEnd |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2325 |
generateBodyOnly == true ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2326 |
outStream nextPutLine:'</html>' |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2327 |
] |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2328 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2329 |
|
1249 | 2330 |
generateHTMLHeadWithTitle:title |
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2331 |
generateBodyOnly == true ifFalse:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2332 |
outStream |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2333 |
nextPutLine:'<!!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">'; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2334 |
nextPutLine:('<!!-- generated by ' , self class name , ' ' , thisContext sender selector , ' -->'); |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2335 |
cr; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2336 |
nextPutLine:'<html>'; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2337 |
nextPutLine:'<head>'; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2338 |
nextPutLine:'<title>'; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2339 |
nextPutLine:title; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2340 |
nextPutLine:'</title>'; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2341 |
nextPutLine:'</head>'; |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2342 |
cr. |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2343 |
] ifTrue:[ |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2344 |
outStream |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2345 |
nextPutLine:('<!!-- generated by ' , self class name , ' ' , thisContext sender selector , ' -->') |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2346 |
]. |
1249 | 2347 |
! |
2348 |
||
2349 |
generateHorizontalLine |
|
2350 |
outStream nextPutLine:'<hr>'. |
|
2351 |
! |
|
2352 |
||
2353 |
generateUpArrowButtonForTop |
|
2354 |
self |
|
1255 | 2355 |
generateUpArrowButtonWithReference:(self pathToLanguageTopOfDocumentation , '/TOP.html') |
1249 | 2356 |
command:nil |
2357 |
imagePath:nil |
|
2358 |
altLabel:'top' |
|
2359 |
! |
|
2360 |
||
2361 |
generateUpArrowButtonWithReference:backHRef command:backCmd imagePath:imagePath altLabel:altLabel |
|
1255 | 2362 |
|p| |
2363 |
||
1249 | 2364 |
outStream nextPutAll:'<a NOPRINT HREF="' , backHRef , '"'. |
2365 |
backCmd notNil ifTrue:[ |
|
2366 |
outStream nextPutAll:' action="html:' , self class name , ' ' , backCmd , '"'. |
|
2367 |
]. |
|
1255 | 2368 |
p := imagePath. |
2369 |
p isNil ifTrue:[ |
|
2370 |
p := self pathToTopOfDocumentation , '/icons' |
|
2371 |
]. |
|
2372 |
outStream nextPutLine:'> <IMG NOPRINT SRC="' , p , '/DocsUpArrow.gif" ALT="[' , (altLabel ? 'back') , ']"></A>'. |
|
1249 | 2373 |
! |
2374 |
||
1258
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2375 |
generatingForSTXBrowser |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2376 |
^ httpRequestOrNil isNil |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2377 |
! |
2efcd7c46179
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1257
diff
changeset
|
2378 |
|
1332
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
2379 |
infoParameterFor:infoMessageOrNil |
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
2380 |
infoMessageOrNil isNil ifTrue:[^ '']. |
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
2381 |
|
1333 | 2382 |
^ |
1332
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
2383 |
'ONMOUSEOVER="window.status=''',infoMessageOrNil,'''; return true" ' , |
1333 | 2384 |
'ONMOUSEOUT="window.status='' ''; return true" ' , |
2385 |
'INFO="' , infoMessageOrNil , '" ' |
|
1332
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
2386 |
! |
8838fb9735b0
added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents:
1331
diff
changeset
|
2387 |
|
1308
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2388 |
methodCommentOf:aMethod |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2389 |
|comment mClass mSel parseTree matcher| |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2390 |
|
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2391 |
comment := aMethod comment. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2392 |
comment notNil ifTrue:[^ comment]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2393 |
|
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2394 |
mClass := aMethod mclass. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2395 |
mClass isNil ifTrue:[^ nil]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2396 |
|
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2397 |
mSel := aMethod selector. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2398 |
mSel isNil ifTrue:[^ nil]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2399 |
|
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2400 |
"/ generate a comment if its a getter, setter or similar |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2401 |
ParseTreeSearcher notNil ifTrue:[ |
1336 | 2402 |
aMethod messagesSent isEmpty ifTrue:[ |
1351 | 2403 |
parseTree := mClass parseTreeFor:mSel. |
2404 |
parseTree notNil ifTrue: [ |
|
2405 |
(mClass allInstanceVariableNames) do:[:eachVar | |
|
1336 | 2406 |
matcher := ParseTreeSearcher getterMethod:eachVar. |
2407 |
(matcher executeTree: parseTree) notNil ifTrue:[ |
|
2408 |
^ 'Return the instance variable ' , eachVar, '.'. |
|
2409 |
]. |
|
1351 | 2410 |
|
1336 | 2411 |
matcher := ParseTreeSearcher setterMethod:eachVar. |
2412 |
(matcher executeTree: parseTree) notNil ifTrue:[ |
|
2413 |
^ 'Set the instance variable ' , eachVar, '.'. |
|
2414 |
]. |
|
1308
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2415 |
]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2416 |
]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2417 |
]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2418 |
]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2419 |
|
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2420 |
"/ (mSuperClass := mClass superclass) notNil ifTrue:[ |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2421 |
"/self halt. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2422 |
"/ ]. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2423 |
|
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2424 |
^ nil. |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2425 |
! |
08d6a08eee80
reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents:
1289
diff
changeset
|
2426 |
|
1249 | 2427 |
nextPutAllEscaped:aStringOrCharacter |
2428 |
outStream nextPutAll:(self withSpecialHTMLCharactersEscaped:aStringOrCharacter) |
|
2429 |
! |
|
2430 |
||
2431 |
nextPutBold:aStringOrCharacter |
|
2432 |
outStream nextPutAll:'<b>'. |
|
2433 |
self nextPutAllEscaped:aStringOrCharacter. |
|
2434 |
outStream nextPutAll:'</b>'. |
|
2435 |
! |
|
2436 |
||
2437 |
nextPutItalic:aStringOrCharacter |
|
2438 |
outStream nextPutAll:'<i>'. |
|
2439 |
self nextPutAllEscaped:aStringOrCharacter. |
|
2440 |
outStream nextPutAll:'</i>'. |
|
2441 |
! |
|
2442 |
||
2443 |
withSpecialHTMLCharactersEscaped:aStringOrCharacter |
|
1252 | 2444 |
^ HTTPServer withSpecialHTMLCharactersEscaped:aStringOrCharacter |
1249 | 2445 |
|
2446 |
" |
|
2447 |
self new withSpecialHTMLCharactersEscaped:'foo>' |
|
2448 |
self new withSpecialHTMLCharactersEscaped:$< |
|
2449 |
self new withSpecialHTMLCharactersEscaped:$A |
|
2450 |
" |
|
478 | 2451 |
! ! |
2452 |
||
1255 | 2453 |
!HTMLDocGenerator methodsFor:'pathnames'! |
2454 |
||
2455 |
findPathToTopOfDocumentation |
|
2456 |
#( |
|
2457 |
'../../doc/online' |
|
2458 |
'doc/online' |
|
2459 |
'/opt/stx/doc/online' |
|
2460 |
) do:[:eachPathToTry | |
|
2461 |
(eachPathToTry asFilename exists |
|
2462 |
and:[eachPathToTry asFilename isDirectory]) |
|
2463 |
ifTrue:[ |
|
2464 |
^ eachPathToTry |
|
2465 |
] |
|
2466 |
]. |
|
2467 |
^ '.' |
|
2468 |
! |
|
2469 |
||
1257
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2470 |
pathToDocumentationFile:relativeHref |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2471 |
|top| |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2472 |
|
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2473 |
top := self pathToLanguageTopOfDocumentation. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2474 |
(top asFilename construct:relativeHref) exists ifTrue:[ |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2475 |
"unix format: used as URL" |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2476 |
^ top , '/' , relativeHref |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2477 |
]. |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2478 |
^ self pathToEnglishTopOfDocumentation , '/' , relativeHref |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2479 |
! |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2480 |
|
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2481 |
pathToEnglishTopOfDocumentation |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2482 |
"/ always unix-name convention (used as an URL) |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2483 |
^ self pathToTopOfDocumentation , '/english' |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2484 |
! |
af5c892477b7
classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents:
1256
diff
changeset
|
2485 |
|
1255 | 2486 |
pathToLanguageTopOfDocumentation |
2487 |
|languageSpecificDocDirectory fn| |
|
2488 |
||
2489 |
pathToLanguageTopOfDocumentation isNil ifTrue:[ |
|
2490 |
pathToLanguageTopOfDocumentation := self pathToTopOfDocumentation. |
|
2491 |
languageSpecificDocDirectory := self class languageSpecificDocDirectory. |
|
2492 |
fn := pathToLanguageTopOfDocumentation asFilename construct:languageSpecificDocDirectory. |
|
2493 |
(fn exists and:[fn isDirectory]) ifTrue:[ |
|
2494 |
"/ always unix-name convention (used as an URL) |
|
2495 |
pathToLanguageTopOfDocumentation := pathToLanguageTopOfDocumentation , '/' , languageSpecificDocDirectory. |
|
2496 |
]. |
|
2497 |
]. |
|
2498 |
^ pathToLanguageTopOfDocumentation |
|
2499 |
! |
|
2500 |
||
2501 |
pathToTopOfDocumentation |
|
2502 |
pathToTopOfDocumentation isNil ifTrue:[ |
|
2503 |
pathToTopOfDocumentation := self findPathToTopOfDocumentation |
|
2504 |
]. |
|
2505 |
^ pathToTopOfDocumentation |
|
2506 |
! ! |
|
2507 |
||
498 | 2508 |
!HTMLDocGenerator class methodsFor:'documentation'! |
478 | 2509 |
|
2510 |
version |
|
1435 | 2511 |
^ '$Header: /cvs/stx/stx/libbasic3/HTMLDocGenerator.st,v 1.76 2005-12-21 11:40:47 cg Exp $' |
478 | 2512 |
! ! |