;+ ; NAME: ; www_help_smei ; PURPOSE: ; Creates html help files for fortran and idl software ; CATEGORY: ; www_help ; CALLING SEQUENCE: PRO www_help_smei, $ idlonly = idlonly , $ fortranonly = fortranonly , $ scriptonly = scriptonly , $ c_only = c_only , $ cpp_only = cpp_only , $ remote_dir = remote_dir , $ cgi_bin = cgi_bin , $ destination = destination , $ copyright = copyright ; INPUTS: ; (none) ; OPTIONAL INPUTS: ; destination=destination ; scalar; type: string; default: $SSW_SMEI/html/help/smei/ ; Local destination directory of help files ; cgi_bin=cgi_bin ; scalar; type: string: default: http://ips.ucsd.edu/cgi-bin/ ; Location of cgi scripts ; remote_dir=remote_dir ; scalar; type: string ; Remote destinations of html files. ; in the form host:directory ; e.g. cassfos02.ucsd.edu:/u8/WWW/sola/help/smei/ ; ; OUTPUTS: ; (html files are created in 'destination') ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; InitVar, IsType, www_help, www_help_style, do_file ; PROCEDURE: ; Directories $SSW_SMEI and $SSW_SMEI/for are scanned recursively for ; source code files *.pro and *.f. ; MODIFICATION HISTORY: ; JAN-2001, Paul Hick (UCSD/CASS) ; APR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Changes tabsize for scripts to 4 (was default 8) ;- InitVar, idlonly , /key InitVar, fortranonly, /key InitVar, c_only , /key InitVar, cpp_only , /key InitVar, scriptonly , /key InitVar, cgi_bin , 'http://ips.ucsd.edu/cgi-bin/' InitVar, destination, filepath(root=getenv('HTM'),subdir='help','smei') InitVar, copyright , 'UCSD_copyright.html' IF total([idlonly,fortranonly,scriptonly,c_only,cpp_only]) EQ 0 THEN BEGIN idlonly = 1 fortranonly = 1 c_only = 1 cpp_only = 1 scriptonly = 1 ENDIF smei = filepath(root=getenv('SSW_SMEI'),'') setenv, 'www_help='+getenv('TUB') master = 'SMEI' html_top = ['SMEI',smei] email = ['pphick@ucsd.edu','bvjackson@ucsd.edu'] IF idlonly THEN www_help, ['*.pro'], $ paths = smei, $ /recursive, $ destination = destination, $ /update_master, $ cgi_bin = [cgi_bin,'help','smei'], $ copyright = copyright, $ email = email, $ style = www_help_style(/idlcode,html_name='pro',html_top=html_top, $ ;calls_file=filepath(root=getenv('TUB'),'www_help_idl_calls.txt'), $ tabsize=4, master=master, /automatic),$ swap_style = [ www_help_style(/idlcode, html_name='rsi'), $ www_help_style(/fortran), $ www_help_style(/c_code ), $ www_help_style(/script )], $ excl_files = ['*.pro'], $ excl_paths = [ filepath(root=smei,subdir='pro','obsolete'), $ filepath(root=smei,subdir=['ucsd','obsolete'],'idl' ), $ filepath(root=smei,subdir=['user','bjackson'],'corr'), $ filepath(root=smei,subdir='user','xuepu' ), $ filepath(root=smei,subdir='user','asmith' ), $ filepath(root=smei,subdir='user','hanscom_afb'),$ filepath(root=smei,subdir='user','tdetman')], $ /excl_recursive, $ incl_sets = ['for','script','c','rsi'] IF fortranonly THEN www_help, ['*.f','*.h'], $ paths = smei, $ /recursive, $ destination = destination, $ /update_master, $ cgi_bin = [cgi_bin,'help','smei'], $ copyright = copyright, $ email = email, $ style = www_help_style(/fortran,html_name='for',html_top=html_top, $ master=master, /automatic), $ swap_style = [ www_help_style(/idlcode), $ www_help_style(/c_code ), $ www_help_style(/script )], $ excl_paths = [ filepath(root=smei,subdir=['ucsd','obsolete'],'for' ), $ filepath(root=smei,'cpp'), $ filepath(root=smei,subdir=['ucsd','gen','for','h' ],'win' ) , $ filepath(root=smei,subdir=['ucsd','gen','for','h' ],'unix') , $ filepath(root=smei,subdir=['ucsd','gen','for','os'],'win' ) , $ filepath(root=smei,subdir=['ucsd','gen','for','os'],'unix') , $ filepath(root=smei,subdir='user','bjackson' ), $ filepath(root=smei,subdir='user','asmith' ), $ filepath(root=smei,subdir='user','tdetman')], $ /excl_recursive, $ incl_sets = ['pro','c','script'] IF scriptonly THEN www_help, '*', $ paths = [filepath(root=smei,subdir='com','linux' ), $ filepath(root=smei,subdir=['ucsd','gen'],'python'), $ filepath(root=smei,subdir=['ucsd','gen','exe'],'linux') ], $ destination = destination, $ /update_master, $ cgi_bin = cgi_bin, $ copyright = copyright, $ email = email, $ style = www_help_style(/script,html_name='script',html_top=html_top,tabsize=8,master=master), $ swap_style = [ www_help_style(/fortran), $ www_help_style(/idlcode), $ www_help_style(/c_code )], $ excl_files = ['*.pyc','*.lst'], $ excl_paths = filepath(root=smei,subdir=['ucsd','gen'],'python'), $ /excl_recursive, $ incl_sets = ['for','pro','c'] IF c_only THEN www_help, ['*.c','*.h'], $ paths = smei, $ /recursive, $ destination = destination, $ /update_master, $ cgi_bin = cgi_bin, $ copyright = copyright, $ email = email, $ style = www_help_style(/c_code,html_name='c',html_top=html_top, $ master=master), $ swap_style = [www_help_style(/idlcode), $ www_help_style(/fortran), $ www_help_style(/script )], $ excl_files = ['*.c','*.h'], $ excl_paths = [ filepath(root=smei,subdir=['for','lib' ],'obsolete'), $ filepath(root=smei,subdir='for','h')], $ /excl_recursive, $ incl_sets = ['pro','for','script'] ; ftp files if requested IF IsType(remote_dir, /defined) THEN BEGIN colon = strpos(remote_dir, ':') remote_host = strmid(remote_dir, 0, colon) remote_dest = strmid(remote_dir, colon+1) cmd = [ $ 'cd ' +remote_dest, $ ; Destination directory 'lcd '+destination, $ ; Local directory with *.htm files 'ascii', $ ; Switch to ascii mode 'mput *.htm', $ ; Transfer *.htm files 'quit'] ; Exit tmp_file = filepath(root=getenv('TUB'), 'help.ftp') openw, /get_lun, iu, tmp_file FOR i=0,n_elements(cmd)-1 DO printf, iu, cmd[i] free_lun, iu cmd = 'cat '+tmp_file+' | ftp -i '+remote_host spawn, cmd tmp = do_file(/delete, tmp_file) ENDIF message, /info, 'done' RETURN & END