;+ ; NAME: ; www_help_master ; PURPOSE: ; Recreate the master help file for 'destination' ; CATEGORY: ; gen/idl ; CALLING SEQUENCE: PRO www_help_master, destination, style, copyright=copyright ; INPUTS: ; destination scalar; type: string ; destination directory of html files ; style array[1]; type: structure ; www_help_style structure ; OUTPUTS: ; (html file for master catalogue to destination directory) ; INCLUDE: @compile_opt.pro ; On error, return to caller @www_help_version.pro ; Defines version ; CALLS: ; IsType, www_help_crosslinks, www_help_frames, www_help_mailto ; PROCEDURE: ; All catalogues in the destination directory (*_list.htm) files ; are combined into a single master catalogue. Hyperlinks to all ; of the individual catalogues are also provided. ; MODIFICATION HISTORY: ; FEB-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- print print title = style.master type = style.html_type ; Get a list of all catalogues (keep current catalogue; the master catalogue ; is omitted by default) www_help_crosslinks, destination, style, crosslinks, list, /keep_style CASE IsType(crosslinks, /defined) OF 0: BEGIN message, /info, 'master catalogue not updated' RETURN END 1: message, /info, 'updating master catalogue' ENDCASE rsi_present = IsType(list,/defined) IF rsi_present THEN rsi_present = (where(list EQ 'rsi'))[0] NE -1 ; This is needed to make sure the text frame in the html help page can ; be filled with a valid html file. first = list[0]+'_'+strlowcase( strmid(crosslinks[0,0],0,1) ) crosslinks = crosslinks[*,sort(strupcase(crosslinks[0,*]))] name = reform(crosslinks[0,*]) link = reform(crosslinks[1,*]) count = n_elements(name) ;======================================== ; Write file defining positions of frames content = ['' , $ '','www_help '+title+' help','' , $ www_help_frames(title, first, type), $ '' , $ '<body bgcolor="#000000">' , $ '<p>This page uses frames</p>' , $ '</body>' , $ '' , $ '' ] openw , iu, /get_lun, /stream, filepath(root=destination,title+'_frames'+type) FOR i=0L,n_elements(content)-1 DO printf, iu, content[i] free_lun, iu ;======================================== ; Write file with the single character links A B C etc content = [ '', $ '',$ '', $ ; Add hyperlinks to all catalogues in 'list' ''+list+ $ ''] ; Set up a one-line list of letters A-Z with links to the first routine starting with each letter. ; This file (*_alphabet.htm) will fill in the top frame of the help window ; The links created have the form ; R firstchar = strupcase( strmid(name,0,1) ) isfirst = intarr(count) FOR i=(byte('A'))[0],(byte('Z'))[0] DO BEGIN ; Loop over uppercase letters tmp = string(i) ; Uppercase single char iunit = (where(firstchar EQ tmp))[0] IF iunit NE -1 THEN BEGIN isfirst[iunit] = 1 tmp = ''+tmp+'' ENDIF content = [content, tmp] ENDFOR content = [content,'','',''] openw , iu, /get_lun, /stream, filepath(root=destination, title+'_alphabet'+type) FOR i=0L,n_elements(content)-1 DO printf, iu, content[i] free_lun, iu ;======================================== ; Write the alphabetical list of routine names ; This file (*_list.htm) will fill the frame on the left ; First set up the links to the first routine for each letter (where isfirst = 1) content = replicate('
  • ',count) tmp = where(isfirst) IF tmp[0] NE -1 THEN $ content[tmp] = content[tmp]+'' content = content+link ; Set up whole file content tt = systime() tt = strmid(tt,20)+'-'+strmid(tt,4,3)+'-'+strmid(tt,8,2) IF IsType(copyright,/defined) AND NOT rsi_present THEN BEGIN ;IF (file_search( filepath(root=destination, copyright) ))[0] NE '' THEN BEGIN notice_label = strmid(copyright, 0, strpos(copyright,'_')) IF notice_label EQ '' THEN notice_label = 'Copyright' tt = tt+' © '+notice_label+'' ;ENDIF ENDIF mailto = 'pphick@ucsd.edu' content = [ $ '' , $ '' , $ '' , $ title+' '+version , $ '' , $ '' , $ '' , $ '' , $ ''+title+' @'+tt , $ '
    ' , $ ''+version+' ('+www_help_mailto(mailto,/href,subject=version,title='Comments ?')+')', $ '
    ' , $ '' , $ '' , $ '' ] openw , iu, /get_lun, /stream, filepath(root=destination, title+'_list'+type) FOR i=0L,n_elements(content)-1 DO printf, iu, content[i] free_lun, iu RETURN & END