author | Claus Gittinger <cg@exept.de> |
Fri, 21 Feb 2020 20:48:14 +0100 | |
changeset 1231 | b7d945ef967a |
parent 1197 | 90b1e7756b21 |
permissions | -rw-r--r-- |
1197 | 1 |
"{ Encoding: utf8 }" |
2 |
||
365 | 3 |
" |
4 |
COPYRIGHT (c) 2007 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
252 | 14 |
"{ Package: 'stx:libjavascript' }" |
15 |
||
1197 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
252 | 18 |
HTMLDocGenerator subclass:#HTMLDocGeneratorForJavaScript |
19 |
instanceVariableNames:'' |
|
20 |
classVariableNames:'' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'System-Documentation' |
|
23 |
! |
|
24 |
||
25 |
!HTMLDocGeneratorForJavaScript class methodsFor:'documentation'! |
|
26 |
||
365 | 27 |
copyright |
28 |
" |
|
29 |
COPYRIGHT (c) 2007 by eXept Software AG |
|
30 |
All Rights Reserved |
|
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
252 | 41 |
examples |
42 |
" |
|
43 |
HTMLDocGeneratorForJavaScript htmlDocOf:Array |
|
44 |
HTMLDocumentView openFullOnText:(HTMLDocGeneratorForJavaScript htmlDocOf:Array) |
|
45 |
" |
|
46 |
! ! |
|
47 |
||
834
a503b02dc845
class: HTMLDocGeneratorForJavaScript
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
48 |
!HTMLDocGeneratorForJavaScript class methodsFor:'document generation-helpers'! |
252 | 49 |
|
50 |
htmlForMethod:aMethod |
|
834
a503b02dc845
class: HTMLDocGeneratorForJavaScript
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
51 |
"redefined to generate a javascript method spec" |
a503b02dc845
class: HTMLDocGeneratorForJavaScript
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
52 |
|
a503b02dc845
class: HTMLDocGeneratorForJavaScript
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
53 |
|who sel jsSel argStr firstArg| |
252 | 54 |
|
55 |
who := aMethod who. |
|
56 |
sel := who methodSelector. |
|
57 |
jsSel := ''. |
|
58 |
argStr := ''. |
|
59 |
||
1197 | 60 |
sel argumentCount > 0 ifTrue:[ |
834
a503b02dc845
class: HTMLDocGeneratorForJavaScript
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
61 |
firstArg := true. |
252 | 62 |
(sel keywords) with:(aMethod methodArgNames) do:[:part :argName | |
63 |
|partWithoutColon xLatedArgName| |
|
64 |
||
65 |
(argName = 'aBlock') ifTrue:[ |
|
66 |
xLatedArgName := 'aFunction'. |
|
67 |
] ifFalse:[ |
|
68 |
xLatedArgName := argName. |
|
69 |
]. |
|
70 |
||
71 |
(part endsWith:$:) ifTrue:[ |
|
589
3d9a8a8f282a
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
365
diff
changeset
|
72 |
partWithoutColon := part copyButLast:1 |
252 | 73 |
] ifFalse:[ |
74 |
partWithoutColon := part |
|
75 |
]. |
|
834
a503b02dc845
class: HTMLDocGeneratorForJavaScript
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
76 |
firstArg ifTrue:[ |
a503b02dc845
class: HTMLDocGeneratorForJavaScript
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
77 |
"/ jsSel := partWithoutColon. |
252 | 78 |
argStr := '<I>' , xLatedArgName , '</I>'. |
834
a503b02dc845
class: HTMLDocGeneratorForJavaScript
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
79 |
firstArg := false. |
252 | 80 |
] ifFalse:[ |
834
a503b02dc845
class: HTMLDocGeneratorForJavaScript
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
81 |
"/ jsSel := jsSel , '_' , partWithoutColon. |
252 | 82 |
argStr := argStr , ', <I>' , xLatedArgName , '</I>'. |
83 |
]. |
|
84 |
]. |
|
85 |
] ifFalse:[ |
|
834
a503b02dc845
class: HTMLDocGeneratorForJavaScript
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
86 |
"/ jsSel := sel. |
252 | 87 |
]. |
834
a503b02dc845
class: HTMLDocGeneratorForJavaScript
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
88 |
jsSel := JavaScriptParser reverseTranslatedJavaScriptSelectorFor:sel. |
252 | 89 |
^ '<B>' , jsSel , '</B>' , '( ' , argStr , ' )'. |
90 |
||
91 |
"Created: / 05-11-2007 / 16:14:46 / cg" |
|
92 |
! ! |
|
93 |
||
94 |
!HTMLDocGeneratorForJavaScript class methodsFor:'documentation'! |
|
95 |
||
96 |
version |
|
97 |
^ '$Header$' |
|
365 | 98 |
! |
99 |
||
100 |
version_CVS |
|
101 |
^ '$Header$' |
|
252 | 102 |
! ! |
589
3d9a8a8f282a
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
365
diff
changeset
|
103 |