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