HTMLDocGenerator.st
author Claus Gittinger <cg@exept.de>
Sat, 28 Sep 2019 16:32:40 +0200
changeset 4504 196828a4584c
parent 4495 5f69b603bac0
child 4510 9776dcbf9a8a
permissions -rw-r--r--
#REFACTORING by exept class: MethodFinder comment/format in: #constMod #insertConstants #load: #makeAllMaps #mapData #permuteArgs #warnTooManyArguments changed: #allNumbers #cleanInputs: #constLessThan #findMessage class: MethodFinder class comment/format in: #documentation changed: #methodFor:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4481
270f28476380 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4469
diff changeset
     1
"{ Encoding: utf8 }"
270f28476380 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4469
diff changeset
     2
601
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
     3
"
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
     4
 COPYRIGHT (c) 1996 by Claus Gittinger
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
     5
              All Rights Reserved
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
     6
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
     7
 This software is furnished under a license and may be used
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
     8
 only in accordance with the terms of that license and with the
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    10
 be provided or otherwise made available to, or used by, any
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    11
 other person.  No title to or ownership of the software is
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    12
 hereby transferred.
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    13
"
1400
2281a5920b71 extract argument of obsoleteMethodWarning and show it
ca
parents: 1363
diff changeset
    14
"{ Package: 'stx:libbasic3' }"
1138
aa7687ec256f implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
    15
3797
b3af4cd09342 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3644
diff changeset
    16
"{ NameSpace: Smalltalk }"
b3af4cd09342 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3644
diff changeset
    17
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
Object subclass:#HTMLDocGenerator
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
    19
	instanceVariableNames:'outStream pathToTopOfDocumentation
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
    20
		pathToLanguageTopOfDocumentation httpRequestOrNil
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
    21
		generateBodyOnly backRef backCmd imagePath refLines demoLines
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
    22
		warnLines hintLines authorLines classProtocolCategories
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    23
		instanceProtocolCategories generateJavaScriptCallInfo
3999
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
    24
		generateDocumentForOfflineReading showUpButton'
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
    25
	classVariableNames:'CachedKWIC'
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
	poolDictionaries:''
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
	category:'System-Documentation'
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
!
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
498
ebdb7d336154 ignore private classes
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
    30
!HTMLDocGenerator class methodsFor:'documentation'!
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
601
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    32
copyright
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    33
"
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    34
 COPYRIGHT (c) 1996 by Claus Gittinger
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    35
              All Rights Reserved
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    36
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    37
 This software is furnished under a license and may be used
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    38
 only in accordance with the terms of that license and with the
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    39
 inclusion of the above copyright notice.   This software may not
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    40
 be provided or otherwise made available to, or used by, any
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    41
 other person.  No title to or ownership of the software is
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    42
 hereby transferred.
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    43
"
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    44
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    45
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    46
!
8d7df49c5938 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
    47
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
documentation
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
"
817
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    50
    Generates HTML documentation for a class.
4122
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
    51
    
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
    52
    This is used with the SystemBrowser (classes-generate documentation menu),
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
    53
    and the online documentation (which generates up-to-date documents just-in-time
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
    54
    out of the running system).
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
    55
    
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
    56
    It may also be useful, to programatically generate up-to-date documents 
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
    57
    into a folder of self contained html files (eg. for deployment).
817
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    58
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    59
    This generator extracts the documentation methods source
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    60
    (or comment), individual method comments (the first comment in
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    61
    a method) and version information to generate a neatly formatted
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    62
    HTML page.
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    63
    If executable examples (EXBEGIN .. EXEND) are present in the classes 
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    64
    documentation category these are also added as executable code
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    65
    to the document.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    67
    [instance variables:]
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    68
        outStream                               <WriteStream>   internal
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    69
        pathToTopOfDocumentation                <String>        will be prepended to links.
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    70
                                                                defaults to '../../doc'
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    71
        pathToLanguageTopOfDocumentation        <String>        defaults to '../../doc/online/<lang>'
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    72
        httpRequestOrNil                                        internal
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    73
        generateBodyOnly                                        internal
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    74
        backRef                                 <URLString>     if non-nil, the url for a back-button
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    75
        backCmd                                 <String>        if non-nil, the command for a back-button (for internal doc-browser only)
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    76
        imagePath                               <String>        path to image documents
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    77
        refLines                                                internal
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    78
        demoLines                                               internal
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    79
        warnLines                                               internal
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    80
        hintLines                                               internal
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    81
        authorLines                                             internal
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    82
        classProtocolCategories                                 internal
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    83
        instanceProtocolCategories                              internal
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    84
        generateJavaScriptCallInfo              <Boolean>       if true, synopsis is shown in JavaScript syntax also
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    85
        generateDocumentForOfflineReading       <Boolean>       if true, document is generated with file links (instead of browser command links)
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    86
                                                                for offline reading by an arbitrary browser.
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
    87
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    [author:]
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
        Claus Gittinger
817
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    90
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    91
    [see also:]
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    92
        BrowserView
d139c73bedf2 comment
Claus Gittinger <cg@exept.de>
parents: 805
diff changeset
    93
        HTMLDocumentView
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
"
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
! !
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
498
ebdb7d336154 ignore private classes
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
    97
!HTMLDocGenerator class methodsFor:'document generation'!
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
3644
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
    99
generateOfflineDocIn:aTopDirectory
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   100
    "generate a full tree of documents for offline reading.
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   101
     Similar to what is generated by the live-document generator, but
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   102
     all links are to static files.
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   103
     Tool for deployment."
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   104
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   105
    aTopDirectory recursiveMakeDirectory.
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   106
    (aTopDirectory / 'packages') recursiveMakeDirectory.
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   107
    (aTopDirectory / 'categories') recursiveMakeDirectory.
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   108
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   109
    (aTopDirectory / 'index.html') contents:(self htmlOfflineIndex).
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   110
    (aTopDirectory / 'packages/index.html') contents:(self htmlOfflinePackageList).
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   111
    (aTopDirectory / 'categories/index.html') contents:(self htmlOfflineClassCategoryList).
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   112
    "/ (aTopDirectory / 'classes/index.html') contents:(self htmlOfflineClassList).
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   113
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   114
    "
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   115
     self generateOfflineDocIn:'./offlineDoc' asFilename
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   116
    "
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   117
!
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   118
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
htmlClassCategoryList
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   120
    "generate a formatted list of all available class categories as
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   121
     an HTML string. Each category will be a hyperlink to another
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   122
     autogenerated page, containing the classes per category.
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   123
     The generated page is supposed to be given to an HTML reader
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   124
     with home being set to ../doc/online/xxx/classDoc 
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   125
     (i.e. the images are to be found one-up in the doc hierarchy)"
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   126
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   127
    ^ self new htmlClassCategoryList
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   128
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   129
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   130
     HTMLDocGenerator htmlClassCategoryList
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   131
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   132
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   133
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   134
htmlClassListPrefix:prefix
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   135
    "generate an HTML document string which contains HREFS for a list
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   136
     of classes which start with some prefix (typically, the first
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   137
     character is given)"
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   138
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   139
    ^ self new htmlClassListPrefix:prefix
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   140
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   141
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   142
     HTMLDocGenerator htmlClassListPrefix:'A'
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   143
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   144
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   145
1952
d4ce03b83795 Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents: 1923
diff changeset
   146
htmlClasses:classes title:title backTo:backRef
d4ce03b83795 Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents: 1923
diff changeset
   147
    "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
   148
     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
   149
     HREF is added at the top.
d4ce03b83795 Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents: 1923
diff changeset
   150
     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
   151
     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
   152
     (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
   153
d4ce03b83795 Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents: 1923
diff changeset
   154
    ^ 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
   155
!
d4ce03b83795 Bug 85 - bad selectors when generating HTML docs
Stefan Vogel <sv@exept.de>
parents: 1923
diff changeset
   156
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   157
htmlClassesListOfCategory:aCategory backTo:backMessage
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   158
    "generate an HTML document string which contains HREFS for a list
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   159
     of classes which are contained in a particular category."
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   160
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   161
    ^ self new htmlClassesListOfCategory:aCategory backTo:backMessage
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   162
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   163
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   164
htmlDocOf:aClass
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   165
    "generate an HTML document string which contains a classes documentation"
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   166
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   167
    ^ self new htmlDocOf:aClass
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   168
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   169
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   170
     HTMLDocGenerator htmlDocOf:Array
1973
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
   171
     HTMLDocumentView openFullOnText:(HTMLDocGenerator htmlDocOf:Array)
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   172
    "
1973
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
   173
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
   174
    "Modified: / 05-11-2007 / 16:19:03 / cg"
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   175
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   176
1253
57c789a317bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1252
diff changeset
   177
htmlDocOf:aClass back:backCmd backRef:backRef imagePath:imagePath
57c789a317bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1252
diff changeset
   178
    "generate a nice HTML page from a class, with a back-reference
57c789a317bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1252
diff changeset
   179
     to a command or document."
57c789a317bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1252
diff changeset
   180
57c789a317bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1252
diff changeset
   181
    ^ self new htmlDocOf:aClass back:backCmd backRef:backRef imagePath:imagePath
57c789a317bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1252
diff changeset
   182
!
57c789a317bd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1252
diff changeset
   183
1289
c435b15b1415 oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   184
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
   185
    "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
   186
c435b15b1415 oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   187
    ^ 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
   188
!
c435b15b1415 oops - need ol protocol to be still there (for doc pages)
Claus Gittinger <cg@exept.de>
parents: 1280
diff changeset
   189
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   190
htmlDocOfImplementorsOf:selector
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   191
    "generate an HTML document string which contains HREFS
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   192
     to all implementors of a particular selector"
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   193
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   194
    ^ self new htmlDocOfImplementorsOf:selector
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   195
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   196
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   197
     HTMLDocGenerator htmlDocOfImplementorsOf:#at:
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   198
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   199
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   200
1435
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   201
htmlDocOfImplementorsOfAnyMatching:selectorPattern
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   202
    "generate an HTML document string which contains HREFS
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   203
     to all implementors of a particular selector pattern"
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   204
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   205
    ^ self new htmlDocOfImplementorsOfAnyMatching:selectorPattern
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   206
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   207
    "
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   208
     HTMLDocGenerator htmlDocOfImplementorsOfAnyMatching:'key*:x:y:'
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   209
    "
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   210
!
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   211
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   212
htmlKWOCList
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   213
    "
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   214
    CachedKWIC := nil
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   215
    "
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   216
    CachedKWIC isNil ifTrue:[
4127
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   217
        "/ CachedKWIC := self generateKWIC.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   218
        CachedKWIC := self generateKWICForClassAndMethodNames.
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   219
        "/ to flush the cached kwic, whenever a class-documentation method is changed
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   220
        Smalltalk addDependent:self class. 
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   221
    ].
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   222
    ^ self new htmlKWOCListFor:CachedKWIC
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   223
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   224
    "
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   225
     HTMLDocGenerator htmlKWOCList
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   226
    "
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   227
!
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   228
3644
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   229
htmlOfflineClassCategoryList
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   230
    "generate a formatted list of all available class categories as
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   231
     an HTML string. Each category will be a hyperlink to another
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   232
     autogenerated page, containing the classes per category.
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   233
     The generated page is supposed to be given to an HTML reader
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   234
     with home being set to ../doc/online/xxx/classDoc 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   235
     (i.e. the images are to be found one-up in the doc hierarchy)"
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   236
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   237
    ^ self new 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   238
        generateDocumentForOfflineReading:true;
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   239
        htmlClassCategoryList
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   240
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   241
    "
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   242
     HTMLDocGenerator htmlOfflineClassCategoryList
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   243
    "
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   244
!
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   245
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   246
htmlOfflineDocOf:aClass
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   247
    "generate an HTML document string which contains a class's documentation for offline reading.
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   248
     This is different in that it creates file links, instead of action links 
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   249
     (action links only work with the builtin doc reader)."
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   250
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   251
    ^ self new htmlOfflineDocOf:aClass
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   252
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   253
    "
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   254
     HTMLDocGenerator htmlDocOf:Array
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   255
     HTMLDocumentView openFullOnText:(HTMLDocGenerator htmlDocOf:Array)
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   256
    "
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   257
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   258
    "Modified: / 05-11-2007 / 16:19:03 / cg"
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   259
!
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   260
3644
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   261
htmlOfflineIndex
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   262
    ^ '<html>
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   263
<body>
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   264
<ul>
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   265
<li><A HREF="packages/index.html">By Package</A>
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   266
<li><A HREF="categories/index.html">By Category</A>
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   267
<li><A HREF="classes/index.html">By Class Name</A>
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   268
</ul>
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   269
</body>
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   270
</html>
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   271
'
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   272
!
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   273
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   274
htmlOfflinePackageList
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   275
    "generate an HTML string for all packages in the system"
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   276
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   277
    ^ self new 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   278
        generateDocumentForOfflineReading:true;
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   279
        htmlPackageList
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   280
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   281
    "
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   282
     HTMLDocGenerator htmlOfflinePackageList
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   283
    "
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   284
!
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
   285
2017
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   286
htmlPackageDocOf:packageID
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   287
    "generate an HTML document string which contains a packages classlist"
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   288
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   289
    ^ self new htmlPackageDocOf:packageID
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   290
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   291
    "
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   292
     HTMLDocGenerator htmlPackageDocOf:#'stx:libbasic'
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   293
     HTMLDocumentView openFullOnText:(HTMLDocGenerator htmlPackageDocOf:#'stx:libbasic')
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   294
    "
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   295
!
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   296
2018
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   297
htmlPackageList
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   298
    "generate an HTML string for all packages in the system"
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   299
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   300
    ^ self new htmlPackageList
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   301
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   302
    "
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   303
     HTMLDocGenerator htmlPackageList
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   304
    "
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   305
!
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
   306
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   307
htmlSelectorList
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   308
    "generate an HTML string for all selectors (for which methods exist)
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   309
     in the system"
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   310
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   311
    ^ self new htmlSelectorList
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   312
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   313
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   314
     HTMLDocGenerator htmlSelectorList
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   315
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   316
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   317
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   318
htmlSelectorListMatching:prefix
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   319
    "generate an HTML string for all selectors which match a pattern
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   320
     (and for which methods exist) in the system"
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   321
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   322
    ^ self new htmlSelectorListMatching:prefix
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   323
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   324
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   325
htmlSelectorListPrefix:prefix
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   326
    "generate an HTML string for all selectors whose names starts with
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   327
     a prefix (and for which methods exist) in the system"
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   328
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   329
    ^ self new htmlSelectorListPrefix:prefix
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   330
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   331
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   332
     HTMLDocGenerator htmlSelectorListPrefix:'a'
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   333
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   334
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   335
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   336
manPageFor:aCommandName
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   337
    "generate a (unix-) man page for a given command & convert the output to html"
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   338
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   339
    ^ self new manPageFor:aCommandName
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   340
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   341
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   342
     HTMLDocGenerator manPageFor:'ls'
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   343
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   344
     HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageFor:'ls')
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   345
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   346
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   347
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   348
manPageFor:aManPageTemplateFile manCommand:nroffCommand
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   349
    "convert man-command output to html.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   350
     Only the body of the text (without head../head and body../body) is generated"
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   351
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   352
    ^ self new manPageFor:aManPageTemplateFile manCommand:nroffCommand
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   353
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   354
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   355
     HTMLDocGenerator 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   356
        manPageForFile:'/usr/man/man2/open.2'
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   357
        manCommand:'nroff -man /usr/man/man2/open.2'
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   358
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   359
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   360
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   361
manPageForFile:aManPageTemplateFile
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   362
    "convert a .man file to html"
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   363
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   364
    ^ self new manPageForFile:aManPageTemplateFile
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   365
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   366
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   367
     HTMLDocGenerator manPageForFile:'/usr/man/man2/open.2'
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   368
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   369
     HTMLDocumentView openFullOnText:(HTMLDocGenerator manPageForFile:'../../stc/stc.1')
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   370
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   371
! !
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   372
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   373
!HTMLDocGenerator class methodsFor:'document generation-helpers'!
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   374
4127
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   375
camelCaseSeparatedWordsOf:wordIn do:aBlock
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   376
    "
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   377
     self camelCaseSeparatedWordsOf:'HelloWorld' do:[:w | Transcript showCR:w]
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   378
     self camelCaseSeparatedWordsOf:'abcDef' do:[:w | Transcript showCR:w]
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   379
     self camelCaseSeparatedWordsOf:'UTFEncoder' do:[:w | Transcript showCR:w]
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   380
     self camelCaseSeparatedWordsOf:'JisEncoder' do:[:w | Transcript showCR:w]
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   381
     self camelCaseSeparatedWordsOf:'JISEncode' do:[:w | Transcript showCR:w]
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   382
    "
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   383
    |state newState in out ch part|
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   384
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   385
    in := wordIn readStream.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   386
    out := '' writeStream.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   387
    [in atEnd] whileFalse:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   388
        ch := in next.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   389
        (ch isDigit or:[ch == $_]) ifFalse:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   390
            newState := ch isUppercase.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   391
        ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   392
        (newState ~~ state) ifTrue:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   393
            newState == true ifTrue:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   394
                "/ going from lower- to uppercase
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   395
                part := out contents.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   396
                part notEmpty ifTrue:[ aBlock value:part ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   397
                out :=  '' writeStream.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   398
                out nextPut:ch.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   399
                state := newState.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   400
            ] ifFalse:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   401
                "/ going upper- to lowercase
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   402
                out size <= 1 ifTrue:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   403
                    out nextPut:ch.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   404
                ] ifFalse:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   405
                    |prev|
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   406
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   407
                    prev := out contents.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   408
                    aBlock value:(prev copyButLast).
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   409
                    out := '' writeStream.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   410
                    out nextPut:prev last.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   411
                    out nextPut:ch.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   412
                ].    
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   413
                state := newState.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   414
            ].    
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   415
        ] ifFalse:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   416
            out nextPut:ch.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   417
        ].    
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   418
    ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   419
    part := out contents.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   420
    part notEmpty ifTrue:[ aBlock value:part ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   421
!
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   422
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   423
generateKWIC
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   424
    |fillWords kwic|
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   425
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   426
    fillWords := 
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   427
        #(
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   428
            'the' 'a'
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   429
            'can' 'you' 
4125
a3d132b43f37 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4124
diff changeset
   430
            'to' 'in' 'out' 'at' 'of' 
4110
c353479537ba #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4109
diff changeset
   431
            'also' 'with' 'without' 'all' 'any' 'how' 
4123
e8f971e8af3f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4122
diff changeset
   432
            'however' 'although' 'always' 'either' 'neither'
4110
c353479537ba #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4109
diff changeset
   433
            'anywhere' 'anyway' 'anything' 'anyone'
4123
e8f971e8af3f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4122
diff changeset
   434
            'not' 'but' 'else' 'elsewhere'
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   435
            'am' 'are' 'is' 'be' 'will' 'wont' 'won''t' 'do' 'don''t'
4125
a3d132b43f37 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4124
diff changeset
   436
            'no' 'non' 'now' 'old' 'on' 'only'
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   437
            'my' 'their' 'your' 'its'
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   438
            'one' 'two' 'three'
4125
a3d132b43f37 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4124
diff changeset
   439
            'etc' 'for' 'lot' 'lots' 'made' 'may' 'most' 'mostly' 'much'
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   440
            'use' 'this' 'that' 'which' 'what' 'why'
4125
a3d132b43f37 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4124
diff changeset
   441
            'or' 'other' 'please'
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   442
        ).
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   443
        
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   444
    kwic := KeywordInContextIndexBuilder new.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   445
    kwic excluded:fillWords.
