HTMLDocGeneratorForJavaScript.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 24 Sep 2013 23:18:24 +0200
branchinitialV
changeset 1180 01c6be61f29c
parent 589 3d9a8a8f282a
child 834 a503b02dc845
permissions -rw-r--r--
checkin from stx browser

"
 COPYRIGHT (c) 2007 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libjavascript' }"

HTMLDocGenerator subclass:#HTMLDocGeneratorForJavaScript
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'System-Documentation'
!

!HTMLDocGeneratorForJavaScript class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2007 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

examples
    "
     HTMLDocGeneratorForJavaScript htmlDocOf:Array
     HTMLDocumentView openFullOnText:(HTMLDocGeneratorForJavaScript htmlDocOf:Array)
    "
! !

!HTMLDocGeneratorForJavaScript methodsFor:'document generation-helpers'!

htmlForMethod:aMethod
    |who sel jsSel argStr|

    who := aMethod who.
    sel := who methodSelector.
    jsSel := ''.
    argStr := ''.

    sel numArgs > 0 ifTrue:[
        (sel keywords) with:(aMethod methodArgNames) do:[:part :argName |
            |partWithoutColon xLatedArgName|

            (argName = 'aBlock') ifTrue:[
                xLatedArgName := 'aFunction'.
            ] ifFalse:[
                xLatedArgName := argName.
            ].

            (part endsWith:$:) ifTrue:[
                partWithoutColon := part copyButLast:1
            ] ifFalse:[
                partWithoutColon := part
            ].
            jsSel isEmpty ifTrue:[
                jsSel := partWithoutColon.
                argStr := '<I>' , xLatedArgName , '</I>'.
            ] ifFalse:[
                jsSel := jsSel , '_' , partWithoutColon.
                argStr := argStr , ', <I>' , xLatedArgName , '</I>'.
            ].
        ].
    ] ifFalse:[
        jsSel := sel.
    ].
    ^ '<B>' , jsSel , '</B>' , '( ' , argStr , ' )'.

    "Created: / 05-11-2007 / 16:14:46 / cg"
! !

!HTMLDocGeneratorForJavaScript class methodsFor:'documentation'!

version
    ^ '$Header$'
!

version_CVS
    ^ '$Header$'
! !