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