4127
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   446
    kwic separatorAlgorithm:[:line | 
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   447
            line asCollectionOfSubstringsSeparatedByAny:' ^~=@.:,;-+*/()[]|{}#"''<>',Character cr
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   448
        ].
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   449
    kwic exclusionFilter:[:word | 
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   450
                word size == 1
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   451
                or:[ word conform:#isDigit ]].
4122
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   452
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   453
    Smalltalk allClassesDo:[:eachClass |
4126
45a9254c8f0d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   454
        eachClass isLoaded ifTrue:[
45a9254c8f0d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   455
            |doc|
45a9254c8f0d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   456
45a9254c8f0d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   457
            doc := eachClass commentOrDocumentationString.
45a9254c8f0d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   458
            doc notEmptyOrNil ifTrue:[
45a9254c8f0d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   459
                kwic addLine:doc reference:eachClass ignoreCase:true.
45a9254c8f0d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   460
            ].    
45a9254c8f0d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4125
diff changeset
   461
        ].
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   462
    ].
4122
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   463
4123
e8f971e8af3f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4122
diff changeset
   464
    "/ if we have a key like 'startWith:' in the list,
e8f971e8af3f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4122
diff changeset
   465
    "/ and 'starts' is also there, place the 'startsWith:' entries into the same bin.
4122
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   466
    kwic remapKeywordsWith:[:oldKey :knownMappings |
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   467
        |newKey|
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   468
4125
a3d132b43f37 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4124
diff changeset
   469
        6 to:oldKey size - 1 do:[:len |
4122
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   470
            newKey isNil ifTrue:[
4123
e8f971e8af3f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4122
diff changeset
   471
                |part|
e8f971e8af3f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4122
diff changeset
   472
                
e8f971e8af3f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4122
diff changeset
   473
                part := (oldKey copyTo:len).
e8f971e8af3f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4122
diff changeset
   474
                (knownMappings includes:part) ifTrue:[
e8f971e8af3f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4122
diff changeset
   475
                    newKey := part.
4122
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   476
                ].
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   477
            ].
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   478
        ].
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   479
        newKey ? oldKey.
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   480
    ].
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   481
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   482
    ^ kwic
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   483
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   484
    "
4122
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
   485
     CachedKWIC := nil.
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   486
     self generateKWIC
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   487
    "
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   488
!
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
   489
4127
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   490
generateKWICForClassAndMethodNames
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   491
    |fillWords kwic|
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   492
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   493
    fillWords := 
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   494
        #(
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   495
"/            'the' 'a'
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   496
"/            'can' 'you' 
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   497
"/            'to' 'in' 'out' 'at' 'of' 
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   498
"/            'also' 'with' 'without' 'all' 'any' 'how' 
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   499
"/            'however' 'although' 'always' 'either' 'neither'
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   500
"/            'anywhere' 'anyway' 'anything' 'anyone'
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   501
"/            'not' 'but' 'else' 'elsewhere'
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   502
"/            'am' 'are' 'is' 'be' 'will' 'wont' 'won''t' 'do' 'don''t'
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   503
"/            'no' 'non' 'now' 'old' 'on' 'only'
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   504
"/            'my' 'their' 'your' 'its'
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   505
"/            'one' 'two' 'three'
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   506
"/            'etc' 'for' 'lot' 'lots' 'made' 'may' 'most' 'mostly' 'much'
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   507
"/            'use' 'this' 'that' 'which' 'what' 'why'
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   508
"/            'or' 'other' 'please'
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   509
        ).
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   510
        
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   511
    kwic := KeywordInContextIndexBuilder new.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   512
    kwic excluded:fillWords.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   513
    kwic separatorAlgorithm:[:name |
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   514
            |words|
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   515
            words := Set new.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   516
            (name asCollectionOfSubstringsSeparatedBy:$:) do:[:eachPart |
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   517
                eachPart notEmpty ifTrue:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   518
                    self camelCaseSeparatedWordsOf:eachPart do:[:w | words add:w].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   519
                ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   520
            ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   521
            words := words reject:[:w | w isEmpty].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   522
            words 
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   523
        ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   524
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   525
    Smalltalk allClassesDo:[:eachClass |
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   526
        kwic addLine:eachClass name reference:eachClass ignoreCase:true.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   527
"/        eachClass isLoaded ifTrue:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   528
"/            eachClass theNonMetaclass selectorsAndMethodsDo:[:sel :mthd |
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   529
"/                kwic addLine:sel reference:mthd ignoreCase:true.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   530
"/            ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   531
"/            eachClass theMetaclass selectorsAndMethodsDo:[:sel :mthd|
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   532
"/                kwic addLine:sel reference:mthd ignoreCase:true.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   533
"/            ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   534
"/        ].    
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   535
    ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   536
    ^ kwic
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   537
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   538
    "
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   539
     CachedKWIC := nil.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   540
     self generateKWICForClassAndMethodNames
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   541
    "
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   542
!
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
   543
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   544
htmlForMethod:aMethod
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   545
    |who sel partStream args argStream methodSpecLine|
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   546
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   547
    who := aMethod who.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   548
    sel := who methodSelector.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   549
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   550
    partStream := sel keywords readStream.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   551
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   552
    (args := aMethod methodArgNames) notNil ifTrue:[
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   553
        argStream := args readStream.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   554
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   555
        methodSpecLine := ''. 
4495
5f69b603bac0 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4484
diff changeset
   556
        1 to:sel argumentCount do:[:index |
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
   557
            methodSpecLine size ~~ 0 ifTrue:[
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   558
                methodSpecLine := methodSpecLine , ' '
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   559
            ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   560
            methodSpecLine := methodSpecLine , '<B>' , partStream next , '</B>'.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   561
            methodSpecLine := methodSpecLine , ' <I>' , argStream next , '</I>'.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   562
        ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   563
    ] ifFalse:[
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   564
        methodSpecLine := '<B>' , partStream next , '</B>'
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   565
    ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   566
    ^ methodSpecLine
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   567
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   568
    "Created: / 05-11-2007 / 16:13:39 / cg"
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
   569
    "Modified: / 01-03-2019 / 15:53:15 / Claus Gittinger"
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   570
! !
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   571
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   572
!HTMLDocGenerator class methodsFor:'pathnames'!
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   573
1993
68da9e3a68e9 make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents: 1979
diff changeset
   574
findPathToTopOfDocumentation
4267
93e7093e90e6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4263
diff changeset
   575
    "find the 'doc/online' folder"
93e7093e90e6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4263
diff changeset
   576
    
3999
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   577
    |triedDirs|
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   578
    
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   579
    triedDirs := OrderedCollection new.
4267
93e7093e90e6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4263
diff changeset
   580
    triedDirs add:(Smalltalk packageDirectory directory / 'doc/online') pathName. 
3999
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   581
    triedDirs addAll: 
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   582
                #(
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   583
                    '../../doc/online'
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   584
                    'doc/online'
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   585
                    '/opt/stx/doc/online'
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   586
                ).
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   587
    triedDirs do:[:eachPathToTry |
1993
68da9e3a68e9 make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents: 1979
diff changeset
   588
        (eachPathToTry asFilename exists
68da9e3a68e9 make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents: 1979
diff changeset
   589
        and:[eachPathToTry asFilename isDirectory])
68da9e3a68e9 make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents: 1979
diff changeset
   590
        ifTrue:[
68da9e3a68e9 make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents: 1979
diff changeset
   591
            ^ eachPathToTry
68da9e3a68e9 make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents: 1979
diff changeset
   592
        ]
68da9e3a68e9 make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents: 1979
diff changeset
   593
    ].
68da9e3a68e9 make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents: 1979
diff changeset
   594
    ^ '.'
3999
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   595
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   596
    "
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   597
     self findPathToTopOfDocumentation
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   598
    "
4267
93e7093e90e6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4263
diff changeset
   599
93e7093e90e6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4263
diff changeset
   600
    "Modified (comment): / 25-11-2017 / 14:05:08 / cg"
1993
68da9e3a68e9 make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents: 1979
diff changeset
   601
!
68da9e3a68e9 make accessors for doc-directory and language-directories
Claus Gittinger <cg@exept.de>
parents: 1979
diff changeset
   602
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   603
languageSpecificDocDirectory
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   604
    |lang|
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   605
2178
af7b05dfeaae changed: #languageSpecificDocDirectory
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
   606
    lang := UserPreferences current language.
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   607
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   608
    "XXX Kludge for now, map ISO-639 abbreviations to dir names.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   609
     Should rename the directories"
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   610
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   611
    lang == #en ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   612
        ^ 'english'.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   613
    ].
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   614
    lang == #de ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   615
        ^ 'german'.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   616
    ].
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   617
    lang == #fr ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   618
        ^ 'french'.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   619
    ].
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   620
    lang == #it ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   621
        ^ 'italian'.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   622
    ].
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   623
"/    lang == #es ifTrue:[
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   624
"/        ^ 'spanish'.
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   625
"/    ].
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   626
    lang == #jp ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   627
        ^ 'japanese'.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   628
    ].
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   629
    ^ 'english'.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   630
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   631
    "
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   632
     self languageSpecificDocDirectory
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   633
    "
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   634
! !
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   635
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   636
!HTMLDocGenerator methodsFor:'accessing'!
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   637
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   638
generateBodyOnly:aBoolean
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   639
    generateBodyOnly := aBoolean.
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   640
!
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   641
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   642
generateDocumentForOfflineReading
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   643
    ^ generateDocumentForOfflineReading ? false
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   644
!
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   645
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   646
generateDocumentForOfflineReading:aBoolean
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
   647
    generateDocumentForOfflineReading := aBoolean.
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   648
!
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   649
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   650
generateJavaScriptCallInfo
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   651
    ^ generateJavaScriptCallInfo ? false
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   652
!
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   653
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   654
generateJavaScriptCallInfo:aBoolean
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   655
    generateJavaScriptCallInfo := aBoolean.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   656
!
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   657
1257
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
   658
httpRequest:aRequest
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
   659
    httpRequestOrNil := aRequest.
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
   660
!
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
   661
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   662
pathToLanguageTopOfDocumentation:something
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   663
    pathToLanguageTopOfDocumentation := something.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   664
!
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   665
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   666
pathToTopOfDocumentation:something
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   667
    pathToTopOfDocumentation := something.
3999
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   668
!
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   669
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   670
showUpButton
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   671
    ^ showUpButton ? true
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   672
!
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   673
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   674
showUpButton:aBoolean
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
   675
    showUpButton := aBoolean
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   676
! !
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   677
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   678
!HTMLDocGenerator methodsFor:'document generation'!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
   679
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   680
generateClassInfoForClass:aClass
2017
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   681
    |owner packageID|
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   682
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   683
    owner := aClass owningClass.
2017
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   684
    packageID := aClass package.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   685
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   686
    outStream nextPutLine:'<dl>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   687
    outStream nextPutLine:'<dt><a name="PACKAGE"><b>Package:</b></A>'.
2017
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   688
    outStream nextPutAll:'<dd><b>'.
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   689
    self generatePackageDocReferenceFor:packageID text:packageID.
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   690
    "/ outStream nextPutAll:packageID.
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
   691
    outStream nextPutLine:'</b>'.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   692
    outStream nextPutLine:'</dl>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   693
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   694
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   695
    aClass category notNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   696
        outStream nextPutLine:'<dl>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   697
        outStream nextPutLine:'<dt><a name="CATEGORY"><b>Category:</b></A>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   698
        outStream nextPutLine:'<dd><b>', aClass category , '</b>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   699
        outStream nextPutLine:'</dl>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   700
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   701
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   702
    owner notNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   703
        outStream nextPutLine:'<dl>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   704
        outStream nextPutLine:'<dt><a name="OWNER"><b>Owner:</b></A>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   705
        outStream nextPutAll:'<dd><b>'. 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   706
        self generateClassDocReferenceFor:owner name.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   707
        outStream cr.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   708
"/        outStream nextPutLine:(self 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   709
"/                    anchorForHTMLDocAction:
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   710
"/                        ('htmlDocOf:', owner name )
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   711
"/                    info:
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   712
"/                        ( 'Show documentation of ' , owner nameWithoutPrefix )
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   713
"/                    text:
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   714
"/                        owner nameWithoutPrefix).
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   715
        outStream nextPutLine:'</b>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   716
    ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   717
        self htmlRevisionDocOf:aClass to:outStream.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   718
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   719
    outStream nextPutLine:'</dl>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   720
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   721
    authorLines notNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   722
        outStream nextPutLine:'<dl><dt><a name="AUTHOR"><b>Author:</b></A>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   723
        authorLines do:[:l|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   724
            outStream nextPutLine:'<dd><b>', l , '</b>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   725
        ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   726
        outStream nextPutLine:'</dl>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   727
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   728
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   729
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   730
generateClassProtocolDocumentationForClass:aClass
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   731
    |metaClass shortMetaName|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   732
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   733
    classProtocolCategories notEmpty ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   734
        metaClass := aClass class.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   735
        shortMetaName := metaClass nameWithoutPrefix.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   736
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   737
        outStream nextPutLine:'<li><a href="#CLASSPROTOCOL" name="I_CLASSPROTOCOL">Class protocol</a>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   738
        outStream nextPutLine:'<ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   739
        classProtocolCategories do:[:cat |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   740
            outStream nextPutLine:'<li><a name="I_' , shortMetaName , '_category_' , cat , '"' ,
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   741
                                     ' href="#' , shortMetaName , '_category_' , cat ,
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   742
                                     '">' , cat , '</a> '.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   743
        ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   744
        outStream nextPutLine:'</ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   745
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   746
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   747
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   748
generateDemo
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   749
    outStream nextPutLine:'<h2><a name="DEMOSTARTUP" href="#I_DEMOSTARTUP">Demonstration:</A></h2>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   750
    demoLines do:[:l |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   751
        outStream nextPutLine:'<a INFO="demonstration" type="example">'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   752
        outStream nextPutLine:'<pre><code>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   753
        outStream nextPutLine:'    ' , l withoutSeparators.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   754
        outStream nextPutLine:'</code></pre>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   755
        outStream nextPutLine:'</a>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   756
        outStream nextPutLine:'<br>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   757
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   758
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   759
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   760
generateDescription:docu
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   761
    docu notNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   762
        outStream nextPutLine:'<h2><a name="DESCRIPTION" href="#I_DESCRIPTION">Description:</A></h2>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   763
        outStream nextPutLine:'<BR>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   764
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   765
        outStream nextPutLine:'<pre>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   766
        outStream nextPutLine:docu.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   767
        outStream nextPutLine:'</pre>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   768
        self generateHorizontalLine.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   769
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   770
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   771
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   772
generateExampleEnd
4318
3310ef4ccb22 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4267
diff changeset
   773
    outStream nextPutAll:'</code></pre>'.
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
   774
    self generatingForSTXBrowser ifTrue:[
4318
3310ef4ccb22 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4267
diff changeset
   775
        outStream nextPutAll:'</a>'.
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   776
    ].
4318
3310ef4ccb22 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4267
diff changeset
   777
    outStream nextPutAll:'</td></tr></table>'.
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   778
!
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   779
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   780
generateExampleStart
4318
3310ef4ccb22 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4267
diff changeset
   781
    "/ outStream nextPutAll:'<p></p>'.
3310ef4ccb22 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4267
diff changeset
   782
    outStream nextPutAll:'<table width="100%" bgcolor="#eedddd"><tr><td>'.
1343
b6847a59c3ba example code in a box
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
   783
    self generatingForSTXBrowser ifTrue:[
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
   784
        outStream nextPutLine:'<a info="execute the example" type="example" showresult>'.
1343
b6847a59c3ba example code in a box
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
   785
    ].
4318
3310ef4ccb22 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4267
diff changeset
   786
    outStream nextPutAll:'<pre><code>'.
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   787
!
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   788
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   789
generateExamples:examples
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   790
    "everything between exBegin and exEnd is shown as code example;
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   791
     the remaining text is shown as regular text (commenting the code, I hope)"
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
   792
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   793
    |inExample|
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   794
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   795
    inExample := false.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   796
    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
   797
    outStream nextPutLine:'<BR>'.
1343
b6847a59c3ba example code in a box
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
   798
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   799
    examples do:[:line |
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   800
        line withoutSeparators = '[exBegin]' ifTrue:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   801
            inExample ifTrue:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   802
                self generateExampleEnd.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   803
            ].
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   804
            self generateExampleStart.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   805
            inExample := true.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   806
        ] ifFalse:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   807
            line withoutSeparators = '[exEnd]' ifTrue:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   808
                inExample ifTrue:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   809
                    self generateExampleEnd.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   810
                ].
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   811
                inExample := false.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   812
            ] ifFalse:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   813
                outStream nextPutLine:line
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   814
            ]
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   815
        ].
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   816
    ].
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   817
    inExample ifTrue:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   818
        self generateExampleEnd.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   819
    ].
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   820
    self generateHorizontalLine.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   821
