pro html_temp2out, infil, outfil ;+ ; NAME: ; html_temp2out ; PURPOSE: ; Given a template html file, replace the file and gif names ; denoted by <> and <> with the ; contents of the file or the appropriate HTML tags. ; OPTIONS: ; <> ;text file
 insert
;	<>	;html (or text) file insert
;	<>	;GIF file
;	<>		;Write UT time string
; SAMPLE CALLING SEQUENCE:
;	html_temp2out, infil, outfil
;	html_temp2out, '$MDI_CAL_INFO/log_health.thtml', 'log_health.html'
; OPTIONAL INPUT:
;	infil	- The path and file name of template file
;	outfil	- The path and file name of output file
; HISTORY:
;	Written 25-Mar-97 by S.Qwan
;	21-May-97 (MDM) - Renamed from "form" to "html_temp2out"
;			- Added the 
 and such for the FILE option
;			- Added 

for the GIF option ; - Added HFILE option ; 28-May-97 (MDM) - Removed html_temp2out_s1 and replaced it with ; calls to strextract ;_ if n_elements(infil) eq 0 then infil = '$MDI_CAL_INFO/log_health.thtml' if n_elements(outfil) eq 0 then outfil = '/mde0/public_html/health_mon/log_health.html' temp = rd_tfile (infil) ss=wc_where(temp, '<>', mcount) for a=mcount-1,0,-1 do begin ii = ss(a) tmp_nm = strtrim( strextract( temp(ii), ':', '>'), 2) out = ['

', rd_tfile(tmp_nm), '

'] temp = [temp(0:ii-1), out, temp(ii+1:*)] end ss=wc_where(temp, '<>', mcount) for a=mcount-1,0,-1 do begin ii = ss(a) tmp_nm = strtrim( strextract( temp(ii), ':', '>'), 2) out = ['

', rd_tfile(tmp_nm), '

'] temp = [temp(0:ii-1), out, temp(ii+1:*)] end ss=wc_where(temp, '<>', mcount) for a=mcount-1,0,-1 do begin ii = ss(a) tmp_nm = strtrim( strextract( temp(ii), ':', '>'), 2) tmp_nm = '
' temp = [temp(0:ii-1), '

', tmp_nm, '

', temp(ii+1:*)] end ss_t=wc_where(temp, '*<>*', mcount) if mcount ne 0 then begin ii=ss_t(0) test=str_sep(temp(ii), '<>') temp_t= test(0) + UT_time() + test(1) temp = [temp(0:ii-1), temp_t, temp(ii+1:*)] end file_delete, outfil prstr, temp, file=outfil end