HTMLDocGenerator.st
changeset 1336 48affa54f55b
parent 1335 86e394c615a8
child 1337 5d537c9b1326
equal deleted inserted replaced
1335:86e394c615a8 1336:48affa54f55b
   342     refLines do:[:l |
   342     refLines do:[:l |
   343         |nm href|
   343         |nm href|
   344 
   344 
   345         l isString ifTrue:[
   345         l isString ifTrue:[
   346             s nextPutAll:'    '.
   346             s nextPutAll:'    '.
   347             nm := (l copyFrom:2 to:(l indexOf:$:)-1) withoutSpaces.
   347 
   348             href := (l copyFrom:(l indexOf:$:)+1 to:(l size - 1)) withoutSpaces.
   348             (l startsWith:'http:') ifTrue:[
   349             (href startsWith:'man:') ifTrue:[
   349                 s nextPutAll:'<a href="' , l , '"><I>' , l , '</I></a>'.
   350                 href := (href copyFrom:5) withoutSpaces.
       
   351                 s nextPutAll:'<a INFO="Show manual page" href="' , self pathToTopOfDocumentation , '/misc/onlyInSTX2.html" action="html:' , self class name , ' manPageFor:''' , href , '''">[<I>' , nm , '</I>]</A>'.
       
   352             ] ifFalse:[
   350             ] ifFalse:[
   353                 (href startsWith:'html:') ifTrue:[
   351                 nm := (l copyFrom:2 to:(l indexOf:$:)-1) withoutSpaces.
   354                     href := (href copyFrom:6) withoutSpaces.
   352                 href := (l copyFrom:(l indexOf:$:)+1 to:(l size - 1)) withoutSpaces.
   355                 ].                                             
   353                 (href startsWith:'man:') ifTrue:[
   356                 s nextPutAll:'<a href="' , (self pathToDocumentationFile:href) , '">[<I>' , nm , '</I>]</a>'.
   354                     href := (href copyFrom:5) withoutSpaces.
       
   355                     s nextPutAll:'<a INFO="Show manual page" href="' , self pathToTopOfDocumentation , '/misc/onlyInSTX2.html" action="html:' , self class name , ' manPageFor:''' , href , '''">[<I>' , nm , '</I>]</A>'.
       
   356                 ] ifFalse:[
       
   357                     (href startsWith:'http:') ifTrue:[
       
   358                         s nextPutAll:'<a href="' , href , '">[<I>' , nm , '</I>]</a>'.
       
   359                     ] ifFalse:[
       
   360                         (href startsWith:'html:') ifTrue:[
       
   361                             href := (href copyFrom:6) withoutSpaces.
       
   362                         ].                                             
       
   363                         s nextPutAll:'<a href="' , (self pathToDocumentationFile:href) , '">[<I>' , nm , '</I>]</a>'.
       
   364                     ].
       
   365                 ].
   357             ].
   366             ].
   358             s cr.
   367             s cr.
   359         ] ifFalse:[
   368         ] ifFalse:[
   360             l do:[:ref |
   369             l do:[:ref |
   361                 |realRef ns|
   370                 |realRef ns|
   921                         |t|
   930                         |t|
   922 
   931 
   923                         ((t := l withoutSeparators) startsWith:'(') ifTrue:[
   932                         ((t := l withoutSeparators) startsWith:'(') ifTrue:[
   924                             t
   933                             t
   925                         ] ifFalse:[
   934                         ] ifFalse:[
   926                             l asCollectionOfWords
   935                             t := l asCollectionOfWords.
       
   936                             t size == 1 ifTrue:[
       
   937                                 t first
       
   938                             ] ifFalse:[
       
   939                                 t
       
   940                             ]
   927                         ]
   941                         ]
   928                     ].
   942                     ].
   929     ].
   943     ].
   930 
   944 
   931     "/
   945     "/
  2286     mSel := aMethod selector.
  2300     mSel := aMethod selector.
  2287     mSel isNil ifTrue:[^ nil].
  2301     mSel isNil ifTrue:[^ nil].
  2288 
  2302 
  2289     "/ generate a comment if its a getter, setter or similar
  2303     "/ generate a comment if its a getter, setter or similar
  2290     ParseTreeSearcher notNil ifTrue:[
  2304     ParseTreeSearcher notNil ifTrue:[
  2291         (mClass allInstanceVariableNames) do:[:eachVar |
  2305         aMethod messagesSent isEmpty ifTrue:[
  2292             parseTree := mClass parseTreeFor:mSel.
  2306             (mClass allInstanceVariableNames) do:[:eachVar |
  2293             parseTree notNil ifTrue: [
  2307                 parseTree := mClass parseTreeFor:mSel.
  2294                 matcher := ParseTreeSearcher getterMethod:eachVar.
  2308                 parseTree notNil ifTrue: [
  2295                 (matcher executeTree: parseTree) notNil ifTrue:[
  2309                     matcher := ParseTreeSearcher getterMethod:eachVar.
  2296                     ^ 'Return the instance variable ' , eachVar, '.'.
  2310                     (matcher executeTree: parseTree) notNil ifTrue:[
       
  2311                         ^ 'Return the instance variable ' , eachVar, '.'.
       
  2312                     ].
  2297                 ].
  2313                 ].
  2298             ].
  2314 
  2299 
  2315                 parseTree := mClass parseTreeFor:mSel.
  2300             parseTree := mClass parseTreeFor:mSel.
  2316                 parseTree notNil ifTrue: [
  2301             parseTree notNil ifTrue: [
  2317                     matcher := ParseTreeSearcher setterMethod:eachVar.
  2302                 matcher := ParseTreeSearcher setterMethod:eachVar.
  2318                     (matcher executeTree: parseTree) notNil ifTrue:[
  2303                 (matcher executeTree: parseTree) notNil ifTrue:[
  2319                         ^ 'Set the instance variable ' , eachVar, '.'.
  2304                     ^ 'Set the instance variable ' , eachVar, '.'.
  2320                     ].
  2305                 ].
  2321                 ].
  2306             ].
  2322             ].
  2307         ].
  2323         ].
  2308     ].
  2324     ].
  2309 
  2325 
  2396 ! !
  2412 ! !
  2397 
  2413 
  2398 !HTMLDocGenerator class methodsFor:'documentation'!
  2414 !HTMLDocGenerator class methodsFor:'documentation'!
  2399 
  2415 
  2400 version
  2416 version
  2401     ^ '$Header: /cvs/stx/stx/libbasic3/HTMLDocGenerator.st,v 1.65 2003-10-20 16:01:56 penk Exp $'
  2417     ^ '$Header: /cvs/stx/stx/libbasic3/HTMLDocGenerator.st,v 1.66 2003-10-24 09:30:54 cg Exp $'
  2402 ! !
  2418 ! !