!
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
   822
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   823
generateInheritanceTreeForClass:aClass
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   824
    |indent first supers subs|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   825
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   826
    supers := aClass allSuperclasses.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   827
    (aClass == Autoload or:[aClass == Object]) ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   828
        subs := #()
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   829
    ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   830
        subs := self shownSubclassesOf:aClass. 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   831
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   832
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   833
    outStream nextPutLine:'<h2><a name="INHERITANCE" href="#I_INHERITANCE">Inheritance:</A></h2>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   834
    outStream nextPutLine:'<pre>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   835
    indent := 3.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   836
    first := true.
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
   837
    (supers size ~~ 0) ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   838
        supers reverseDo:[:cls |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   839
            |className|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   840
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   841
            className := cls name.    
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   842
            first ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   843
                outStream spaces:indent; nextPutLine:'|'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   844
                outStream spaces:indent; nextPutAll:'+--'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   845
                indent := indent + 3.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   846
            ] ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   847
                outStream spaces:indent
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
   848
            ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   849
            first := false.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   850
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   851
            self generateClassDocReferenceFor:className.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   852
            outStream cr.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   853
        ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   854
        outStream spaces:indent; nextPutLine:'|'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   855
        outStream spaces:indent. 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   856
        outStream nextPutAll:'+--<B>'; nextPutAll:aClass name; nextPutLine:'</B>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   857
        indent := indent + 3.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   858
    ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   859
        outStream spaces:indent; nextPutLine:'nil'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   860
        outStream spaces:indent; nextPutLine:'|'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   861
        outStream spaces:indent; nextPutAll:'+--<B>'; nextPutAll:aClass name; nextPutLine:'</B>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   862
        aClass ~~ Object ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   863
            outStream cr.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   864
            outStream nextPutLine:'  <B>This class inherits NOTHING - most messages will lead into doesNotUnderstand:</B>'
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
   865
        ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   866
        indent := indent + 3.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   867
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   868
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   869
    subs notEmpty ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   870
        subs do:[:aSubclass |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   871
            |className|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   872
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   873
            className := aSubclass name.    
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   874
            outStream spaces:indent; nextPutLine:'|'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   875
            outStream spaces:indent; nextPutAll:'+--'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   876
            self generateClassDocReferenceFor:className.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   877
            outStream cr.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   878
        ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   879
    ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   880
        aClass == Object ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   881
            outStream spaces:indent; nextPutLine:'|'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   882
            outStream spaces:indent; nextPutLine:'+-- ... almost every other class ...'
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   883
        ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   884
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   885
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   886
    outStream nextPutLine:'</pre>'.
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
   887
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
   888
    "Modified: / 01-03-2019 / 15:52:20 / Claus Gittinger"
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
   889
!
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
   890
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   891
generateInstanceProtocolDocumentationForClass:aClass
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   892
    |shortName|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   893
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   894
    shortName := aClass nameWithoutPrefix.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   895
    instanceProtocolCategories notEmpty ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   896
        outStream nextPutLine:'<li><a href="#INSTANCEPROTOCOL" name="I_INSTANCEPROTOCOL">Instance protocol</a>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   897
        outStream nextPutLine:'<ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   898
        instanceProtocolCategories do:[:cat |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   899
            outStream nextPutLine:'<li><a name="I_' , shortName , '_category_' , cat , '"' ,
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   900
                                     ' href="#' , shortName , '_category_' , cat ,
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   901
                                     '">' , cat , '</a> '.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   902
        ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   903
        outStream nextPutLine:'</ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   904
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   905
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   906
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   907
generatePrivateClassInfoForClass:aClass withPrivateClasses:privateClasses
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   908
    outStream nextPutLine:'<pre>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   909
    privateClasses do:[:cls |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   910
        |nm fullName|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   911
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   912
        nm := cls nameWithoutPrefix.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   913
        fullName := cls name.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   914
        outStream nextPutAll:'    '.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   915
        (cls owningClass isLoaded not
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   916
        or:[cls owningClass wasAutoloaded]) ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   917
            self
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   918
                generateClassDocReferenceFor:fullName 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   919
                text:nm 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   920
                autoloading:(cls owningClass name)
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   921
        ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   922
            self 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   923
                generateClassDocReferenceFor:fullName 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   924
                text:nm.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   925
        ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   926
        outStream cr.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   927
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   928
    outStream nextPutLine:'</pre>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   929
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   930
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   931
generateRefLineFor:ref forClass:aClass
4469
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   932
    |idx1 idx2 realRef ns nm href selString clsName|
1337
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   933
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   934
    outStream nextPutAll:'    '.
1337
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   935
4469
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   936
    (ref startsWith:'#') ifTrue:[
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   937
        idx2 := (ref indexOfSeparatorStartingAt:2).
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   938
        idx2 == 0 ifTrue:[idx2 := ref size] ifFalse:[idx2 := idx2-1].
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   939
        selString := ref copyFrom:2 to:idx2.
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   940
        (idx1 := ref indexOfString:'method in ' caseSensitive:false) ~~ 0 ifTrue:[
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   941
            clsName := ref copyFrom:idx1 + 'method in ' size.
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   942
            clsName := clsName withoutSuffix:'.'.
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   943
        ].
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   944
        self generateClassDocReferenceFor:clsName 
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   945
             text:('Implementation of: ',selString, ' in ',clsName) 
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   946
             autoloading:nil.
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   947
        ^ self
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   948
    ].
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
   949
1337
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   950
    idx1 := ref indexOf:$:.
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   951
    idx2 := ref indexOf:$: startingAt:idx1+1.
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   952
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   953
    (idx1 == 0 or:[idx2 == (idx1+1)]) ifTrue:[
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   954
        (ref includesMatchCharacters) ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   955
            outStream nextPutAll:(self 
1337
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   956
                        anchorForHTMLDocAction:
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   957
                            ('htmlClassesMatching:''' , ref , ''' backTo:nil')
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   958
                        info:
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   959
                            ( 'Show documentation of ' , ref )
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   960
                        text:
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   961
                            ref).
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   962
            ^ self
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   963
        ].
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   964
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   965
        realRef := ref.
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   966
        ((ns := aClass nameSpace) notNil and:[ns ~~ Smalltalk]) ifTrue:[
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   967
            ns isNameSpace ifTrue:[
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   968
                (ns at:realRef asSymbol) notNil ifTrue:[
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   969
                    realRef := ns name , '::' , realRef
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   970
                ]
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   971
            ]
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   972
        ].
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   973
        self generateClassDocReferenceFor:realRef text:ref.
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   974
        ^ self
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   975
    ].
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   976
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   977
    (ref startsWith:'http:') ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   978
        outStream nextPutAll:'<a href="' , ref , '"><I>' , ref , '</I></a>'.
1337
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   979
        ^ self.
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   980
    ].
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   981
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   982
    nm := (ref copyFrom:2 to:idx1-1) withoutSpaces.
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   983
    href := (ref copyFrom:(ref indexOf:$:)+1 to:(ref size - 1)) withoutSpaces.
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   984
    (href startsWith:'man:') ifTrue:[
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   985
        href := (href copyFrom:5) withoutSpaces.
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
   986
        outStream nextPutAll:'<a INFO="Show manual page" href="' , self pathToTopOfDocumentation , '/misc/onlyInSTX2.html" action="html:' , self className , ' manPageFor:''' , href , '''">[<I>' , nm , '</I>]</A>'.
1337
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   987
        ^ self.
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   988
    ].
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   989
    (href startsWith:'http:') ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   990
        outStream nextPutAll:'<a href="' , href , '">[<I>' , nm , '</I>]</a>'.
1337
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   991
        ^ self
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   992
    ].
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   993
    (href startsWith:'html:') ifTrue:[
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   994
        href := (href copyFrom:6) withoutSpaces.
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   995
    ].                                             
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
   996
    outStream nextPutAll:'<a href="' , (self pathToDocumentationFile:href) , '">[<I>' , nm , '</I>]</a>'.
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
   997
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
   998
    "Modified: / 28-06-2019 / 09:01:50 / Claus Gittinger"
1337
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
   999
!
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  1000
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1001
generateRefLines:refLines forClass:aClass
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1002
    outStream nextPutLine:'<pre>'.
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1003
    refLines do:[:l |
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1004
        l isString ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1005
            self generateRefLineFor:l forClass:aClass.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1006
            outStream cr.
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1007
        ] ifFalse:[
4469
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
  1008
            (l asString startsWith:'#') ifTrue:[
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
  1009
                self generateRefLineFor:(l asStringWith:' ') forClass:aClass.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1010
                outStream cr.
4469
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
  1011
            ] ifFalse:[
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
  1012
                l do:[:ref |
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
  1013
                    self generateRefLineFor:ref forClass:aClass.
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
  1014
                    outStream cr.
9d57ab1b91ff #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4450
diff changeset
  1015
                ].
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1016
            ].
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1017
        ].
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1018
    ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1019
    outStream nextPutLine:'</pre>'.
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1020
!
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1021
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1022
generateSubclassInfoForClass:aClass
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1023
    |subs|
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1024
1974
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  1025
    subs := self shownSubclassesOf:aClass. 
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1026
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1027
    outStream nextPutLine:'<pre>'.
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1028
    subs do:[:cls |
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1029
        |nm|
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1030
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1031
        nm := cls name.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1032
        outStream nextPutAll:'    '.
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1033
        cls isLoaded ifFalse:[
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1034
            self 
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1035
                generateClassDocReferenceFor:nm
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1036
                text:nm
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1037
                autoloading:nm
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1038
        ] ifTrue:[
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1039
            self generateClassDocReferenceFor:nm.
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1040
        ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1041
        outStream cr.
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1042
    ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1043
    outStream nextPutLine:'</pre>'.
1973
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1044
1974
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  1045
    "Modified: / 05-11-2007 / 17:22:43 / cg"
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1046
! !
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1047
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1048
!HTMLDocGenerator methodsFor:'document generation-API'!
1312
88d8f1ea1645 fields / urlParameters vs. arguments
Claus Gittinger <cg@exept.de>
parents: 1311
diff changeset
  1049
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1050
htmlDocOf:aClass
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1051
    "generate an HTML document string which contains a classes documentation"
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1052
4002
0512a9495835 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4001
diff changeset
  1053
    ^ self htmlDocOf:aClass theNonMetaclass back:nil backRef:nil
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1054
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1055
    "
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1056
     self htmlDocOf:PostscriptPrinterStream
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1057
    "
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1058
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1059
    "Modified: / 30.10.1997 / 13:22:19 / cg"
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1060
!
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1061
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1062
htmlDocOf:aClass back:backCmd
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1063
    "generate an HTML document string which contains a classes documentation"
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1064
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1065
    ^ self htmlDocOf:aClass back:backCmd backRef:nil
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1066
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1067
    "Modified: / 30.10.1997 / 13:22:27 / cg"
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1068
!
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1069
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1070
htmlDocOf:aClass back:backCmd backRef:backRef
540
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1071
    "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
  1072
     to a command or document.
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1073
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1074
     Extract sections from the classes documentation method,
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1075
     where the following lines start a special subsection:
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1076
        [see also:]   - references to other classes and/or documents
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1077
        [start with:] - one-liners to start a demonstration
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1078
        [author:]     - author(s) of this class
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1079
        [warning:]    - usage warnings if any
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1080
        [hints:]      - usage hints if any
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1081
     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
  1082
     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
  1083
     to an empty line.
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1084
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1085
     Also extract examples from the classes example method,
540
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1086
     where executable examples are made from sections enclosed in:
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1087
        [exBegin]
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1088
        ...
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1089
        [exEnd]
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1090
     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
  1091
     everything else is plain documentation text.
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1092
    "
907
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1093
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1094
    ^ self
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1095
        htmlDocOf:aClass 
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1096
        back:backCmd 
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1097
        backRef:backRef 
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  1098
        imagePath:(self pathToTopOfDocumentation , '/icons')
907
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1099
!
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1100
1328
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1101
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
  1102
    "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
  1103
     to a command or document.
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1104
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1105
     Extract sections from the classes documentation method,
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1106
     where the following lines start a special subsection:
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1107
        [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
  1108
        [start with:] - one-liners to start a demonstration
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1109
        [author:]     - author(s) of this class
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1110
        [warning:]    - usage warnings if any
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1111
        [hints:]      - usage hints if any
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1112
     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
  1113
     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
  1114
     to an empty line.
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1115
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1116
     Also extract examples from the classes example method,
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1117
     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
  1118
        [exBegin]
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1119
        ...
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1120
        [exEnd]
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1121
     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
  1122
     everything else is plain documentation text.
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1123
    "
540
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1124
        
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1125
    |docu examples wasLoaded didLoadBin
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1126
     privateClasses owner ownerName shortName |
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1127
1328
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1128
    backRef := backRefArg.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1129
    backCmd := backCmdArg.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1130
    imagePath := imagePathArg.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1131
600
b9fdce6b6a16 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
  1132
    aClass isNil ifTrue:[
b9fdce6b6a16 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
  1133
        ^ ''  "/ just in case ...
b9fdce6b6a16 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
  1134
    ].
b9fdce6b6a16 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
  1135
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1136
    outStream := '' writeStream.
1328
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1137
    shortName := aClass nameWithoutPrefix.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1138
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1139
    self generateHTMLHeadWithTitle:('Class: ' , aClass name).
1328
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1140
    self generateBODYStart.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1141
    self generateBackButton.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1142
1896
ed785b09f5b1 changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  1143
    (aClass isRealNameSpace) ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1144
        outStream 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1145
            nextPutLine:'<h1>';
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1146
            nextPutAll:'NameSpace: ';
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1147
            nextPutLine:(shortName);
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1148
            nextPutLine:'</h1>'.
1328
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1149
        self generateBODYandHTMLEnd.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1150
        ^ outStream contents.
1328
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1151
    ].
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  1152
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1153
    (wasLoaded := aClass isLoaded) ifFalse:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1154
        "/ load it - but not a binary
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1155
        didLoadBin := Smalltalk loadBinaries.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1156
        Smalltalk loadBinaries:false.
530
d27016ae003f try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1157
        [
1256
2f8a6448cbac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
  1158
            Autoload autoloadFailedSignal handle:[:ex |
1309
86f8beaae95a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1308
diff changeset
  1159
                ^ 'Autoload of ' , aClass name , ' failed - no documentation available.'
1256
2f8a6448cbac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
  1160
            ] do:[
2f8a6448cbac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
  1161
                aClass autoload.
2f8a6448cbac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
  1162
            ].
1140
96ccc944d23a #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  1163
        ] ensure:[
530
d27016ae003f try harder to extract some source info (module & directory)
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1164
            didLoadBin ifTrue:[Smalltalk loadBinaries:true].
1256
2f8a6448cbac *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
  1165
        ].
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1166
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1167
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1168
    owner := aClass owningClass.
569
a28e63358685 new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 553
diff changeset
  1169
    privateClasses := aClass privateClassesSorted.
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1170
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1171
    docu := self extractDocumentationFromClass:aClass.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1172
    "/ refLines, demoLines etc. are generated as a side effect.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1173
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1174
    examples := self extractExamplesFromClass:aClass.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1175
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1176
    self extractProtocolCategoriesFrom:aClass.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1177
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1178
    outStream nextPutLine:'<h1>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1179
    outStream nextPutAll:'Class: '.
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  1180
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  1181
    self generatingForSTXBrowser ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1182
        outStream 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1183
            nextPutAll:'<a INFO="Open a Browser on ' , shortName , '" type="example" action="Smalltalk browseInClass:' , aClass name , '">';
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1184
            nextPutAll:shortName; nextPutLine:'</a>'.
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  1185
    ] ifFalse:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1186
        outStream nextPutAll:shortName.
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  1187
    ].
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1188
    owner notNil ifTrue:[
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1189
        ownerName := owner nameWithoutPrefix.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1190
        outStream nextPutAll:' (private in '.
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  1191
        self generatingForSTXBrowser ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1192
            outStream 
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1193
                nextPutAll:'<a INFO="Open a Browser on ' , ownerName , '" type="example" action="Smalltalk browseInClass:' , owner name , '">';
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1194
                nextPutAll:(ownerName); nextPutLine:'</a>)'.
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  1195
        ] ifFalse:[
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1196
            outStream nextPutAll:ownerName.
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  1197
        ].
523
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  1198
    ] ifFalse:[
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  1199
        aClass nameSpace ~~ Smalltalk ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1200
            outStream nextPutAll:' (in ' , aClass nameSpace name , ')'
523
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  1201
        ]
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1202
    ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1203
    outStream nextPutLine:'</h1>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1204
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1205
    owner notNil ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1206
        outStream nextPutLine:'This class is only visible from within'.
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1207
        outStream nextPutAll:ownerName.
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1208
        owner owningClass notNil ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1209
            outStream nextPutAll:' (which is itself a private class of '.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1210
            outStream nextPutAll:owner owningClass nameWithoutPrefix.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1211
            outStream nextPutAll:')'
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1212
        ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1213
        outStream nextPutLine:'.'
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1214
    ].
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1215
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1216
    "/
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1217
    "/ index
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1218
    "/
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1219
"/    s nextPutAll:'Index:'; cr.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1220
    outStream nextPutLine:'<ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1221
    outStream 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
  1222
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1223
    docu notNil ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1224
        outStream nextPutLine:'<li><a href="#DESCRIPTION" name="I_DESCRIPTION">Description</a>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1225
    ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1226
    warnLines notEmptyOrNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1227
        outStream nextPutLine:'<li><a href="#WARNING" name="I_WARNING">Warning</a>'.
540
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1228
    ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1229
    hintLines notEmptyOrNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1230
        outStream nextPutLine:'<li><a href="#HINTS" name="I_HINTS">Hints</a>'.
540
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1231
    ].
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1232
    refLines notNil ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1233
        outStream nextPutLine:'<li><a href="#SEEALSO" name="I_SEEALSO">Related information</a>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1234
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1235
511
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  1236
"/    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
  1237
"/    s nextPutLine:'<li><a href="#CLASSVARIABLES" name="I_CLASSVARIABLES">Class variables</a>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1238
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1239
    self generateClassProtocolDocumentationForClass:aClass.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1240
    self generateInstanceProtocolDocumentationForClass:aClass.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1241
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1242
    privateClasses notEmptyOrNil ifTrue:[
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1243
        privateClasses := privateClasses asOrderedCollection sort:[:a :b | a nameWithoutPrefix < b nameWithoutPrefix].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1244
        outStream nextPutLine:'<li><a href="#PRIVATECLASSES" name="I_PRIVATECLASSES">Private classes</a>'.
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1245
    ].
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1246
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1247
    (aClass == Object or:[aClass == Autoload]) ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1248
        outStream nextPutLine:'<li><a href="#SUBCLASSES" name="I_SUBCLASSES">Subclasses</a>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1249
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1250
    demoLines notNil ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1251
        outStream nextPutLine:'<li><a href="#DEMOSTARTUP" name="I_DEMOSTARTUP">Demonstration</a>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1252
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1253
    examples notNil ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1254
        outStream nextPutLine:'<li><a href="#EXAMPLES" name="I_EXAMPLES">Examples</a>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1255
    ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1256
    outStream nextPutLine:'</ul>'.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1257
    self generateHorizontalLine.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1258
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1259
    "/
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1260
    "/ hierarchy
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1261
    "/
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1262
    self generateInheritanceTreeForClass:aClass.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1263
    self generateHorizontalLine.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1264
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1265
    "/
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1266
    "/ category, version & package
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1267
    "/
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1268
    self generateClassInfoForClass:aClass.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1269
    self generateHorizontalLine.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1270
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1271
    self generateDescription:docu.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1272
540
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1273
    warnLines notNil ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1274
        outStream nextPutLine:'<h2><a name="WARNING" href="#I_WARNING">Warning:</A></h2>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1275
        outStream nextPutLine:'<BR>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1276
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1277
        outStream nextPutLine:'<pre>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1278
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1279
        warnLines := self undentedToFirstLinesIndent:warnLines.
2865
26cab9b4c19e withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
  1280
        outStream nextPutAllLines:warnLines.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1281
        outStream nextPutLine:'</pre>'.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1282
        self generateHorizontalLine.
540
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
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1285
    hintLines notNil ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1286
        outStream nextPutLine:'<h2><a name="HINTS" href="#I_HINTS">Hints:</A></h2>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1287
        outStream nextPutLine:'<BR>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1288
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1289
        outStream nextPutLine:'<pre>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1290
        hintLines := self undentedToFirstLinesIndent:hintLines.
540
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1291
2865
26cab9b4c19e withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
  1292
        outStream nextPutAllLines:hintLines.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1293
        outStream nextPutLine:'</pre>'.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1294
        self generateHorizontalLine.
540
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1295
    ].
c20e12db0340 added optional Warning & Hints sections
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1296
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1297
    "/
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1298
    "/ see also
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1299
    "/
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1300
    refLines notNil ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1301
        outStream nextPutLine:'<h2><a name="SEEALSO" href="#I_SEEALSO">Related information:</A></h2>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1302
        self generateRefLines:refLines forClass:aClass.        
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1303
        self generateHorizontalLine.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1304
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1305
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1306
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1307
    "/
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1308
    "/ inst & classVars
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1309
    "/ to be added
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1310
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1311
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1312
    "/
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1313
    "/ protocol
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1314
    "/
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1315
    self printOutHTMLProtocolOf:aClass on:outStream.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1316
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1317
    "/
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1318
    "/ subclasses (only for Object and Autoload)
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1319
    "/
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1320
    (aClass == Object or:[aClass == Autoload]) ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1321
        outStream nextPutLine:'<h2><a name="SUBCLASSES" href="#I_SUBCLASSES">Subclasses (direct subclasses only):</A></h2>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1322
        self generateSubclassInfoForClass:aClass.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1323
        self generateHorizontalLine.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1324
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1325
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1326
    "/
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1327
    "/ private classes
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1328
    "/
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1329
    privateClasses notEmptyOrNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1330
        outStream nextPutLine:'<h2><a name="PRIVATECLASSES" href="#I_PRIVATECLASSES">Private classes:</A></h2>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1331
        self generatePrivateClassInfoForClass:aClass withPrivateClasses:privateClasses.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1332
        self generateHorizontalLine.
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1333
    ].
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1334
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1335
    "/ demonstration, if there are any
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1336
    demoLines notNil ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1337
        self generateDemo.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1338
        self generateHorizontalLine.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1339
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1340
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1341
    "/ examples, if there are any
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1342
    examples notNil ifTrue:[
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  1343
        self generateExamples:examples.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1344
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1345
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  1346
    self generateBODYandHTMLEnd.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1347
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1348
    wasLoaded ifFalse:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1349
        aClass unload
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1350
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1351
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1352
    ^ outStream contents
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1353
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1354
    "
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1355
     self htmlDocOf:Object
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1356
     self htmlDocOf:Array
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1357
     self htmlDocOf:Filename
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1358
     self htmlDocOf:Block
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1359
    "
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1360
1896
ed785b09f5b1 changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents: 1435
diff changeset
  1361
    "Created: / 24-04-1996 / 15:01:59 / cg"
2865
26cab9b4c19e withWriteCursorDo
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
  1362
    "Modified: / 27-07-2012 / 09:29:45 / cg"
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1363
!
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1364
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1365
htmlDocOf:aClass backRef:backRef
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1366
    "generate an HTML document string which contains a classes documentation"
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1367
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1368
    ^ self htmlDocOf:aClass back:nil backRef:backRef
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1369
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1370
    "Created: / 24.4.1996 / 15:03:25 / cg"
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1371
    "Modified: / 30.10.1997 / 13:23:12 / cg"
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1372
!
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1373
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1374
htmlDocOfImplementorsOf:selector
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1375
    "generate an HTML document string which contains HREFS
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1376
     to all implementors of a particular selector"
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1377
727
1729dca2ab7a sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents: 650
diff changeset
  1378
    |sel s classes|
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1379
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1380
    sel := self withSpecialHTMLCharactersEscaped:selector.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1381
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1382
    outStream := s := '' writeStream.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1383
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1384
    self generateHTMLHeadWithTitle:('Implementations of: ' , sel).
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  1385
    self generateBODYStart.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  1386
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1387
    self generateUpArrowButtonForTop.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1388
    self generateHorizontalLine.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1389
    self generateH1:sel.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1390
511
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  1391
    s nextPutLine:'<dl>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1392
727
1729dca2ab7a sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents: 650
diff changeset
  1393
    classes := IdentitySet new.
1729dca2ab7a sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents: 650
diff changeset
  1394
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1395
    sel := selector asSymbol.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1396
    Smalltalk allClassesAndMetaclassesDo:[:cls |
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1397
        cls isPrivate ifFalse:[
1138
aa7687ec256f implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 917
diff changeset
  1398
            (cls includesSelector:sel) ifTrue:[
727
1729dca2ab7a sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents: 650
diff changeset
  1399
                classes add:cls
499
0aa38b586bd3 care for private classes
Claus Gittinger <cg@exept.de>
parents: 498
diff changeset
  1400
            ]
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1401
        ]
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1402
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1403
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1404
    (classes asOrderedCollection sort:[:a :b | a name < b name]) 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1405
        do:[:cls |
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1406
            self 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1407
                printOutHTMLMethodProtocol:(cls compiledMethodAt:sel) 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1408
                on:s 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1409
                showClassName:true 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1410
                classRef:true.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1411
            s nextPutLine:'<p>'.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1412
        ].
727
1729dca2ab7a sort HTML-page of implemented selectors by className.
Claus Gittinger <cg@exept.de>
parents: 650
diff changeset
  1413
511
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  1414
    s nextPutLine:'</dl>'.
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  1415
    self generateBODYandHTMLEnd.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1416
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1417
    ^ s contents
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1418
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1419
    "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
  1420
    "Modified: / 30.10.1998 / 22:15:30 / cg"
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1421
!
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1422
1435
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1423
htmlDocOfImplementorsOfAnyMatching:selectorPattern
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1424
    "generate an HTML document string which contains HREFS
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1425
     to all implementors of a particular selector"
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1426
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1427
    |s sel classes|
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1428
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1429
    outStream := s := '' writeStream.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1430
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1431
    sel := self withSpecialHTMLCharactersEscaped:selectorPattern.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1432
    self generateHTMLHeadWithTitle:('Implementations of: ' , sel).
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1433
    self generateBODYStart.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1434
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1435
    self generateUpArrowButtonForTop.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1436
    self generateHorizontalLine.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1437
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1438
    self generateH1:sel.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1439
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1440
    s nextPutLine:'<dl>'.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1441
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1442
    classes := IdentitySet new.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1443
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1444
    Smalltalk allClassesAndMetaclassesDo:[:cls |
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1445
        cls isPrivate ifFalse:[
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1446
            (cls methodDictionary keys contains:[:sel | selectorPattern match:sel]) ifTrue:[
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1447
                classes add:cls
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1448
            ]
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1449
        ]
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1450
    ].
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1451
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1452
    (classes asOrderedCollection sort:[:a :b | a name < b name]) 
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1453
        do:[:cls |
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1454
            cls methodDictionary keys do:[:eachSel |
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1455
                (selectorPattern match:eachSel) ifTrue:[
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1456
                    self 
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1457
                        printOutHTMLMethodProtocol:(cls compiledMethodAt:eachSel) 
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1458
                        on:s 
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1459
                        showClassName:true 
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1460
                        classRef:true.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1461
                    s nextPutLine:'<p>'.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1462
                ].
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1463
            ].
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1464
        ].
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1465
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1466
    s nextPutLine:'</dl>'.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1467
    self generateBODYandHTMLEnd.
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1468
a3b5694f60ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
  1469
    ^ s contents
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1470
!
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1471
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1472
htmlOfflineDocOf:aClass
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1473
    "generate an HTML document string which contains a class's documentation for offline reading.
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1474
     Offline reading means that the links to other classes are created as file links,
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1475
     (as opposed to action links, which only work with the builtin doc reader)."
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1476
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1477
    generateDocumentForOfflineReading := true.
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1478
    ^ self 
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1479
        htmlDocOf:aClass back:nil backRef:nil
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1480
        imagePath:(self pathToTopOfDocumentation , '/icons')
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1481
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1482
    "
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1483
     self htmlOfflineDocOf:PostscriptPrinterStream
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  1484
    "
1251
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1485
! !
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1486
1280
f08fe6cf6348 category
Claus Gittinger <cg@exept.de>
parents: 1275
diff changeset
  1487
!HTMLDocGenerator methodsFor:'document generation-helpers'!
1251
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1488
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1489
extractAndRemoveSpecial:pattern from:docu
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1490
    "given a collection of docu lines (from documentation methods comment),
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1491
     extract things like [see also:], [author:] etc.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1492
     If found, remove the lines from the string collection,
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1493
     and return the extracted ones. Otherwise return nil.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1494
     Attention: docu is sideeffectively changed (lines removed)"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1495
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1496
    |srchIdx idx lines l|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1497
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1498
    srchIdx := docu findFirst:[:l | l asLowercase withoutSeparators = pattern].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1499
    srchIdx ~~ 0 ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1500
        lines := OrderedCollection new.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1501
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1502
        idx := srchIdx+1.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1503
        [idx <= docu size] whileTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1504
            l := docu at:idx.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1505
            (l isNil or:[l withoutSeparators size == 0]) ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1506
                idx := docu size + 1.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1507
            ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1508
                l withoutSeparators = '\' ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1509
                    l := ''
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1510
                ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1511
                lines add:l
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1512
            ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1513
            idx := idx + 1.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1514
        ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1515
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1516
        docu removeFromIndex:srchIdx toIndex:srchIdx+lines size
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1517
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1518
    ^ lines
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1519
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1520
    "Created: 25.4.1996 / 14:16:01 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1521
    "Modified: 11.1.1997 / 13:03:38 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1522
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1523
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1524
extractAndRemoveSpecialLinesFromDocumentation:docu
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1525
    "Extract things like [see also:], [author:] etc. from docu
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1526
     If found, remove the lines from the string collection,
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1527
     and leave them in corresponding instVars.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1528
     Attention: docu is sideeffectively changed (lines removed)"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1529
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1530
    "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1531
    "/ search for a [see also:] section
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1532
    "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1533
    refLines := self extractAndRemoveSpecial:'[see also:]' from:docu.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1534
    refLines notNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1535
        "/ care for the special tuple format
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1536
        refLines := refLines collect:[:l | 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1537
                        |t|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1538
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1539
                        ((t := l withoutSeparators) startsWith:'(') ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1540
                            t
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1541
                        ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1542
                            t := l asCollectionOfWords.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1543
                            (t size == 1
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1544
                            and:[ (t first includes:$:) not ]) ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1545
                                t first
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1546
                            ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1547
                                t
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1548
                            ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1549
                        ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1550
                    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1551
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1552
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1553
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1554
    "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1555
    "/ search for a [start with:] section
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1556
    "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1557
    demoLines := self extractAndRemoveSpecial:'[start with:]' from:docu.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1558
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1559
    "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1560
    "/ search for a [author:] section
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1561
    "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1562
    authorLines := self extractAndRemoveSpecial:'[author:]' from:docu.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1563
    authorLines isNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1564
        authorLines := self extractAndRemoveSpecial:'[authors:]' from:docu.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1565
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1566
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1567
    "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1568
    "/ search for a [warning:] section
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1569
    "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1570
    warnLines := self extractAndRemoveSpecial:'[warning:]' from:docu.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1571
    warnLines notNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1572
        warnLines := warnLines asStringCollection.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1573
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1574
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1575
    "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1576
    "/ search for a [hints:] section
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1577
    "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1578
    hintLines := self extractAndRemoveSpecial:'[hints:]' from:docu.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1579
    hintLines isNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1580
        hintLines := self extractAndRemoveSpecial:'[hint:]' from:docu.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1581
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1582
    hintLines notNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1583
        hintLines := hintLines asStringCollection.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1584
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1585
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1586
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1587
extractDocumentationFromClass:aClass
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1588
    |documentationMethod docu|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1589
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1590
    documentationMethod := aClass theMetaclass compiledMethodAt:#documentation.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1591
    documentationMethod notNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1592
        docu := documentationMethod comment.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1593
    ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1594
        "try comment"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1595
        docu := aClass theNonMetaclass comment.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1596
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1597
    docu isEmptyOrNil ifTrue:[ ^ nil ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1598
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1599
    docu := self withSpecialHTMLCharactersEscaped:docu.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1600
    docu := docu asStringCollection.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1601
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1602
    self extractAndRemoveSpecialLinesFromDocumentation:docu.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1603
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1604
    docu notEmpty ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1605
        "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1606
        "/ strip off empty lines
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1607
        "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1608
        [docu notEmpty and:[ docu first size == 0]] whileTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1609
            docu removeFirst
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1610
        ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1611
        [docu notEmpty and:[ docu last size == 0]] whileTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1612
            docu removeLast
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1613
        ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1614
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1615
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1616
    docu notEmpty ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1617
        docu := self undentedToFirstLinesIndent:docu.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1618
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1619
    docu := docu asString.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1620
    ^ docu
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1621
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1622
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1623
extractExamplesFromClass:aClass
4484
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1624
    |m examples lines makePre isHtml|
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1625
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1626
    m := aClass theMetaclass compiledMethodAt:#examples.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1627
    m isNil ifTrue:[ ^ nil].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1628
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1629
    examples := m comment.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1630
    examples isEmptyOrNil ifTrue:[ ^ nil].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1631
4484
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1632
    makePre := isHtml := false.
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1633
    lines := examples asStringCollection.
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1634
    (lines first withoutSeparators = '<pre>') ifTrue:[
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1635
        makePre := true.
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1636
        lines removeFirst.
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1637
        (lines last withoutSeparators = '</pre>') ifTrue:[ 
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1638
            lines removeLast.
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1639
        ].
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1640
        examples := lines asString.
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1641
    ] ifFalse:[
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1642
        (lines first withoutSeparators = '<html>') ifTrue:[
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1643
            (lines last withoutSeparators = '</html>') ifTrue:[ 
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1644
                lines removeLast.
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1645
            ].
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1646
            ^ lines
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1647
        ].
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1648
    ].
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1649
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1650
    examples := self withSpecialHTMLCharactersEscaped:examples.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1651
    examples := examples asStringCollection.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1652
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1653
    "/
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1654
    "/ strip off empty lines
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1655
    "/
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1656
    [examples notEmpty and:[examples first isEmptyOrNil]] whileTrue:[
2252
cd22e5433333 changed: #extractExamplesFromClass:
Stefan Vogel <sv@exept.de>
parents: 2205
diff changeset
  1657
        examples removeFirst.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1658
    ].
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1659
    [examples notEmpty and:[examples last isEmptyOrNil]] whileTrue:[
2252
cd22e5433333 changed: #extractExamplesFromClass:
Stefan Vogel <sv@exept.de>
parents: 2205
diff changeset
  1660
        examples removeLast.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1661
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1662
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1663
    examples isEmpty ifTrue:[ ^ nil].
4484
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1664
    makePre ifTrue:[
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1665
        examples addFirst:'<pre>'.
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1666
        examples addLast:'</pre>'.
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1667
        ^ examples
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1668
    ] ifFalse:[
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1669
        ^ self undentedToFirstLinesIndent:examples.
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  1670
    ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1671
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1672
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1673
extractProtocolCategoriesFrom:aClass
4247
d7f7ade65b24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4214
diff changeset
  1674
    classProtocolCategories := aClass theMetaclass methodCategories asSortedCollection.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1675
    classProtocolCategories notEmpty ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1676
        classProtocolCategories := classProtocolCategories asSortedCollection.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1677
        classProtocolCategories remove:'documentation' ifAbsent:nil.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1678
    ].
4247
d7f7ade65b24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4214
diff changeset
  1679
    instanceProtocolCategories := aClass theNonMetaclass methodCategories asSortedCollection.
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1680
    instanceProtocolCategories notEmpty ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1681
        instanceProtocolCategories := instanceProtocolCategories asSortedCollection.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1682
    ].
4247
d7f7ade65b24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4214
diff changeset
  1683
d7f7ade65b24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4214
diff changeset
  1684
    "Modified: / 05-07-2017 / 10:51:25 / cg"
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1685
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  1686
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1687
htmlForMethod:arg
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1688
    ^ self class htmlForMethod:arg
1973
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1689
!
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1690
1251
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1691
htmlRevisionDocOf:aClass to:s
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1692
    "extract a classes versionInfo and return an HTML document string
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1693
     for that."
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1694
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1695
    |revInfo pckgInfo text path|
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1696
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1697
    revInfo := aClass revisionInfo.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1698
    pckgInfo := aClass packageSourceCodeInfo.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1699
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1700
    s nextPutLine:'<dl><dt><a name="VERSION"><b>Version:</b></A>'.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1701
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1702
    (revInfo isNil and:[pckgInfo isNil]) ifTrue:[
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1703
        s nextPutLine:'<dd>no revision info'.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1704
    ] ifFalse:[
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1705
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1706
        revInfo isNil ifTrue:[revInfo := IdentityDictionary new].
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1707
        pckgInfo isNil ifTrue:[pckgInfo := IdentityDictionary new].
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1708
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1709
        s nextPutLine:'<dd>rev: <b>'.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1710
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1711
        "/ fetch the revision-info; prefer revisionInfo
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1712
        text := revInfo at:#revision ifAbsent:(pckgInfo at:#revision ifAbsent:'?').
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1713
        s nextPutLine:text.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1714
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1715
        "/ fetch the date & time; prefer revisionInfo
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1716
        text := revInfo at:#date ifAbsent:(pckgInfo at:#date ifAbsent:'?').
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1717
        s nextPutAll:'</b> date: <b>' ,  text.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1718
        text := revInfo at:#time ifAbsent:(pckgInfo at:#time ifAbsent:'?').
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1719
        s nextPutLine:' ', text , '</b>'.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1720
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1721
        text := revInfo at:#user ifAbsent:(pckgInfo at:#user ifAbsent:'?').
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1722
        s nextPutLine:'<dd>user: <b>' , text , '</b>'.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1723
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1724
        text := revInfo at:#fileName ifAbsent:(pckgInfo at:#fileNamer ifAbsent:'?').
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1725
        s nextPutAll:'<dd>file: <b>' , text.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1726
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1727
        text := revInfo at:#directory ifAbsent:(pckgInfo at:#directory ifAbsent:nil).
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1728
        text isNil ifTrue:[
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1729
            path := revInfo at:#repositoryPathName ifAbsent:(pckgInfo at:#repositoryPathName ifAbsent:nil).
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1730
            path notNil ifTrue:[
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1731
                SourceCodeManager notNil ifTrue:[
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
  1732
                    text := SourceCodeManager directoryFromContainerPath:path forClass:aClass.
1251
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1733
                ].
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1734
                text isNil ifTrue:[text := '?'].
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1735
            ] ifFalse:[
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1736
                text := '?'
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1737
            ]
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1738
        ].
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1739
        s nextPutLine:'</b> directory: <b>' , text , '</b>'.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1740
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1741
        text := revInfo at:#module ifAbsent:(pckgInfo at:#module ifAbsent:nil).
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1742
        text isNil ifTrue:[
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1743
            path := revInfo at:#repositoryPathName ifAbsent:(pckgInfo at:#repositoryPathName ifAbsent:nil).
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1744
            path notNil ifTrue:[
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1745
                SourceCodeManager notNil ifTrue:[
1346
8657706d79ba generation of relative-path in CVS fixed
Claus Gittinger <cg@exept.de>
parents: 1344
diff changeset
  1746
                    text := SourceCodeManager moduleFromContainerPath:path forClass:aClass.
1251
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1747
                ].
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1748
                text isNil ifTrue:[text := '?'].
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1749
            ] ifFalse:[
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1750
                text := '?'
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1751
            ]
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1752
        ].
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1753
        s nextPutAll:'<dd>module: <b>' , text.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1754
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1755
        text := revInfo at:#library ifAbsent:(pckgInfo at:#library ifAbsent:'*none*').
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1756
        s nextPutLine:'</b> stc-classLibrary: <b>' ,  text , '</b>'.
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1757
    ].
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1758
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1759
    "Created: / 8.1.1997 / 13:43:28 / cg"
fcaab40b336c refactored
Claus Gittinger <cg@exept.de>
parents: 1250
diff changeset
  1760
    "Modified: / 30.10.1997 / 13:24:39 / cg"
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1761
!
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1762
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1763
printOutHTMLCategoryProtocol:aCategory of:aClass on:aStream
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1764
    "append documentation on each method in a particular methodCategory
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1765
     of the given class in HTML onto aStream."
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1766
523
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  1767
    |any dict selectors methods shortName|
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  1768
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  1769
    shortName := aClass nameWithoutPrefix.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1770
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1771
    dict := aClass methodDictionary.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1772
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1773
    dict notNil ifTrue:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1774
        any := false.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1775
        dict do:[:aMethod |
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1776
            (aCategory = aMethod category) ifTrue:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1777
                any := true
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1778
            ]
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1779
        ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1780
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1781
        any ifTrue:[
523
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  1782
            aStream nextPutLine:'<a name="' , shortName , '_category_' , aCategory ,
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  1783
                                     '" href="#I_' , shortName , '_category_' , aCategory ,
511
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  1784
                                     '"><b>' , aCategory , '</b></A>'.
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  1785
            aStream nextPutLine:'<dl>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1786
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1787
            selectors := dict keys asArray.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1788
            methods := dict values.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1789
            selectors sortWith:methods.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1790
            methods do:[:aMethod |
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1791
                (aCategory = aMethod category) ifTrue:[
1216
b854fdc89d2a Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 1178
diff changeset
  1792
                    Error catch:[
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1793
                        self printOutHTMLMethodProtocol:aMethod on:aStream.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1794
                    ].
511
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  1795
                    aStream nextPutLine:'<p>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1796
                ]
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1797
            ].
511
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  1798
            aStream nextPutLine:'</dl>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1799
        ]
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1800
    ]
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1801
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1802
    "
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1803
      self printOutHTMLProtocolOf:Float on:Stdout 
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1804
    "
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1805
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1806
    "Created: / 22.4.1996 / 20:03:30 / cg"
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1807
    "Modified: / 5.6.1996 / 13:41:27 / stefan"
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1808
    "Modified: / 30.10.1997 / 13:27:58 / cg"
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1809
!
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1810
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1811
printOutHTMLMethodProtocol:aMethod on:aStream
4263
ebbb964eda02 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  1812
    "given the source in aString, print the method's message specification
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1813
     and any method comments - without source; used to generate documentation
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1814
     pages"
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1815
907
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1816
    ^ self 
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1817
        printOutHTMLMethodProtocol:aMethod 
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1818
        on:aStream 
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1819
        showClassName:false 
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1820
        classRef:false
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1821
4263
ebbb964eda02 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  1822
    "Modified: / 22-04-1996 / 18:01:56 / cg"
ebbb964eda02 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  1823
    "Created: / 22-04-1996 / 20:03:30 / cg"
ebbb964eda02 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  1824
    "Modified (comment): / 21-11-2017 / 13:01:48 / cg"
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1825
!
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1826
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1827
printOutHTMLMethodProtocol:aMethod on:aStream showClassName:showClassName classRef:withClassRef
4263
ebbb964eda02 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  1828
    "given the source in aString, print the method's message specification
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1829
     and any method comments - without source; used to generate documentation
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1830
     pages"
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1831
1344
2418cf5d1b3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1343
diff changeset
  1832
    |p|
2418cf5d1b3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1343
diff changeset
  1833
2418cf5d1b3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1343
diff changeset
  1834
"/    p := imagePath.
2418cf5d1b3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1343
diff changeset
  1835
"/    p isNil ifTrue:[
2418cf5d1b3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1343
diff changeset
  1836
"/        p := self pathToTopOfDocumentation , '/icons' 
2418cf5d1b3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1343
diff changeset
  1837
"/    ].
2418cf5d1b3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1343
diff changeset
  1838
    p := self pathToTopOfDocumentation , '/pictures'.
907
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1839
    ^ self
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1840
        printOutHTMLMethodProtocol:aMethod 
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1841
        on:aStream 
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1842
        showClassName:showClassName 
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1843
        classRef:withClassRef 
1344
2418cf5d1b3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1343
diff changeset
  1844
        picturePath:p
4263
ebbb964eda02 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  1845
ebbb964eda02 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4250
diff changeset
  1846
    "Modified (comment): / 21-11-2017 / 13:01:53 / cg"
907
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1847
!
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1848
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1849
printOutHTMLMethodProtocol:aMethod on:aStream showClassName:showClassName classRef:withClassRef picturePath:picturePath
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1850
    "given the source in aString, print the method's message specification
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1851
     and any method comments - without source.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1852
     used to generate documentation pages"
907
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1853
1973
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1854
    |comment cls sel who methodSpecLine 
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1855
     firstIndent firstNonEmpty isSubres isObsolete smallOrEmpty
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1856
     ballColor anchorName parseTree expr obsoleteInfo 
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1857
     exampleComments isInheritedComment|
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1858
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1859
    who := aMethod who.
505
d8d7556d05ee use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents: 500
diff changeset
  1860
    cls := who methodClass.
d8d7556d05ee use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents: 500
diff changeset
  1861
    sel := who methodSelector.
1973
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1862
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1863
    methodSpecLine := self htmlForMethod:aMethod.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1864
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1865
    "/ use string-asSymbol (instead of the obvious symbol itself)
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1866
    "/ in the checks below, to avoid tricking myself,
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1867
    "/ when the documentation on this method is generated
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1868
    "/ (otherwise, I'll say that this method is both
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1869
    "/  a subres and and obsolete method ...)
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1870
4250
09f5bd70b365 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4247
diff changeset
  1871
    isSubres := aMethod isSubclassResponsibility.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1872
1973
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1873
    isObsolete := aMethod isObsolete.
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1874
    "/ the above checks for the obsolete-resource flag;
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1875
    "/ there is still achance for obsoleteMethodWarning to be sent, without the resource flag being present.
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1876
    isObsolete ifFalse:[
4200
580aca244892 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
  1877
        (aMethod sendsAnySelector:#(#'obsoleteMethodWarning' #'obsoleteMethodWarning:' #'obsoleteMethodWarning:from:')) ifTrue:[
1973
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1878
            (sel startsWith:'obsoleteMethodWarning') ifFalse:[
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1879
                true "cls ~~ Object" ifTrue:[
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1880
                    isObsolete := true.
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1881
                    ParseTreeSearcher notNil ifTrue:[
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1882
                        parseTree := cls parseTreeFor:sel.
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1883
                        parseTree notNil ifTrue: [
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1884
                            expr := ParseTreeSearcher treeMatching:'`@e1 obsoleteMethodWarning:`@e2' in: parseTree.
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1885
                            expr isNil ifTrue:[
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1886
                                expr := ParseTreeSearcher treeMatching:'`@e1 obsoleteMethodWarning:`@e2 from:`@e3' in: parseTree.
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1887
                            ].
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1888
                            expr notNil ifTrue:[
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1889
                                |arg1|
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1890
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1891
                                arg1 := expr arguments first.
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1892
                                arg1 isLiteral ifTrue:[
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1893
                                    arg1 value isString ifTrue:[
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1894
                                        obsoleteInfo := arg1 value.
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1895
                                    ].
1400
2281a5920b71 extract argument of obsoleteMethodWarning and show it
ca
parents: 1363
diff changeset
  1896
                                ].
2281a5920b71 extract argument of obsoleteMethodWarning and show it
ca
parents: 1363
diff changeset
  1897
                            ].
2281a5920b71 extract argument of obsoleteMethodWarning and show it
ca
parents: 1363
diff changeset
  1898
                        ].
2281a5920b71 extract argument of obsoleteMethodWarning and show it
ca
parents: 1363
diff changeset
  1899
                    ].
2281a5920b71 extract argument of obsoleteMethodWarning and show it
ca
parents: 1363
diff changeset
  1900
                ].
1973
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1901
            ]
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  1902
        ].
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1903
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1904
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1905
    smallOrEmpty := ''.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1906
    aMethod isPrivate ifTrue:[
642
077371c28483 oops - missing trailing dQuotes - html output failed on netscape
dq
parents: 637
diff changeset
  1907
        methodSpecLine :=  '<i>private</i> ' , methodSpecLine.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1908
"/        smallOrEmpty := '-small'.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1909
    ] ifFalse:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1910
        aMethod isProtected ifTrue:[
642
077371c28483 oops - missing trailing dQuotes - html output failed on netscape
dq
parents: 637
diff changeset
  1911
            methodSpecLine := '<i>protected</i> ' , methodSpecLine.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1912
"/            smallOrEmpty := '-small'.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1913
        ] ifFalse:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1914
            aMethod isIgnored ifTrue:[
642
077371c28483 oops - missing trailing dQuotes - html output failed on netscape
dq
parents: 637
diff changeset
  1915
                methodSpecLine := '[ ' , methodSpecLine , ' ] (<i>invisible</i>)'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1916
"/                smallOrEmpty := '-small'.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1917
            ]
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1918
        ]
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1919
    ].
4051
040ec6b50195 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  1920
    aMethod isExtension ifTrue:[
040ec6b50195 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  1921
        methodSpecLine := methodSpecLine,(' <br>( <i>an extension from the %1 package</i> )' bindWith:aMethod package).
040ec6b50195 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
  1922
    ].
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1923
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1924
    aStream nextPutLine:'<DT>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1925
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1926
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1927
    cls isMeta ifTrue:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1928
        ballColor := 'yellow'
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1929
    ] ifFalse:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1930
        ballColor := 'red'
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1931
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1932
907
1a6b647d1b43 picture & icon path (for HTTP server)
Claus Gittinger <cg@exept.de>
parents: 817
diff changeset
  1933
    aStream nextPutLine:'<IMG src="' , picturePath , '/' , ballColor , '-ball' , smallOrEmpty , '.gif" alt="o " width=6 height=6>'.
1335
86e394c615a8 insert space after ball item
penk
parents: 1333
diff changeset
  1934
    aStream nextPutAll:'&nbsp;'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1935
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1936
    sel := self withSpecialHTMLCharactersEscaped:sel.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1937
    anchorName := cls name , '_' , sel.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1938
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1939
    withClassRef ifTrue:[
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  1940
        aStream nextPutAll:(self 
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  1941
                            anchorForHTMLDocAction:
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  1942
                                ('htmlDocOf:', cls theNonMetaclass name )
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  1943
                            info:
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  1944
                                ('Show documentation of ' , cls theNonMetaclass name )
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  1945
                            text:
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  1946
                                cls name
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  1947
                            name:anchorName).
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  1948
        aStream nextPutLine:'&nbsp;' , methodSpecLine.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1949
    ] ifFalse:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1950
        showClassName ifTrue:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1951
            methodSpecLine := cls name , ' ' , methodSpecLine
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1952
        ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1953
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1954
        aStream nextPutLine:'<a name="' , anchorName , '" ' ,
642
077371c28483 oops - missing trailing dQuotes - html output failed on netscape
dq
parents: 637
diff changeset
  1955
"/                                 'href="' , cls name , '_' , sel , '"' ,
511
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  1956
                                 '>' , methodSpecLine , '</a>'.
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1957
        self generateJavaScriptCallInfo ifTrue:[
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1958
            |jsMethodSpecLine|
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1959
            aStream nextPutLine:'<br>JS: ' , (HTMLDocGeneratorForJavaScript htmlForMethod:aMethod).
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1960
        ].
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1961
    ].
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1962
    aStream nextPutLine:'<DD>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1963
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1964
    isInheritedComment := false.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1965
    comment := self methodCommentOf:aMethod.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1966
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1967
    "/ filter history lines
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1968
    ((comment startsWith:'Created: ')
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1969
    or:[ (comment startsWith:'Modified: ') ]) ifTrue:[
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1970
        comment := nil.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1971
    ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1972
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1973
    comment isEmptyOrNil ifTrue:[
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1974
        |m|
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1975
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1976
        m := aMethod mclass superclass lookupMethodFor:aMethod selector.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1977
        m notNil ifTrue:[
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1978
            (comment := self methodCommentOf:m) notEmptyOrNil ifTrue:[
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1979
                isInheritedComment := true.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1980
                ((comment startsWith:'Created: ')
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1981
                or:[ (comment startsWith:'Modified: ') ]) ifTrue:[
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1982
                    comment := nil.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1983
                ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1984
            ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1985
        ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1986
    ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  1987
    comment notNil ifTrue:[
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  1988
        comment := self withSpecialHTMLCharactersEscaped:comment.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1989
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1990
        comment notEmpty ifTrue:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1991
            comment := comment asStringCollection.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1992
            firstIndent := comment first leftIndent.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1993
            firstIndent > 0 ifTrue:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1994
                comment := comment collect:[:line |
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1995
                                        line leftIndent >= firstIndent ifTrue:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1996
                                            line copyFrom:firstIndent.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1997
                                        ] ifFalse:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1998
                                            line
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1999
                                        ]
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2000
                                     ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2001
            ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2002
            firstNonEmpty := comment findFirst:[:line | line notEmpty].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2003
            firstNonEmpty > 1 ifTrue:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2004
                comment := comment copyFrom:firstNonEmpty
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2005
            ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2006
            comment := comment asString.
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2007
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2008
            isInheritedComment ifTrue:[
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2009
                comment := '<I>(comment from inherited method)</I><BR>' , comment.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2010
            ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2011
            "/ make argument names italic in the comment
4495
5f69b603bac0 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4484
diff changeset
  2012
            aMethod argumentCount > 0 ifTrue:[    
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2013
                (aMethod methodArgNames ? #()) do:[:each |
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2014
                    comment := comment copyReplaceString:each withString:'<I>',each,'</I>' 
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2015
                ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2016
                comment := comment copyReplaceString:'<I><I>' withString:'<I>'. 
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2017
                comment := comment copyReplaceString:'</I></I>' withString:'</I>'. 
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2018
            ].
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2019
        ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2020
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2021
        comment asStringCollection do:[:line |
1178
3d3111846c92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1143
diff changeset
  2022
            aStream 
3d3111846c92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1143
diff changeset
  2023
                "/ nextPutAll:'<I>'; 
3d3111846c92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1143
diff changeset
  2024
                nextPutAll:line; 
3d3111846c92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1143
diff changeset
  2025
                "/ nextPutAll:'</I>'; 
3d3111846c92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1143
diff changeset
  2026
                nextPutLine:'<BR>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2027
        ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2028
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2029
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2030
    isSubres ifTrue:[
511
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  2031
        aStream nextPutLine:'<BR>'.
4484
f6a820ac5792 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
  2032
        aStream nextPutLine:'<I>** This method must be redefined in concrete classes (subclassResponsibility) **</I>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2033
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2034
    isObsolete ifTrue:[
511
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  2035
        aStream nextPutLine:'<BR>'.
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  2036
        aStream nextPutLine:'<I>** This is an obsolete interface - do not use it (it may vanish in future versions) **</I>'.
1400
2281a5920b71 extract argument of obsoleteMethodWarning and show it
ca
parents: 1363
diff changeset
  2037
        obsoleteInfo notNil ifTrue:[
2281a5920b71 extract argument of obsoleteMethodWarning and show it
ca
parents: 1363
diff changeset
  2038
            aStream nextPutLine:'<BR>'.
2281a5920b71 extract argument of obsoleteMethodWarning and show it
ca
parents: 1363
diff changeset
  2039
            aStream nextPutLine:'<I>** ' , obsoleteInfo , ' **</I>'.
2281a5920b71 extract argument of obsoleteMethodWarning and show it
ca
parents: 1363
diff changeset
  2040
        ].
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2041
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2042
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2043
    (isSubres | isObsolete) ifFalse:[
4326
8d1d982eb90b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4318
diff changeset
  2044
        [    
8d1d982eb90b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4318
diff changeset
  2045
            exampleComments := self methodExampleCommentsOf:aMethod.
8d1d982eb90b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4318
diff changeset
  2046
        ] valueWithTimeout:10 seconds.
8d1d982eb90b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4318
diff changeset
  2047
        
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2048
        exampleComments notEmptyOrNil ifTrue:[
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2049
            exampleComments do:[:each |
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2050
                |exampleCode|
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2051
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2052
                exampleCode := self undentedToFirstLinesIndent:each asStringCollection.
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2053
                [exampleCode size ~~ 0 and:[(exampleCode first ? '') withoutSeparators isEmpty]]
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2054
                    whileTrue:[ exampleCode removeFirst].
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2055
                [exampleCode size ~~ 0 and:[(exampleCode last ? '') withoutSeparators isEmpty]]
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2056
                    whileTrue:[ exampleCode removeLast].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2057
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2058
                exampleCode notEmpty ifTrue:[
4328
ab11a3cec2bb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4326
diff changeset
  2059
                    "/ outStream nextPutLine:'<blockquote>'.
ab11a3cec2bb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4326
diff changeset
  2060
                    outStream nextPutLine:'<p>usage example(s):'.
4318
3310ef4ccb22 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4267
diff changeset
  2061
                    "/ outStream nextPutLine:'usage example(s):<br>'.
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2062
                    self generateExampleStart.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2063
                    exampleCode do:[:eachLine |
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2064
                        outStream nextPutLine:eachLine
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2065
                    ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2066
                    self generateExampleEnd.
4328
ab11a3cec2bb #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4326
diff changeset
  2067
                    "/ outStream nextPutLine:'</blockquote>'.
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2068
                ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2069
            ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2070
        ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2071
    ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2072
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2073
    "
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2074
     self basicNew
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2075
        printOutHTMLMethodProtocol:(Array compiledMethodAt:#addAllNonNilElementsTo:)
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2076
        on:Transcript 
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2077
        showClassName:true classRef:true picturePath:'pics'
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2078
    "
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  2079
1973
bde3dff41c48 html-doc privacy
Claus Gittinger <cg@exept.de>
parents: 1952
diff changeset
  2080
    "Created: / 22-04-1996 / 20:03:30 / cg"
4250
09f5bd70b365 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4247
diff changeset
  2081
    "Modified: / 16-07-2017 / 11:28:18 / cg"
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2082
    "Modified: / 01-03-2019 / 15:52:32 / Claus Gittinger"
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2083
!
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2084
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2085
printOutHTMLProtocolOf:aClass on:aStream 
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2086
    "append documentation  of the given class in HTML onto aStream."
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2087
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2088
    |collectionOfCategories any|
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2089
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2090
"/    self printOutDefinitionOn:aPrintStream.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2091
4247
d7f7ade65b24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4214
diff changeset
  2092
    collectionOfCategories := aClass class methodCategories asSortedCollection.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2093
    any := false.
523
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  2094
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2095
    collectionOfCategories size ~~ 0 ifTrue:[
523
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  2096
        collectionOfCategories := collectionOfCategories asOrderedCollection.
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  2097
        collectionOfCategories remove:'documentation' ifAbsent:[].
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2098
        collectionOfCategories size ~~ 0 ifTrue:[
523
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  2099
            collectionOfCategories sort.
642
077371c28483 oops - missing trailing dQuotes - html output failed on netscape
dq
parents: 637
diff changeset
  2100
            aStream nextPutLine:'<h2><a name="CLASSPROTOCOL" href="#I_CLASSPROTOCOL">Class protocol:</a></h2>'.
523
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  2101
            collectionOfCategories do:[:aCategory |
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2102
                self printOutHTMLCategoryProtocol:aCategory of:aClass class on:aStream.
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2103
                any := true.
523
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  2104
            ].
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2105
"/        any ifFalse:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2106
"/            aStream nextPutAll:'no new protocol'
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2107
"/        ].
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2108
            self generateHorizontalLine.
523
6a986fe180df handle namespaces
Claus Gittinger <cg@exept.de>
parents: 511
diff changeset
  2109
        ]
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2110
    ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2111
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2112
4247
d7f7ade65b24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4214
diff changeset
  2113
    collectionOfCategories := aClass methodCategories asSortedCollection.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2114
    any := false.
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2115
    collectionOfCategories size ~~ 0 ifTrue:[
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2116
        collectionOfCategories := collectionOfCategories asOrderedCollection sort.
511
ef2631a2cc1c use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents: 505
diff changeset
  2117
        aStream nextPutLine:'<h2><a name="INSTANCEPROTOCOL" href="#I_INSTANCEPROTOCOL">Instance protocol:</A></h2>'.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2118
        collectionOfCategories do:[:aCategory |
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2119
            self printOutHTMLCategoryProtocol:aCategory of:aClass on:aStream
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2120
        ].
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2121
"/        any ifFalse:[
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2122
"/            aStream nextPutAll:'no new protocol'
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2123
"/        ].
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2124
        self generateHorizontalLine.
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2125
    ]
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2126
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2127
    "
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2128
      self printOutHTMLProtocolOf:Float on:Stdout 
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2129
    "
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2130
4247
d7f7ade65b24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4214
diff changeset
  2131
    "Created: / 22-04-1996 / 20:03:30 / cg"
d7f7ade65b24 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4214
diff changeset
  2132
    "Modified: / 05-07-2017 / 10:51:39 / cg"
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2133
    "Modified: / 01-03-2019 / 15:53:20 / Claus Gittinger"
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2134
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2135
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2136
undentedToFirstLinesIndent:someText
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2137
    |undentedText firstIndent firstNonEmpty|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2138
2049
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2139
    undentedText := someText.
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2140
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2141
    someText size ~~ 0 ifTrue:[
2049
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2142
        firstIndent := someText first withTabsExpanded leftIndent.
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2143
        firstIndent > 0 ifTrue:[
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2144
            undentedText := someText collect:[:line |
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2145
                                    |l|
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2146
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2147
                                    l := line withTabsExpanded.
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2148
                                    l leftIndent >= firstIndent ifTrue:[
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2149
                                        l copyFrom:firstIndent + 1.
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2150
                                    ] ifFalse:[
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2151
                                        l
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2152
                                    ]
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2153
                                 ].
95a1fbd779fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2018
diff changeset
  2154
        ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2155
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2156
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2157
    firstNonEmpty := undentedText findFirst:[:line | line notEmpty].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2158
    firstNonEmpty > 1 ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2159
        undentedText := undentedText copyFrom:firstNonEmpty
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2160
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2161
    ^ undentedText
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2162
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2163
    "Modified: / 01-03-2019 / 15:53:11 / Claus Gittinger"
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2164
! !
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2165
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2166
!HTMLDocGenerator methodsFor:'document generation-lists'!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2167
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2168
htmlClassCategoryList
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2169
    "generate a formatted list of all available class categories as
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2170
     an HTML string. Each category will be a hyperlink to another
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2171
     autogenerated page, containing the classes per category.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2172
     The generated page is supposed to be given to an HTML reader
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2173
     with home being set to ../doc/online/xxx/classDoc 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2174
     (i.e. the images are to be found one-up in the doc hierarchy)"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2175
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2176
    |categories s prefixList prefix prefixStack prev|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2177
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2178
    categories := Smalltalk allClassCategories asOrderedCollection sort.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2179
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2180
    outStream := s := '' writeStream.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2181
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2182
    self generateHTMLHeadWithTitle:'Class Categories:'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2183
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2184
    self generateBODYStart.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2185
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2186
    self generateUpArrowButtonForTop.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2187
    self generateHorizontalLine.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2188
    self generateH1:'Class Categories:'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2189
    s nextPutLine:'<ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2190
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2191
    prefixList := Set new.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2192
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2193
    categories keysAndValuesDo:[:index :element |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2194
        |prev common|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2195
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2196
        index ~~ 1 ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2197
            prev := categories at:(index - 1).
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2198
            common := (Array with:prev with:element) longestCommonPrefix.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2199
            (common endsWith:'-') ifTrue:[
3232
de4bd4dcb49f Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  2200
                prefixList add:(common copyButLast:1)
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2201
            ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2202
                (common includes:$-) ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2203
                    prefixList add:(common copyTo:(common lastIndexOf:$-)-1).
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2204
                ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2205
"/                    common = prev ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2206
"/                        prefixList add:common
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2207
"/                    ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2208
                ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2209
            ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2210
        ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2211
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2212
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2213
    prefix := ''. prefixStack := OrderedCollection new. 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2214
    prev := ''.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2215
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2216
    categories := categories select:[:nm | nm ~= 'obsolete'].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2217
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2218
    categories do:[:nm |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2219
        |longest|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2220
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2221
        "/ longest prefix ....
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2222
        longest := prefixList inject:'' into:[:maxPrefix :prefix |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2223
                        |prefixWithDash|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2224
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2225
                        prefixWithDash := prefix , '-'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2226
                        nm = prefix ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2227
                            maxPrefix
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2228
                        ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2229
                            (nm startsWith:prefixWithDash)
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2230
                            ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2231
                                prefixWithDash size > maxPrefix size
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2232
                                ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2233
                                    prefixWithDash
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2234
                                ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2235
                                    maxPrefix
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2236
                                ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2237
                            ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2238
                                maxPrefix
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2239
                            ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2240
                        ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2241
                   ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2242
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2243
        longest size ~~ 0 ifTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2244
            longest = prefix ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2245
                "/ no change
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2246
            ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2247
                (longest startsWith:prefix) ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2248
                    prefixStack addLast:longest.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2249
                    longest ~= prev ifTrue:[    
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2250
                        prefixStack size == 1 ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2251
                            s nextPutLine:'<p>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2252
                        ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2253
                        s nextPutLine:'<li>' , (longest copyFrom:prefix size + 1).
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2254
                    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2255
                    s nextPutLine:'<ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2256
                    prefix := longest.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2257
                ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2258
                    s nextPutLine:'</ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2259
                    prefixStack notEmpty ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2260
                        prefixStack removeLast.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2261
                    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2262
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2263
                    [prefixStack notEmpty
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2264
                     and:[(longest startsWith:prefixStack last) not]] whileTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2265
                        s nextPutLine:'</ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2266
                        prefixStack removeLast.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2267
                    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2268
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2269
                    prefixStack notEmpty ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2270
                        prefix := prefixStack last.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2271
                    ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2272
                        prefixStack addLast:longest.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2273
                        prefix := longest.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2274
                        longest ~= prev ifTrue:[    
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2275
                            prefixStack size == 1 ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2276
                                s nextPutLine:'<p>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2277
                            ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2278
                            s nextPutLine:'<li>' , longest.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2279
                        ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2280
                        s nextPutLine:'<ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2281
                    ] 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2282
                ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2283
            ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2284
        ] ifFalse:[
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2285
            [prefixStack size ~~ 0] whileTrue:[
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2286
                s nextPutLine:'</ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2287
                prefixStack removeLast.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2288
            ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2289
            prefixStack size == 0 ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2290
                s nextPutLine:'<p>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2291
            ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2292
            prefix := ''.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2293
        ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2294
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2295
        s nextPutAll:'<li>'.
3644
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2296
        self generateDocumentForOfflineReading ifTrue:[
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2297
            s nextPutLine:(self 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2298
                        anchorFor:
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2299
                            ((nm copyReplaceAll:$  with:$_) , '/index.html' )
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2300
                        info:
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2301
                            ('Classes in ' , nm)
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2302
                        text:
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2303
                            (nm copyFrom:prefix size + 1)
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2304
                        name:nil).
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2305
        ] ifFalse:[
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2306
            s nextPutLine:(self 
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2307
                        anchorForHTMLDocAction:
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2308
                            ('htmlClassesListOfCategory:''', nm
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2309
                            , ''' backTo:''htmlClassCategoryList''')
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2310
                        info:
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2311
                            ('Classes in ' , nm)
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2312
                        text:
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2313
                            (nm copyFrom:prefix size + 1)).
3644
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2314
        ].
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2315
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2316
        prev := nm.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2317
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2318
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2319
    s nextPutAll:'
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2320
</ul>
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2321
'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2322
    self generateBODYandHTMLEnd.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2323
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2324
    ^ s contents
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2325
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2326
    "
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2327
     HTMLDocGenerator new htmlClassCategoryList
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2328
    "
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2329
4404
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2330
    "Created: / 22-04-1996 / 20:03:30 / cg"
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2331
    "Modified: / 30-10-1997 / 13:16:08 / cg"
4e578897697e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  2332
    "Modified: / 01-03-2019 / 15:52:54 / Claus Gittinger"
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2333
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2334
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2335
htmlClassListPrefix:prefix
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2336
    "generate an HTML document string which contains HREFS for a list
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2337
     of classes which start with some prefix (typically, the first
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2338
     character is given)"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2339
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2340
    |classes|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2341
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2342
    classes := Smalltalk allClasses
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2343
                select:[:cls | 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2344
                                cls isPrivate not
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2345
                                and:[(cls isRealNameSpace not)
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2346
                                and:[cls name startsWith:prefix]]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2347
                       ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2348
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2349
    ^ self 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2350
        htmlClasses:classes 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2351
        title:('Classes starting with ''' , prefix asString , ''':').
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2352
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2353
    "Created: / 22-04-1996 / 20:03:31 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2354
    "Modified: / 10-11-2006 / 17:11:16 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2355
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2356
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2357
htmlClasses:classes title:title
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2358
    "generate an HTML document string which contains HREFS for a given list
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2359
     of classes"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2360
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2361
    ^ self
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2362
        htmlClasses:classes 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2363
        title:title 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2364
        backTo:nil
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2365
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2366
    "Modified: / 30.10.1997 / 13:21:40 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2367
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2368
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2369
htmlClasses:classes title:title backTo:backRef
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2370
    "generate an HTML document string which contains HREFS for a given list
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2371
     of classes. If backref is nonNil, a back-button to that
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2372
     HREF is added at the top.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2373
     The generated page is supposed to be given to an HTML reader
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2374
     with home being set to ../doc/online/xxx/classDoc 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2375
     (i.e. the images are to be found one-up in the doc hierarchy)"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2376
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2377
    |classNames s|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2378
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2379
    classNames := (classes collect:[:cls | cls name]) asOrderedCollection sort.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2380
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2381
    outStream := s := '' writeStream.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2382
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2383
    self generateHTMLHeadWithTitle:title.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2384
    s nextPutLine:'<body>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2385
    backRef notNil ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2386
        backRef ~~ #none ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2387
            self
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2388
                generateUpArrowButtonWithReference:(self pathToLanguageTopOfDocumentation , '/TOP.html') 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2389
                command:backRef 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2390
                imagePath:nil 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2391
                altLabel:'back'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2392
        ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2393
    ] ifFalse:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2394
        self
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2395
            generateUpArrowButtonWithReference:(self pathToLanguageTopOfDocumentation , '/TOP.html') 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2396
            command:nil 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2397
            imagePath:nil 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2398
            altLabel:'top'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2399
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2400
    backRef ~~ #none ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2401
        self generateHorizontalLine.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2402
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2403
    self generateH1:title.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2404
    s nextPutLine:'<ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2405
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2406
    classNames do:[:className |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2407
        s nextPutAll:'<li>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2408
        self generateClassDocReferenceFor:className.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2409
        s cr.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2410
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2411
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2412
    s nextPutAll:'
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2413
</ul>
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2414
'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2415
    self generateBODYandHTMLEnd.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2416
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2417
    ^ s contents
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2418
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2419
    "Created: / 23.4.1996 / 15:31:55 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2420
    "Modified: / 30.10.1997 / 13:21:32 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2421
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2422
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2423
htmlClassesListOfCategory:category
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2424
    "generate an HTML document string which contains HREFS for a list
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2425
     of classes which are contained in a particular category."
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2426
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2427
    ^ self
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2428
        htmlClassesListOfCategory:category
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2429
        backTo:nil
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2430
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2431
    "Modified: / 30.10.1997 / 13:21:23 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2432
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2433
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2434
htmlClassesListOfCategory:category backTo:backRef
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2435
    "generate an HTML document string which contains HREFS for a list
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2436
     of classes which are contained in a particular category."
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2437
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2438
    |classes|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2439
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2440
    classes := Smalltalk allClasses
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2441
                select:[:cls | cls isPrivate not
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2442
                               and:[(cls isRealNameSpace not)
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2443
                               and:[cls category = category]]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2444
                       ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2445
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2446
    ^ self 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2447
        htmlClasses:classes 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2448
        title:('Classes in: ' , category)
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2449
        backTo:backRef
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2450
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2451
    "Created: / 23-04-1996 / 15:39:39 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2452
    "Modified: / 10-11-2006 / 17:11:23 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2453
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2454
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2455
htmlClassesMatching:aMatchPattern backTo:backRef
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2456
    "generate an HTML document string which contains HREFS
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2457
     for a list of classes whose name matches a given matchPattern."
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2458
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2459
    |classes cls|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2460
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2461
    classes := Smalltalk allClasses
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2462
                select:[:cls | cls isPrivate not
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2463
                               and:[(cls isRealNameSpace not)
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2464
                               and:[aMatchPattern match:cls name]]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2465
                       ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2466
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2467
    ^ self 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2468
        htmlClasses:classes 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2469
        title:('Classes matching: ' , aMatchPattern)
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2470
        backTo:backRef
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2471
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2472
    "
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2473
     self htmlClassesMatching:'Tgen::*' backTo:nil
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2474
    "
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2475
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2476
    "Modified: / 10-11-2006 / 17:11:30 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2477
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2478
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2479
htmlKWOCListFor:aKWIC
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2480
    "generate a formatted list of all keywords in context from class documentation
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2481
     as an HTML string. 
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2482
     Each keword will be a hyperlinked to another
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2483
     autogenerated page, containing the classes documentation.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2484
     The generated page is supposed to be given to an HTML reader
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2485
     with home being set to ../doc/online/xxx/classDoc 
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2486
     (i.e. the images are to be found one-up in the doc hierarchy)"
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2487
4108
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2488
    |prevWord caseMapping|
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2489
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2490
    outStream := '' writeStream.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2491
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2492
    self generateHTMLHeadWithTitle:'Keyword Index:'.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2493
    self generateBODYStart.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2494
    self generateUpArrowButtonForTop.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2495
    self generateHorizontalLine.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2496
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2497
    self generateH1:'Keywords:'.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2498
    outStream nextPutLine:'<dl>'.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2499
    prevWord := nil.
4108
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2500
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2501
    caseMapping := Dictionary new.
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2502
    aKWIC entriesDo:[:word :left :right :class|
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2503
        |lcWord wordAlready|
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2504
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2505
        lcWord := word asLowercase.
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2506
        lcWord ~= word ifTrue:[
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2507
            wordAlready := caseMapping at:lcWord ifAbsent:[nil].
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2508
            wordAlready isNil ifTrue:[
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2509
                caseMapping at:lcWord put:word
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2510
            ].
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2511
        ].
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2512
    ].
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2513
4127
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2514
    aKWIC matchSorter:[:a :b | a key < b key].
4108
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2515
    
4127
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2516
    aKWIC entriesDo:[:word :left :right :classOrMethod|
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2517
        |ref lcWord ctx|
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2518
4109
8a33dd426a63 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4108
diff changeset
  2519
        ctx := (HTMLUtilities escapeCharacterEntities:(left contractAtBeginningTo:25))
4124
64447ad97119 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4123
diff changeset
  2520
               , ' <b>',(HTMLUtilities escapeCharacterEntities:word),'</b> '
4109
8a33dd426a63 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4108
diff changeset
  2521
               ,(HTMLUtilities escapeCharacterEntities:(right contractAtEndTo:25)).
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2522
        
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2523
        lcWord := word asLowercase.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2524
        lcWord ~= prevWord ifTrue:[
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2525
            prevWord notNil ifTrue:[
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2526
                outStream nextPutLine:'</ul></dd>'.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2527
            ].    
4108
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2528
            "/ outStream nextPutLine:'<dt>',(HTMLUtilities escapeCharacterEntities:(caseMapping at:lcWord ifAbsent:[word])),'</dt>'.
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2529
            outStream nextPutLine:'<dt>',(HTMLUtilities escapeCharacterEntities:word),'</dt>'.
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2530
            outStream nextPutLine:'<dd><ul><li>'.
4127
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2531
            classOrMethod isBehavior ifTrue:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2532
                self generateClassDocReferenceFor:classOrMethod name.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2533
            ] ifFalse:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2534
                self generateMethodDocReferenceFor:classOrMethod selector inClass:classOrMethod mclass name text:classOrMethod selector autoloading:nil.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2535
            ].    
4108
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2536
            outStream nextPutAll:'<tab indent=300>'.
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2537
            outStream nextPutLine:ctx. 
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2538
            outStream nextPutLine:'</li>'.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2539
            prevWord := lcWord.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2540
        ] ifFalse:[
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2541
            outStream nextPutLine:'</li><li>'.
4127
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2542
            classOrMethod isBehavior ifTrue:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2543
                self generateClassDocReferenceFor:classOrMethod name.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2544
            ] ifFalse:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2545
                self generateMethodDocReferenceFor:classOrMethod selector inClass:classOrMethod mclass name text:classOrMethod selector autoloading:nil.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  2546
            ].    
4108
7908bc4c9d7f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4107
diff changeset
  2547
            outStream nextPutAll:'<tab indent=300>'.
4106
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2548
            outStream nextPutLine:ctx.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2549
            outStream nextPutLine:'</li>'.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2550
        ].
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2551
    ].    
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2552
    outStream nextPutLine:'</ul></dd>'.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2553
    outStream nextPutLine:'</dl>'.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2554
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2555
    self generateBODYandHTMLEnd.
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2556
    ^ outStream contents
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2557
!
35fa6b8943e6 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4051
diff changeset
  2558
2017
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  2559
htmlPackageDocOf:packageID
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  2560
    |classes|
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  2561
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  2562
    classes := Smalltalk allClassesInPackage:packageID.
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  2563
    classes := classes reject:[:cls | cls isPrivate].
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  2564
    ^ self htmlClasses: classes title:'Classes in package ',packageID backTo:nil
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  2565
!
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  2566
2018
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2567
htmlPackageList
4122
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2568
    "generate an HTML string for a list of all packages in the system"
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2569
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2570
    ^ self 
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2571
        htmlPackageListFor:(Smalltalk allPackageIDs) 
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2572
        withDocumentation:true "/ false
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2573
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2574
    "
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2575
     self new
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2576
        generateDocumentForOfflineReading:true;
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2577
        htmlPackageList.
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2578
    "
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2579
!
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2580
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2581
htmlPackageListFor:packageNames withDocumentation:withDocumentation
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2582
    "generate an HTML string for a given list of packages"
2018
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2583
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2584
    |s|
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2585
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2586
    s := outStream := '' writeStream.
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2587
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2588
    self generateHTMLHeadWithTitle:'Package Index'.
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2589
    self generateBODYStart.
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2590
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2591
    self generateUpArrowButtonForTop.
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2592
    self generateHorizontalLine.
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2593
    self generateH1:'Package Index'.
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2594
    s nextPutLine:'<ul>'.
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2595
4122
c46c90d71fa9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4117
diff changeset
  2596
    packageNames
2018
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2597
        do:[:p |
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2598
            |pckgString|
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2599
3644
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2600
            (p startsWith:'__') ifFalse:[
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2601
                s nextPutAll:'<li>'.
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2602
                pckgString := self withSpecialHTMLCharactersEscaped:p.
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2603
                self generateDocumentForOfflineReading ifTrue:[
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2604
                    s nextPutLine:(self 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2605
                                anchorFor:
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2606
                                    ((p copyReplaceAll:$: with:$/) , '/index.html' )
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2607
                                info:
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2608
                                    ('Classes in Package: ' , pckgString)
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2609
                                text:
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2610
                                    pckgString
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2611
                                name:nil).
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2612
                ] ifFalse:[
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2613
                    s nextPutLine:(self 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2614
                                anchorForHTMLDocAction:
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2615
                                    ('htmlPackageDocOf:''' , pckgString , '''' )
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2616
                                info:
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2617
                                    ('Classes in Package: ' , pckgString)
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2618
                                text:
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2619
                                    pckgString).
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2620
                ].
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2621
            ].
2018
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2622
        ].
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2623
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2624
    s nextPutLine:'</ul>'.
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2625
    self generateBODYandHTMLEnd.
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2626
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2627
    ^ s contents
3644
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2628
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2629
    "
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2630
     self new
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2631
        generateDocumentForOfflineReading:true;
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2632
        htmlPackageList.
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  2633
    "
2018
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2634
!
6c552ff3e4c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2017
diff changeset
  2635
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2636
htmlSelectorList
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2637
    "generate an HTML string for all selectors (for which methods exist)
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2638
     in the system"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2639
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2640
    |selectors|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2641
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2642
    selectors := IdentitySet new.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2643
    Smalltalk allClassesAndMetaclassesDo:[:cls |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2644
        selectors addAll:cls selectors.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2645
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2646
    selectors := selectors asOrderedCollection sort.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2647
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2648
    ^ self 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2649
        htmlSelectors:selectors 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2650
        title:('All Selectors:').
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2651
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2652
    "
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2653
     self htmlSelectorList
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2654
    "
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2655
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2656
    "Created: / 22.4.1996 / 20:03:31 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2657
    "Modified: / 5.6.1996 / 12:27:09 / stefan"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2658
    "Modified: / 30.10.1997 / 13:25:19 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2659
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2660
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2661
htmlSelectorListMatching:pattern
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2662
    "generate an HTML string for all selectors which match a pattern
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2663
     (and for which methods exist) in the system"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2664
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2665
    |selectors|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2666
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2667
    selectors := IdentitySet new.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2668
    Smalltalk allClassesAndMetaclassesDo:[:cls |
4211
83b7e9c5e266 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4200
diff changeset
  2669
        cls selectorsDo:[:sel |
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2670
            (pattern match:sel) ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2671
                selectors add:sel.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2672
            ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2673
        ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2674
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2675
    selectors := selectors asOrderedCollection sort.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2676
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2677
    ^ self 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2678
        htmlSelectors:selectors 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2679
        title:('Selectors matching ''' , pattern , ''':').
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2680
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2681
    "
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2682
     self htmlSelectorListMatching:'*do*'
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2683
    "
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2684
4211
83b7e9c5e266 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4200
diff changeset
  2685
    "Created: / 22-04-1996 / 20:03:31 / cg"
83b7e9c5e266 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4200
diff changeset
  2686
    "Modified: / 05-06-1996 / 12:29:27 / stefan"
83b7e9c5e266 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4200
diff changeset
  2687
    "Modified: / 10-02-2017 / 10:32:37 / cg"
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2688
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2689
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2690
htmlSelectorListPrefix:prefix
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2691
    "generate an HTML string for all selectors whose names starts with
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2692
     a prefix (and for which methods exist) in the system"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2693
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2694
    |selectors|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2695
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2696
    selectors := IdentitySet new.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2697
    Smalltalk allClassesAndMetaclassesDo:[:cls |
4211
83b7e9c5e266 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4200
diff changeset
  2698
        cls selectorsDo:[:sel |
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2699
            (sel startsWith:prefix) ifTrue:[
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2700
                selectors add:sel.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2701
            ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2702
        ]
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2703
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2704
    selectors := selectors asOrderedCollection sort.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2705
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2706
    ^ self 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2707
        htmlSelectors:selectors 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2708
        title:('Selectors starting with ''' , prefix asString , ''':').
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2709
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2710
    "
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2711
     self htmlSelectorListPrefix:'a'
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2712
    "
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2713
4211
83b7e9c5e266 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4200
diff changeset
  2714
    "Created: / 22-04-1996 / 20:03:31 / cg"
83b7e9c5e266 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4200
diff changeset
  2715
    "Modified: / 05-06-1996 / 12:31:13 / stefan"
83b7e9c5e266 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4200
diff changeset
  2716
    "Modified: / 10-02-2017 / 10:32:31 / cg"
2016
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2717
!
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2718
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2719
htmlSelectors:selectors title:title
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2720
    "generate an HTML string for a given list of selectors"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2721
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2722
    |s|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2723
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2724
    s := outStream := '' writeStream.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2725
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2726
    self generateHTMLHeadWithTitle:title.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2727
    self generateBODYStart.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2728
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2729
    self generateUpArrowButtonForTop.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2730
    self generateHorizontalLine.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2731
    self generateH1:title.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2732
    s nextPutLine:'<ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2733
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2734
    selectors do:[:sel |
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2735
        |selString|
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2736
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2737
        selString := self withSpecialHTMLCharactersEscaped:sel.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2738
        s nextPutAll:'<li>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2739
        s nextPutLine:(self 
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2740
                    anchorForHTMLDocAction:
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2741
                        ('htmlDocOfImplementorsOf:''' , selString , '''' )
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2742
                    info:
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2743
                        ('Implementors of: ' , selString)
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2744
                    text:
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2745
                        selString).
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2746
    ].
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2747
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2748
    s nextPutLine:'</ul>'.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2749
    self generateBODYandHTMLEnd.
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2750
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2751
    ^ s contents
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2752
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2753
    "Created: / 22.4.1996 / 20:03:31 / cg"
1084cacd75ac refactored
Claus Gittinger <cg@exept.de>
parents: 2002
diff changeset
  2754
    "Modified: / 30.10.1997 / 13:26:34 / cg"
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2755
! !
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2756
1265
362fd66b095c method category rename
Claus Gittinger <cg@exept.de>
parents: 1260
diff changeset
  2757
!HTMLDocGenerator methodsFor:'format conversion-man pages'!
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2758
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2759
manPageFor:aCommand
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2760
    "generate a (unix-) man page for a given command & convert the output to html"
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2761
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2762
    ^ self 
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2763
        manPageFor:aCommand
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2764
        inSection:nil
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2765
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2766
    "Modified: / 30.10.1997 / 13:29:31 / cg"
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2767
!
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2768
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2769
manPageFor:aCommand inSection:sectionOrNil 
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2770
    "generate a (unix-) man page for some entry in a section
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2771
     & convert the output to html"
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2772
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2773
    |manCmd|
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2774
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2775
    sectionOrNil isNil ifTrue:[
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2776
        manCmd := 'man ' , aCommand
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2777
    ] ifFalse:[
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2778
        manCmd := 'man ' , sectionOrNil printString , ' ' , aCommand
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2779
    ].
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2780
    ^ self 
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2781
        manPageFor:aCommand
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2782
        manCommand:manCmd.
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2783
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2784
    "Created: / 9.9.1996 / 17:45:08 / cg"
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2785
    "Modified: / 30.10.1997 / 13:29:44 / cg"
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2786
!
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2787
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2788
manPageFor:aCommand manCommand:manCommand
577
9cdee8b4b6b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
  2789
    "convert man-command output to html.
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2790
     Only the body of the text (without head../head and body../body) is generated"
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2791
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2792
    |manPageStream text|
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2793
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2794
    manPageStream := PipeStream readingFrom:manCommand.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2795
    manPageStream notNil ifTrue:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2796
        [
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2797
            text := self manPageFromStream:manPageStream.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2798
        ] ensure:[
4117
f5366a92d4ac #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4110
diff changeset
  2799
            manPageStream abortAndClose.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2800
        ]
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2801
    ].
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2802
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2803
    text isEmptyOrNil ifTrue:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2804
        ^ self noManPageForCommand:aCommand usingManCommand:manCommand.
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2805
    ].
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2806
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2807
    ^ '<pre>
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2808
' , text , '
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2809
</pre>
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2810
'
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2811
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2812
    "
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2813
     self manPageFor:'cvs'
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2814
    "
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2815
632
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2816
    "Modified: / 28.6.1996 / 21:28:47 / stefan"
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2817
    "Created: / 9.9.1996 / 17:43:16 / cg"
41efc16a4119 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2818
    "Modified: / 30.10.1997 / 13:30:22 / cg"
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2819
!
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2820
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2821
manPageForFile:aFilename
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2822
    "convert a .man file to html"
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2823
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2824
    ^ self 
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2825
        manPageFor:aFilename asFilename name
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2826
        manCommand:('nroff -man ' , aFilename asFilename pathName).
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2827
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2828
    "
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2829
     self manPageForFile:'../../stc/stc.1'
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2830
    "
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2831
    "
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2832
     HTMLDocumentView openFullOnText:(self manPageForFile:'../../stc/stc.1')
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2833
    "
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2834
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2835
    "Modified: 4.4.1997 / 10:44:05 / cg"
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2836
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2837
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2838
manPageFromStream:manPageStream
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2839
    "convert man-command output to html.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2840
     Only the body of the text (without head../head and body../body) is generated.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2841
     This method looks for 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2842
        char-backspace-char      -> bold
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2843
        char-backspace-underline -> italic"
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2844
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2845
    |state ch keep|
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2846
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2847
    outStream := '' writeStream.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2848
    state := nil.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2849
    keep := nil.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2850
    [manPageStream atEnd] whileFalse:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2851
        ch := manPageStream next.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2852
            
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2853
        ch notNil ifTrue:[
4197
a026f170f9c9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4127
diff changeset
  2854
            state isNil ifTrue:[
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2855
                ch == Character backspace ifTrue:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2856
                    state := #back
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2857
                ] ifFalse:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2858
                    keep notNil ifTrue:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2859
                        self nextPutAllEscaped:keep.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2860
                    ].
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2861
                    keep := ch
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2862
                ]
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2863
            ] ifFalse:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2864
                state == #back ifTrue:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2865
                    ch == keep ifTrue:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2866
                        self nextPutBold:ch.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2867
                    ] ifFalse:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2868
                        ch == $_ ifTrue:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2869
                            keep notNil ifTrue:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2870
                                self nextPutItalic:keep.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2871
                            ].
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2872
                        ] ifFalse:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2873
                            keep == $_ ifTrue:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2874
                                self nextPutItalic:ch.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2875
                            ] ifFalse:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2876
                                keep notNil ifTrue:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2877
                                    self nextPutAllEscaped:keep.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2878
                                    self nextPutAllEscaped:ch.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2879
                                ].
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2880
                            ].
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2881
                        ].
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2882
                    ].
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2883
                    state := keep := nil.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2884
                ]
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2885
            ]
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2886
        ]
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2887
    ].
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2888
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2889
    keep notNil ifTrue:[
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2890
        self nextPutAllEscaped:keep.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2891
    ].
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2892
    ^ outStream contents.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2893
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2894
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2895
     HTMLDocGenerator new manPageFor:'cvs'
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2896
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2897
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2898
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2899
noManPageForCommand:aCommand usingManCommand:manCommand
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2900
        ^ '
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  2901
No manual page for "<code><b>' , aCommand , '</b></code>" available.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2902
<BR>
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  2903
(The failed command was: "<code>' , manCommand , '"</code>.)
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2904
'.
575
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2905
! !
27439f18cb04 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  2906
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2907
!HTMLDocGenerator methodsFor:'helpers'!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2908
1257
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2909
anchorFor:href info:infoMessageOrNil text:text name:nameOrNil
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2910
    |infoPart namePart|
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2911
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2912
    infoPart := namePart := ''.
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2913
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2914
    infoMessageOrNil notNil ifTrue:[
1332
8838fb9735b0 added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents: 1331
diff changeset
  2915
        infoPart := self infoParameterFor:infoMessageOrNil.
1257
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2916
    ].
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2917
    nameOrNil notNil ifTrue:[
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2918
        namePart := 'NAME="' , nameOrNil , '" '. 
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2919
    ].
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2920
    ^ '<A HREF="' , href , '" ' 
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2921
      , namePart
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2922
      , infoPart
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2923
      , '>' , text 
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2924
      ,'</A>'.
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2925
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2926
    "
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2927
     self new anchorFor:'foo' info:'bla' text:'text' name:nil 
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2928
    "
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2929
!
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  2930
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2931
anchorForHTMLAction:actionString info:infoMessageOrNil text:text
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2932
    ^ self
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2933
        anchorForHTMLAction:actionString 
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2934
        info:infoMessageOrNil 
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2935
        text:text 
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2936
        name:nil
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2937
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2938
    "
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2939
     self new anchorForHTMLAction:'foo' info:'bla' text:'text'  
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2940
    "
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2941
!
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2942
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2943
anchorForHTMLAction:actionString info:infoMessageOrNil text:text name:nameOrNil
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2944
    |infoPart namePart|
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2945
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2946
    infoPart := namePart := ''.
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2947
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2948
    infoMessageOrNil notNil ifTrue:[
1332
8838fb9735b0 added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents: 1331
diff changeset
  2949
        infoPart := self infoParameterFor:infoMessageOrNil.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2950
    ].
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2951
    nameOrNil notNil ifTrue:[
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  2952
        namePart := 'name="' , nameOrNil , '" '. 
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2953
    ].
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  2954
    ^ '<a href="' , self pathToTopOfDocumentation , '/misc/onlyInSTX2.html" ' 
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2955
      , namePart
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2956
      , infoPart
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2957
      , 'ACTION="html:' 
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2958
      , actionString 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2959
      , '">' , text 
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  2960
      ,'</a>'.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2961
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2962
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2963
     self new anchorForHTMLAction:'foo' info:'bla' text:'text'  
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2964
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2965
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2966
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2967
anchorForHTMLDocAction:actionString info:infoMessageOrNil text:text
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2968
    ^ self
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2969
        anchorForHTMLDocAction:actionString 
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2970
        info:infoMessageOrNil 
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2971
        text:text
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2972
        name:nil
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2973
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2974
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2975
     self new anchorForHTMLDocAction:'foo' info:'bla' text:'text'  
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2976
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2977
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2978
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2979
anchorForHTMLDocAction:actionString info:infoMessageOrNil text:text name:anchorName
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2980
    ^ self
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  2981
        anchorForHTMLAction:(self className , ' ' , actionString) 
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2982
        info:infoMessageOrNil 
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2983
        text:text
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2984
        name:anchorName
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2985
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2986
    "
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2987
     self new anchorForHTMLDocAction:'foo' info:'bla' text:'text' name:'baz' 
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2988
    "
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  2989
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  2990
    "Modified: / 28-06-2019 / 09:01:11 / Claus Gittinger"
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2991
!
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  2992
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2993
anchorForHTMLDocAction:actionString text:text
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2994
    ^ self anchorForHTMLDocAction:actionString info:nil text:text
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2995
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2996
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2997
     self new anchorForHTMLDocAction:'foo' text:'text'
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2998
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  2999
!
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3000
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3001
findPathToTopOfDocumentation
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3002
    <resource: #obsolete>
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3003
    ^ self class findPathToTopOfDocumentation
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3004
!
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3005
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3006
generateBODYEnd
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3007
    generateBodyOnly == true ifFalse:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3008
        outStream nextPutLine:'</body>'.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3009
    ]
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3010
!
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3011
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3012
generateBODYStart
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3013
    generateBodyOnly == true ifFalse:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3014
        outStream nextPutLine:'<body>'.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3015
    ]
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3016
!
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3017
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3018
generateBODYandHTMLEnd
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3019
    self generateBODYEnd.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3020
    self generateHTMLEnd.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3021
!
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3022
1328
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3023
generateBackButton
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3024
    |backHRef backLabel|
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3025
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3026
    backRef isNil ifTrue:[
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3027
        backHRef := self pathToLanguageTopOfDocumentation , '/TOP.html'.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3028
        backLabel := 'top'.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3029
    ] ifFalse:[
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3030
        backHRef := backRef.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3031
        backLabel := 'back'.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3032
    ].
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3033
    backCmd notNil ifTrue:[
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3034
        self
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3035
            generateUpArrowButtonWithReference:backHRef 
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3036
            command:backCmd 
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3037
            imagePath:imagePath 
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3038
            altLabel:backLabel.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3039
        self generateHorizontalLine.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3040
    ] ifFalse:[
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3041
        backHRef ~~ #none ifTrue:[
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3042
            self
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3043
                generateUpArrowButtonWithReference:backHRef 
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3044
                command:nil 
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3045
                imagePath:imagePath 
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3046
                altLabel:backLabel.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3047
            self generateHorizontalLine.
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3048
        ]
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3049
    ].
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3050
!
7bee978ad3bb handle nameSpaces
penk
parents: 1326
diff changeset
  3051
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  3052
generateClassDocReferenceFor:className
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3053
    self generateClassDocReferenceFor:className text:className
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3054
!
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3055
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3056
generateClassDocReferenceFor:className text:text
1337
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  3057
    self generateClassDocReferenceFor:className text:text autoloading:nil
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  3058
!
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  3059
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  3060
generateClassDocReferenceFor:className text:text autoloading:autoloadedClass
2017
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3061
    "generates a link to a classes documentation"
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3062
1337
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  3063
    |href serviceLinkName action|
1257
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3064
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3065
    self generatingForSTXBrowser ifTrue:[
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3066
        action := self className , ' htmlDocOf:' , className.
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3067
        autoloadedClass notNil ifTrue:[
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3068
            action := autoloadedClass , ' autoload,', action.
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3069
        ].
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3070
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3071
        href := self 
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3072
                    anchorForHTMLAction:action
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3073
                    info:('Show documentation of ' , className )
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3074
                    text:text.
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3075
    ] ifFalse:[
2017
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3076
        "/ page is generated for a real http service;
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3077
        "/ generate a link to the services classDocOf page,
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3078
        "/ Assumes that the server has a classDoc service running.
1310
39dcc6dfbae1 fix hard wired links
penk
parents: 1309
diff changeset
  3079
        httpRequestOrNil notNil ifTrue:[
39dcc6dfbae1 fix hard wired links
penk
parents: 1309
diff changeset
  3080
            serviceLinkName := httpRequestOrNil serviceLinkName.    
39dcc6dfbae1 fix hard wired links
penk
parents: 1309
diff changeset
  3081
        ].
1257
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3082
        href := self
2002
43ff7ad28fb5 refactored to remove preReq cycle
sr
parents: 1993
diff changeset
  3083
                    anchorFor:(serviceLinkName, '/classDocOf,', (HTMLUtilities escape:className) ) 
1257
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3084
                    info:('Show documentation of ' , className ) 
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3085
                    text:text 
1257
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3086
                    name:nil
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3087
    ].
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3088
1337
5d537c9b1326 references (related information)
Claus Gittinger <cg@exept.de>
parents: 1336
diff changeset
  3089
    outStream nextPutAll:href.
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3090
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3091
    "Modified: / 28-06-2019 / 09:01:15 / Claus Gittinger"
1250
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  3092
!
d65490ed48b2 refactored
Claus Gittinger <cg@exept.de>
parents: 1249
diff changeset
  3093
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3094
generateH1:headerLine
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3095
    outStream nextPutLine:'<h1>'.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3096
    outStream nextPutLine:headerLine.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3097
    outStream nextPutLine:'</h1>'.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3098
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3099
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3100
generateHTMLEnd
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3101
    generateBodyOnly == true ifFalse:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3102
        outStream nextPutLine:'</html>'
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3103
    ]
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3104
!
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3105
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3106
generateHTMLHeadWithTitle:title
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3107
    |generatedByComment|
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3108
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3109
    generatedByComment := ('<!!-- generated by ' , self className , ' ' , thisContext sender selector , ' -->').
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3110
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3111
    generateBodyOnly == true ifFalse:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3112
        outStream 
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3113
            nextPutLine:'<!!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">';
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3114
            nextPutLine:generatedByComment;
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3115
            cr;
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3116
            nextPutLine:'<html>';
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3117
            nextPutLine:'<head>';
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3118
            nextPutLine:'<title>';
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3119
            nextPutLine:title;
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3120
            nextPutLine:'</title>';
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3121
            nextPutLine:'</head>';
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3122
            cr.
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3123
    ] ifTrue:[
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3124
        outStream 
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3125
            nextPutLine:generatedByComment
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3126
    ].
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3127
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3128
    "Modified: / 28-06-2019 / 09:01:25 / Claus Gittinger"
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3129
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3130
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3131
generateHorizontalLine
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3132
    outStream nextPutLine:'<hr>'.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3133
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3134
4127
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3135
generateMethodDocReferenceFor:selector inClass:className text:text autoloading:autoloadedClass
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3136
    "generates a link to a classes documentation"
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3137
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3138
    |href serviceLinkName action|
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3139
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3140
    self generatingForSTXBrowser ifTrue:[
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3141
        action := self className , ' htmlDocOf:' , className.
4127
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3142
        autoloadedClass notNil ifTrue:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3143
            action := autoloadedClass , ' autoload,', action.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3144
        ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3145
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3146
        href := self 
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3147
                    anchorForHTMLAction:action
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3148
                    info:('Show documentation of ' , className )
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3149
                    text:text.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3150
    ] ifFalse:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3151
        "/ page is generated for a real http service;
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3152
        "/ generate a link to the services classDocOf page,
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3153
        "/ Assumes that the server has a classDoc service running.
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3154
        httpRequestOrNil notNil ifTrue:[
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3155
            serviceLinkName := httpRequestOrNil serviceLinkName.    
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3156
        ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3157
        href := self
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3158
                    anchorFor:(serviceLinkName, '/classDocOf,', (HTMLUtilities escape:className) ) 
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3159
                    info:('Show documentation of ' , className ) 
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3160
                    text:text 
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3161
                    name:nil
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3162
    ].
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3163
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3164
    outStream nextPutAll:href.
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3165
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3166
    "Modified: / 28-06-2019 / 09:01:37 / Claus Gittinger"
4127
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3167
!
1a5ac450b16c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4126
diff changeset
  3168
2017
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3169
generatePackageDocReferenceFor:packageID text:text
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3170
    "generates a link to a package documentation"
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3171
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3172
    |href serviceLinkName action|
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3173
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3174
    self generatingForSTXBrowser ifFalse:[
3644
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3175
        self generateDocumentForOfflineReading ifTrue:[
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3176
            href := self
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3177
                        anchorFor:(pathToTopOfDocumentation, '/packages/', (HTMLUtilities escape:packageID) ) 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3178
                        info:('Show documentation of package ' , packageID ) 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3179
                        text:text 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3180
                        name:nil
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3181
        ] ifFalse:[
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3182
            "/ page is generated for a real http service;
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3183
            "/ generate a link to the services packageDocOf page,
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3184
            "/ Assumes that the server has a classDoc service running.
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3185
            httpRequestOrNil notNil ifTrue:[
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3186
                serviceLinkName := httpRequestOrNil serviceLinkName.    
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3187
            ].
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3188
            href := self
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3189
                        anchorFor:(serviceLinkName, '/classListForPackage,', (HTMLUtilities escape:packageID) ) 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3190
                        info:('Show documentation of package ' , packageID ) 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3191
                        text:text 
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3192
                        name:nil
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3193
        ]
2017
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3194
    ] ifTrue:[
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3195
        action := self className , ' htmlPackageDocOf: #''' , packageID, ''''.
2017
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3196
        href := self 
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3197
                    anchorForHTMLAction:action
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3198
                    info:('Show documentation of package ' , packageID )
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3199
                    text:text.
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3200
    ].
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3201
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3202
    outStream nextPutAll:href.
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3203
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3204
    "Modified: / 28-06-2019 / 09:01:41 / Claus Gittinger"
2017
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3205
!
bc6393e8c430 +classes per package
Claus Gittinger <cg@exept.de>
parents: 2016
diff changeset
  3206
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3207
generateUpArrowButtonForTop
3644
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3208
    |top|
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3209
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3210
    self generateDocumentForOfflineReading ifTrue:[
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3211
        top := '../index.html'.
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3212
    ] ifFalse:[
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3213
        top := (self pathToLanguageTopOfDocumentation , '/TOP.html').
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3214
    ].
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3215
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3216
    self
3644
b684b824de99 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3643
diff changeset
  3217
        generateUpArrowButtonWithReference:top 
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3218
        command:nil 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3219
        imagePath:nil 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3220
        altLabel:'top'
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3221
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3222
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3223
generateUpArrowButtonWithReference:backHRef command:backCmd imagePath:imagePath altLabel:altLabel
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3224
    |p|
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3225
3999
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
  3226
    self showUpButton ifFalse:[^ self].
faf8404081ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3968
diff changeset
  3227
    
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  3228
    outStream nextPutAll:'<a class="noprint" href="' , backHRef , '"'.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3229
    backCmd notNil ifTrue:[
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3230
        outStream nextPutAll:' action="html:' , self className , ' ' , backCmd , '"'.
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3231
    ].
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3232
    p := imagePath.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3233
    p isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3234
        p := self pathToTopOfDocumentation , '/icons'
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3235
    ].
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  3236
    outStream nextPutLine:'><img src="' , p , '/DocsUpArrow.gif" alt="[' , (altLabel ? 'back') , ']"></a>'.
4450
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3237
c61c29ba44fa #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4404
diff changeset
  3238
    "Modified: / 28-06-2019 / 09:01:59 / Claus Gittinger"
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3239
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3240
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3241
generatingForSTXBrowser
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3242
    self generateDocumentForOfflineReading ifTrue:[^ false].
1258
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3243
    ^ httpRequestOrNil isNil
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3244
!
2efcd7c46179 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1257
diff changeset
  3245
1332
8838fb9735b0 added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents: 1331
diff changeset
  3246
infoParameterFor:infoMessageOrNil
8838fb9735b0 added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents: 1331
diff changeset
  3247
    infoMessageOrNil isNil ifTrue:[^ ''].
8838fb9735b0 added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents: 1331
diff changeset
  3248
1333
83824ad8d5cb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1332
diff changeset
  3249
    ^ 
1332
8838fb9735b0 added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents: 1331
diff changeset
  3250
      'ONMOUSEOVER="window.status=''',infoMessageOrNil,'''; return true" ' , 
1923
57fbb3e512e3 generate valid HTML 4.01 transitional
Stefan Vogel <sv@exept.de>
parents: 1896
diff changeset
  3251
      '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
  3252
!
8838fb9735b0 added an onMouseOver to generate info (does not work yet ?)
Claus Gittinger <cg@exept.de>
parents: 1331
diff changeset
  3253
1308
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3254
methodCommentOf:aMethod
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3255
    "extract the very first comment from the method"
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3256
1308
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3257
    |comment mClass mSel parseTree matcher|
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3258
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3259
    comment := aMethod comment.
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3260
    comment notNil ifTrue:[^ comment].
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3261
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3262
    mClass := aMethod mclass.
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3263
    mClass isNil ifTrue:[^ nil].
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3264
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3265
    mSel := aMethod selector.
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3266
    mSel isNil ifTrue:[^ nil].
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3267
4214
f9bca7ea94da #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4211
diff changeset
  3268
    "/ generate a comment if it's a getter, setter or similar
1308
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3269
    ParseTreeSearcher notNil ifTrue:[
1336
48affa54f55b http - references
Claus Gittinger <cg@exept.de>
parents: 1335
diff changeset
  3270
        aMethod messagesSent isEmpty ifTrue:[
1351
38d939468fff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
  3271
            parseTree := mClass parseTreeFor:mSel.
38d939468fff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
  3272
            parseTree notNil ifTrue: [
38d939468fff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
  3273
                (mClass allInstanceVariableNames) do:[:eachVar |
1336
48affa54f55b http - references
Claus Gittinger <cg@exept.de>
parents: 1335
diff changeset
  3274
                    matcher := ParseTreeSearcher getterMethod:eachVar.
1979
3a8779b57235 refactoringparser interface
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  3275
                    (matcher executeTree: parseTree initialAnswer:false) ifTrue:[
1336
48affa54f55b http - references
Claus Gittinger <cg@exept.de>
parents: 1335
diff changeset
  3276
                        ^ 'Return the instance variable ' , eachVar, '.'.
48affa54f55b http - references
Claus Gittinger <cg@exept.de>
parents: 1335
diff changeset
  3277
                    ].
1351
38d939468fff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1349
diff changeset
  3278
1336
48affa54f55b http - references
Claus Gittinger <cg@exept.de>
parents: 1335
diff changeset
  3279
                    matcher := ParseTreeSearcher setterMethod:eachVar.
1979
3a8779b57235 refactoringparser interface
Claus Gittinger <cg@exept.de>
parents: 1974
diff changeset
  3280
                    (matcher executeTree: parseTree initialAnswer:false) ifTrue:[
1336
48affa54f55b http - references
Claus Gittinger <cg@exept.de>
parents: 1335
diff changeset
  3281
                        ^ 'Set the instance variable ' , eachVar, '.'.
48affa54f55b http - references
Claus Gittinger <cg@exept.de>
parents: 1335
diff changeset
  3282
                    ].
1308
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3283
                ].
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3284
            ].
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3285
        ].
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3286
    ].
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3287
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3288
"/    (mSuperClass := mClass superclass) notNil ifTrue:[
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3289
"/self halt.
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3290
"/    ].
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3291
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3292
    ^ nil.
4214
f9bca7ea94da #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4211
diff changeset
  3293
f9bca7ea94da #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4211
diff changeset
  3294
    "Modified (comment): / 13-02-2017 / 20:21:50 / cg"
1308
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3295
!
08d6a08eee80 reflection to generate the comment for getters/setters
Claus Gittinger <cg@exept.de>
parents: 1289
diff changeset
  3296
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3297
methodExampleCommentsOf:aMethod
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3298
    "extract the very last comment from the method"
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3299
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3300
    |comments partOfSelector|
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3301
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3302
    comments := aMethod parserClass methodCommentsFromSource:aMethod source.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3303
    comments size <= 1 ifTrue:[^ nil].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3304
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3305
    "/ look for comments which make up valid source code in the method's language
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3306
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3307
    partOfSelector := aMethod selector.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3308
    (partOfSelector includes:$:) ifTrue:[
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3309
        partOfSelector := partOfSelector copyTo:(partOfSelector indexOf:$:)
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3310
    ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3311
    comments := (comments from:2)
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3312
                    select:[:each |
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3313
                        (each includesString:partOfSelector) 
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3314
                        and:[ 
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3315
                            |rslt|
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3316
4481
270f28476380 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4469
diff changeset
  3317
                            rslt := [ aMethod parserClass parseExpression:each onError:#Error] on:Error do:#Error.
3625
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3318
                            rslt ~~ #Error.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3319
                        ].
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3320
                    ].                        
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3321
    ^ comments.
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3322
!
a55dc7e48d04 class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3232
diff changeset
  3323
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3324
nextPutAllEscaped:aStringOrCharacter
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3325
    outStream nextPutAll:(self withSpecialHTMLCharactersEscaped:aStringOrCharacter)
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3326
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3327
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3328
nextPutBold:aStringOrCharacter
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3329
    outStream nextPutAll:'<b>'.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3330
    self nextPutAllEscaped:aStringOrCharacter.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3331
    outStream nextPutAll:'</b>'.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3332
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3333
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3334
nextPutItalic:aStringOrCharacter
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3335
    outStream nextPutAll:'<i>'.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3336
    self nextPutAllEscaped:aStringOrCharacter.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3337
    outStream nextPutAll:'</i>'.
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3338
!
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3339
1974
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3340
shownSubclassesOf:aClass
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3341
    |subs|
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3342
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3343
    subs := aClass subclasses. 
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3344
    subs := subs select:[:cls | |def|
2205
6a7e8629edd5 changed: #shownSubclassesOf:
Claus Gittinger <cg@exept.de>
parents: 2178
diff changeset
  3345
                                def := cls projectDefinitionClass.
1974
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3346
                                def isNil or:[def showClassDocumentationOf:cls]].
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3347
    subs := subs asOrderedCollection sort:[:a :b | a name < b name].
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3348
    ^ subs
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3349
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3350
    "Created: / 05-11-2007 / 17:22:27 / cg"
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3351
!
fbbe9fc73f3c privacy
Claus Gittinger <cg@exept.de>
parents: 1973
diff changeset
  3352
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3353
withSpecialHTMLCharactersEscaped:aStringOrCharacter
3915
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  3354
    |string|
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  3355
    
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  3356
    string := aStringOrCharacter isString ifTrue:[aStringOrCharacter] ifFalse:[aStringOrCharacter asString].
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  3357
    ^ HTMLUtilities escapeCharacterEntities:string
1249
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3358
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3359
    "
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3360
     self new withSpecialHTMLCharactersEscaped:'foo>' 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3361
     self new withSpecialHTMLCharactersEscaped:$< 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3362
     self new withSpecialHTMLCharactersEscaped:$A 
39052813d29f refactored;
Claus Gittinger <cg@exept.de>
parents: 1248
diff changeset
  3363
    "
2327
99495bed5445 changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  3364
99495bed5445 changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents: 2252
diff changeset
  3365
    "Modified: / 13-04-2011 / 23:11:16 / cg"
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3366
! !
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3367
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3368
!HTMLDocGenerator methodsFor:'pathnames'!
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3369
1257
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3370
pathToDocumentationFile:relativeHref 
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3371
    |top|
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3372
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3373
    top := self pathToLanguageTopOfDocumentation.
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3374
    (top asFilename construct:relativeHref) exists ifTrue:[
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3375
        "unix format: used as URL"
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3376
        ^ top , '/' , relativeHref
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3377
    ].
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3378
    ^ self pathToEnglishTopOfDocumentation , '/' , relativeHref
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3379
!
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3380
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3381
pathToEnglishTopOfDocumentation
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3382
    "/ always unix-name convention (used as an URL)
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3383
    ^ self pathToTopOfDocumentation , '/english'    
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3384
!
af5c892477b7 classDocGeneration for webServer
Claus Gittinger <cg@exept.de>
parents: 1256
diff changeset
  3385
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3386
pathToLanguageTopOfDocumentation
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3387
    |languageSpecificDocDirectory fn|
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3388
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3389
    pathToLanguageTopOfDocumentation isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3390
        pathToLanguageTopOfDocumentation := self pathToTopOfDocumentation.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3391
        languageSpecificDocDirectory := self class languageSpecificDocDirectory.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3392
        fn := pathToLanguageTopOfDocumentation asFilename construct:languageSpecificDocDirectory.
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3393
        (fn exists and:[fn isDirectory]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3394
            "/ always unix-name convention (used as an URL)
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3395
            pathToLanguageTopOfDocumentation := pathToLanguageTopOfDocumentation , '/' , languageSpecificDocDirectory.    
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3396
        ].
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3397
    ].
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3398
    ^ pathToLanguageTopOfDocumentation
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3399
!
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3400
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3401
pathToTopOfDocumentation
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3402
    pathToTopOfDocumentation isNil ifTrue:[
3643
58d8d3b94d1d class: HTMLDocGenerator
Claus Gittinger <cg@exept.de>
parents: 3625
diff changeset
  3403
        pathToTopOfDocumentation := self class findPathToTopOfDocumentation
1255
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3404
    ].
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3405
    ^ pathToTopOfDocumentation
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3406
! !
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
  3407
498
ebdb7d336154 ignore private classes
Claus Gittinger <cg@exept.de>
parents: 492
diff changeset
  3408
!HTMLDocGenerator class methodsFor:'documentation'!
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3409
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3410
version
3915
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  3411
    ^ '$Header$'
2178
af7b05dfeaae changed: #languageSpecificDocDirectory
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
  3412
!
af7b05dfeaae changed: #languageSpecificDocDirectory
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
  3413
af7b05dfeaae changed: #languageSpecificDocDirectory
Claus Gittinger <cg@exept.de>
parents: 2055
diff changeset
  3414
version_CVS
3915
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  3415
    ^ '$Header$'
478
40d6c6e66852 moved files into extra directory
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3416
! !
3232
de4bd4dcb49f Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
  3417