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