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 ::REQUIRES 'fsobjects.cls'
00047  
00048 
00049 ::REQUIRES 'documents.cls'
00050  
00051 
00052 ::REQUIRES 'nodes.cls'
00053  
00054 
00055 ::REQUIRES 'htmlrexxprogram.cls'
00056 ::REQUIRES 'htmlrexxclass.cls'
00057 ::REQUIRES 'htmlrexxsource.cls'
00058 ::REQUIRES 'htmltext.cls'
00059  
00060 
00061  
00062 
00063 
00064 ::CLASS htmlout PUBLIC
00065 ::ATTRIBUTE hdest  
00066 ::ATTRIBUTE pversion  
00067 ::ATTRIBUTE title  
00068 ::ATTRIBUTE prefixcomment 
00069 ::ATTRIBUTE trailericon 
00070 ::ATTRIBUTE topmenu  
00071 ::ATTRIBUTE rexxliterate 
00072 ::ATTRIBUTE pwrongdoc   
00073 ::ATTRIBUTE pmissingdoc 
00074  
00075 
00076 
00077 ::METHOD init
00078   use strict arg rexxliterate, hdest, pversion, title, prefixcomment, trailericon
00079  
00080   self~rexxliterate = rexxliterate
00081   self~hdest = hdest
00082   self~pversion = pversion
00083   self~title = title
00084   self~prefixcomment = prefixcomment
00085   self~trailericon = trailericon
00086   self~topmenu = .queue~new
00087  
00088   self~pmissingdoc = .queue~new
00089   self~pwrongdoc = .queue~new
00090  
00091   self~topmenu~queue(.array~of('main',       'main.html',       'petmain'))
00092   if rexxliterate~modules~items > 0
00093     then self~topmenu~queue(.array~of('documents',    'documents.html',    'petdocuments'))
00094   self~topmenu~queue(.array~of('programs',   'programs.html',   'petprograms'))
00095   self~topmenu~queue(.array~of('classes',    'classes.html',    'petclasses'))
00096   self~topmenu~queue(.array~of('methods',    'methods.html',    'petmethods'))
00097   self~topmenu~queue(.array~of('attributes', 'attributes.html', 'petattributes'))
00098   self~topmenu~queue(.array~of('procedures', 'procedures.html', 'petprocedures'))
00099   self~topmenu~queue(.array~of('routines',   'routines.html',   'petroutines'))
00100   self~topmenu~queue(.array~of('constants',  'constants.html',  'petconstant'))
00101   self~topmenu~queue(.array~of('options',    'options.html',    'petoptions'))
00102   self~topmenu~queue(.array~of('text',       'text.html',       'pettext'))
00103   self~topmenu~queue(.array~of('files',      'files.html',      'petfiles'))
00104  
00105 ::METHOD modules
00106   use arg modules
00107  
00108   mh = .head_html~new~text
00109   mh~queue('<title>'self~title 'Documents</title>')
00110  
00111   mh~queue(.nodes~prodssheet)
00112   mh~queue('<link rel="stylesheet" href="tabs.css">')
00113   mh~queue('</head>')
00114   self~tabshead(mh, self~topmenu, 'petdocuments')
00115   mh~queue('<hr size="1"/>')
00116   mh~queue('<h1>'self~title' Documents</h1>')
00117   mh~queue('Here is a list of document sections')
00118   mh~queue('<ul>')
00119   do i over modules
00120     o = modules[i]
00121     mh~queue('<li><a class="el" href="MOD_'o~modname'.html">'o~modname'</a>'o~description'</li>')
00122     
00123     self~modpage(o)
00124   end
00125   mh~queue('</ul>')
00126  
00127   .htmlutil~trailer(self, mh)
00128   
00129   towrite = self~hdest||'documents.html'
00130   .htmlutil~writepage(mh, towrite)
00131  
00132 ::METHOD modpage
00133   use arg module
00134  
00135   mh = .head_html~new~text
00136   mh~queue('<title>'module~modname'</title>')
00137  
00138   mh~queue(.nodes~prodssheet)
00139   mh~queue('<link rel="stylesheet" href="tabs.css">')
00140   mh~queue('</head>')
00141   self~tabshead(mh, self~topmenu, 'petdocuments')
00142   mh~queue('<hr size="1"/>')
00143   mh~queue('<h1>'module~modname module~description'</h1>')
00144   do i over module~text
00145     mh~queue(self~repcode(i))
00146   end
00147   .htmlutil~trailer(self, mh)
00148   
00149   towrite = self~hdest||'MOD_'module~modname'.html'
00150   .htmlutil~writepage(mh, towrite)
00151  
00152 ::METHOD repcode PRIVATE
00153   parse arg text
00154  
00155   text = text~changestr('@code', '<pre class="fragment">')
00156   text = text~changestr('@endcode', '</pre>')
00157  
00158   return text
00159  
00160  
00161 ::METHOD firstpage
00162   use arg docs, treeframe
00163  
00164   
00165   mh = .head_html~new~text
00166   mh~queue('<title>'self~title'</title>')
00167   mh~queue(.nodes~prodssheet)
00168   mh~queue('<link rel="stylesheet" href="tabs.css">')
00169   mh~queue('</head>')
00170   self~tabshead(mh, self~topmenu, 'petmain')
00171   mh~queue('<hr size="1"/>')
00172   mh~queue('<h1>'self~title'</h1>')
00173   do i over docs
00174     mh~queue(i)
00175   end
00176   .htmlutil~trailer(self, mh)
00177  
00178   
00179   if treeframe
00180    then do
00181           say 'building tree'
00182           
00183           fs = .head_html~new~text
00184           fs~queue('<title>'self~title'</title>')
00185           fs~queue('</head>')
00186           do i over .frameset_html~new~text
00187             fs~queue(i)
00188           end
00189           fs~queue('</html>')
00190           rc = SysFileDelete(self~hdest'index.html')
00191           s = .stream~new(self~hdest'index.html')
00192           rc = s~arrayout(fs)
00193           s~close
00194  
00195           
00196           towrite = self~hdest||'main.html'
00197           .htmlutil~writepage(mh, towrite)
00198  
00199         end
00200    else do
00201           
00202           towrite = self~hdest||'index.html'
00203           .htmlutil~writepage(mh, towrite)
00204         end
00205  
00206 
00207 
00208 
00209 
00210 ::METHOD rhtmlpage
00211   use arg folder, file, globalix
00212   
00213   .htmlrexxprogram~emit(self, folder, file, globalix)
00214   
00215   .htmlrexxsource~emit(self, file, globalix)
00216  
00217 
00218 
00219 
00220 ::METHOD thtmlpage
00221   use arg folder, file
00222   
00223   .htmltext~emit(self, folder, file)
00224  
00225 
00226 
00227 
00228 ::METHOD noprefix
00229   use strict arg bc
00230   if self~prefixcomment = .nil
00231     then return bc
00232  
00233   do j = 1 to bc~text~items
00234     if bc~text[j] <> self~prefixcomment[j]
00235       then leave
00236   end
00237  
00238   if j = 1
00239     then return bc
00240  
00241   ntext = .queue~new
00242   ntext~queue('prefix comment removed<br>')
00243   do j = j to bc~text~items
00244     ntext~queue(bc~text[j])
00245   end
00246   bc~text = ntext
00247  
00248   return bc
00249  
00250 
00251 
00252 
00253 
00254 
00255 
00256 
00257 ::METHOD tabshead
00258   use strict arg outq, tablist, selector
00259  
00260   outq~queue('<div class="tabs">')
00261     outq~queue('<ul>')
00262  
00263   do i over tablist
00264     if i[3] = selector
00265       then outq~queue('<li class="current">')
00266       else outq~queue('<li>')
00267     outq~queue('<a href="'i[2]'">')
00268     outq~queue('<span>'i[1]'</span>')
00269     outq~queue('</a>')
00270   end
00271  
00272   outq~queue('</ul>')
00273   outq~queue('</div>')
00274