00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 ::REQUIRES 'classfinder.cls'
00048
00049 ::REQUIRES 'fsobjects.cls'
00050
00051 ::REQUIRES 'nodes.cls'
00052
00053 ::REQUIRES 'rexxprogram.cls'
00054
00055
00056
00057
00058 ::ROUTINE sortq PUBLIC
00059 use strict arg q
00060
00061 a = q~makearray
00062
00063 a~sort
00064
00065 return a
00066
00067 ::CLASS htmlutil PUBLIC
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 ::METHOD tabshead CLASS
00081 use strict arg outq, tablist, selector
00082
00083 outq~queue('<div class="tabs">')
00084 outq~queue('<ul>')
00085
00086 do i over tablist
00087 if i[3] = selector
00088 then outq~queue('<li class="current">')
00089 else outq~queue('<li>')
00090 outq~queue('<a href="'i[2]'">')
00091 outq~queue('<span>'i[1]'</span>')
00092 outq~queue('</a>')
00093 end
00094
00095 outq~queue('</ul>')
00096 outq~queue('</div>')
00097
00098
00099
00100
00101
00102
00103
00104 ::METHOD callableexpand CLASS
00105 use arg htmlout, m, bc, tp
00106
00107 if m~exposelist~words > 0
00108 then do
00109 tp~queue('<div class="paramname">Exposes</div>')
00110 tp~queue(m~exposelist)
00111 end
00112 if bc~parms~items > 0 | m~arglist~words > 0
00113 then do
00114 tp~queue('<div class="paramname">Parameters</div>')
00115 copylist = m~arglist
00116
00117 do i over bc~parms
00118 parse value .htmlutil~htmlizestring(i) with pname rest
00119 inx = copylist~wordpos(pname)
00120 if inx > 0
00121 then do
00122 copylist = copylist~delword(inx,1)
00123 end
00124 else do
00125 if m~type = 'METH' | m~type = 'ATTR'
00126 then htmlout~pwrongdoc~queue(m~document~relpath'::'m~ownerclass~rexxname'::'m~rexxname ''''pname'''')
00127 else htmlout~pwrongdoc~queue(m~document~relpath'::'m~rexxname ''''pname'''')
00128 end
00129 tp~queue('<span class="param">'pname'</span>' .classfinder~classnames(m~document, rest)'<br>')
00130 end
00131 j = copylist~words
00132 do j
00133 parse var copylist pname copylist
00134 if m~type = 'METH' | m~type = 'ATTR'
00135 then htmlout~pmissingdoc~queue(m~document~relpath'::'m~ownerclass~rexxname'::'m~rexxname ''''pname'''')
00136 else htmlout~pmissingdoc~queue(m~document~relpath'::'m~rexxname ''''pname'''')
00137 tp~queue('<span class="param">'pname'</span> not documented<br>')
00138 end
00139
00140 end
00141 if bc~returns~items > 0
00142 then do
00143 tp~queue('<div class="paramname">Returns</div>')
00144 do i over bc~returns
00145 tp~queue(.classfinder~classnames(m~document, .htmlutil~htmlizestring(i))'<br/>')
00146 end
00147 end
00148
00149 if bc~pres~items > 0
00150 then do
00151 tp~queue('<div class="paramname">Preconditions</div>')
00152 do i over bc~pres
00153 tp~queue(.classfinder~classnames(m~document, .htmlutil~htmlizestring(i))'<br/>')
00154 end
00155 end
00156
00157 if bc~posts~items > 0
00158 then do
00159 tp~queue('<div class="paramname">Postconditions</div>')
00160 do i over bc~posts
00161 tp~queue(.classfinder~classnames(m~document, .htmlutil~htmlizestring(i))'<br/>')
00162 end
00163 end
00164
00165 if m~type = 'PROC' | m~type = 'ROUT'
00166 then do
00167 tp~queue('<div class="paramname">Called by</div>')
00168 do r over m~callrefs
00169 src = r~rdatom~document~getsource(r~rdatom~feature)
00170 fc = .flatclause~new(r~rdatom~feature, src)
00171 tagtext = '"<i>'self~htmlizestring(fc~flat)'</i>"'
00172 tp~queue('<a href = "'r~rdatom~document~hsrcurl'#'r~rdatom~hsrcanchor'">',
00173 r~rdatom~document~filename'</a> line' r~rdatom~feature~startline tagtext'<br/>')
00174 end
00175 tp~queue('<br/>')
00176
00177
00178 end
00179
00180
00181
00182
00183
00184
00185 ::METHOD referrableexpand CLASS
00186
00187 use arg htmlout, m, tp
00188
00189 if m~statrefs~items > 0
00190 then do
00191 tp~queue('<div class="paramname">Statically referenced by</div>')
00192 do r over m~statrefs
00193 src = r~rdatom~document~getsource(r~rdatom~feature)
00194 fc = .flatclause~new(r~rdatom~feature, src)
00195 tagtext = '"<i>'self~htmlizestring(fc~flat)'</i>"'
00196 tp~queue('<a href = "'r~rdatom~document~hsrcurl'#'r~rdatom~hsrcanchor'">',
00197 r~rdatom~document~filename'</a> line' r~rdatom~feature~startline tagtext'<br/>')
00198 end
00199 tp~queue('<br/>')
00200 end
00201
00202 if m~dynrefs~items > 0
00203 then do
00204 tp~queue('<div class="paramname">Dynamically referenced by</div>')
00205 do r over m~dynrefs
00206 src = r~rdatom~document~getsource(r~rdatom~feature)
00207 fc = .flatclause~new(r~rdatom~feature, src)
00208 tagtext = '"<i>'self~htmlizestring(fc~flat)'</i>"'
00209 tp~queue('<a href = "'r~rdatom~document~hsrcurl'#'r~rdatom~hsrcanchor'">',
00210 r~rdatom~document~filename'</a> line' r~rdatom~feature~startline tagtext'<br/>')
00211 end
00212 tp~queue('<br/>')
00213 end
00214
00215
00216
00217
00218
00219
00220 ::METHOD htmlize CLASS
00221 use strict arg c
00222 select
00223 when c = '<'
00224 then return '<'
00225 when c = '>'
00226 then return '>'
00227 when c = '&'
00228 then return '&'
00229 otherwise return c
00230 end
00231
00232
00233
00234
00235 ::METHOD htmlizestring CLASS
00236 use strict arg text
00237 newtext = ''
00238 do while text <> ''
00239 parse var text 1 c 2 text
00240 newtext = newtext || self~htmlize(c)
00241 end
00242 return newtext
00243
00244
00245
00246 ::METHOD trailer CLASS
00247 use arg htmlout, tp
00248
00249 tp~queue('<hr size="1"/>')
00250 tp~queue('<table width="100%"><tr><td width="50%">')
00251 tp~queue('<address style="text-align: left;">')
00252 tp~queue(htmlout~trailericon)
00253 tp~queue('</address>')
00254 tp~queue('</td><td width="50%">')
00255 tp~queue('<address style="text-align: right;">')
00256 tp~queue('<small>')
00257 tp~queue('Generated on' date() time() 'for' htmlout~title 'by')
00258 tp~queue('<a href="https://sourceforge.net/projects/rexxliterate/">')
00259 tp~queue(.nodes~prodimg)
00260 tp~queue('</a>')
00261 tp~queue(' 'htmlout~pversion)
00262 tp~queue('</small>')
00263 tp~queue('</address>')
00264 tp~queue('</td></tr></table>')
00265
00266
00267
00268
00269
00270 ::METHOD writepage CLASS
00271 use arg tp, towrite
00272
00273 rc = SysFileDelete(towrite)
00274 s = .stream~new(towrite)
00275 rc = s~arrayout(tp)
00276 s~close
00277