pro make_help, dummy, codedir=codedir, outfile=outfile
;+
;
; procedure: make_help
;
; purpose: make ASP "routines.html" documentation file
;
; author: rob@ncar, 9/95
;
; note: This routine replaces the 'make_help' shell script that
; produced the old (pre-IDL version 4.0) IDL help files.
;
;==============================================================================
;
; Check number of parameters.
;
if n_params() ne 0 then begin
print
print, "usage: make_help"
print
print, " Make ASP 'routines.html' documentation file."
print
print, " Arguments"
print, " (none)"
print
print, " Keywords"
print, " codedir - directory containing IDL code"
print, " (def='/home/stokes/src/idl')"
print
print, " outfile - output documentation file"
print, " (def='/home/stokes/doc/routines.html')"
print
return
endif
;-
;
; Set some variables.
;
if n_elements(codedir) eq 0 then codedir = '/home/stokes/src/idl'
if n_elements(outfile) eq 0 then outfile = '/home/stokes/doc/routines.html'
date = systime()
user = getenv('USER') & if user eq '' then user = 'unknown-user'
link1 = ''
link3 = ' '
link4 = '
'
;
; Create one-liners in temp file.
;
message, 'making temporary file...', /info
purpose, codedir, outfile=outfile, /noverb
;
; Read lines from temp file and insert breaks.
;
message, 'reading temporary file...', /info
openr, unit, outfile, /get_lun
s = ''
s_array = [s]
line = 0
while not eof(unit) do begin
readf, unit, s
if line ge 4 then begin
words = get_words(s)
name = strlowcase(words(0)) + '.pro'
purpose = ''
for i = 1, sizeof(words)-1 do $
purpose = purpose + words(i) + ' '
link = link1 + name + link2 + name + link3 + purpose + link4
s_array = [s_array, link]
endif
line = line + 1
endwhile
free_lun, unit
;
; Insert header and footer HTML.
;
s_array = ['
', $ ' ', $ s_array, $ ' ', $ '
', $ 'ASP Documentation', $ '', $ ' ', $ '- Updated (', date, ') by ', user, $ '.' ] ; ; Rewrite temp file. ; message, 'rewriting final output over temporary file...', /info openw, unit, outfile, /get_lun printf, unit, s_array free_lun, unit end