;+ ; NAME: ; www_help_style ; PURPOSE: ; Defines style structure for several languages ; CATEGORY: ; www_help ; CALLING SEQUENCE: FUNCTION www_help_style, idlcode=idlcode, sswcode=sswcode, script=script, $ fortran=fortran, c_code=c_code, cppcode=cppcode, $ tabsize=tabsize, html_name=html_name, html_top=html_top, title=title, $ anycase=anycase, master=master, automatic=automatic, use_path=use_path, $ calls_file=calls_file ; OPTIONAL INPUT PARAMETERS: ; /fortran returns Fortran style structure ; /idlcode returns IDL style structure ; /c_code returns C style structure ; /cppcode returns C++ style structure ; /script returns script style structure ; /sswcode returns SSW style structure (modified IDL style) ; ; No more than one of the above keywords must be selected to set a default style. ; If none is specified the /idlcode is assumed. ; The following keywords modify some of the fields in the style structure. ; ; tabsize=tabsize ; scalar; type: integer; default: 8 ; modifies style.tabsize field ; ; html_name=html_name ; scalar; type: string; default ; modifies style.html_name ; ; html_top=html_top ; array[2]; type: string; default ; sets style.html_top ; ; title=title scalar; type: string; default: value of style.html_name ; modifies style.title ; ; /anycase sets style.anycase ; If anycase is not set than an internally defined default ; is used (for SSW it will still be on). ; ; /automatic sets style.automatic ; only used if /idlcode or /sswcode is set ; OUTPUTS: ; style array[1]; type: structure ; style structure used as input to href=www_help= ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; InitVar ; PROCEDURE: ; Defines and fills a named structure {www_help_style} ; ; commentchar : comment character (';') ; used in href=www_help_get_header= to distinguish code from comments ; ; sect_type : used in href=www_help_section= to locate a list of ; valid section headings ('pro') ; ; tabsize : maximum number of space characters corresponding to tab character ; used in href=www_help_get_header= to replace tabs with the appropriate ; number of spaces. In href=www_help_make= this number is also ; added to the hyperlink for the file name as an argument to passed ; to the cgi-script www_help.cgi. ; ; html_type : extension used for html files ('.htm') ; used in the same places as style.html_name for the same reasons: ; href=www_help_make=, href=www_help_names=, href=www_help_check_marker= ; and href=www_help_called_by= ; ; html_name : primarily used as prefix for the names of html files ('pro'). ; It is used in href=www_help_make= (which creates the html ; files and href=www_help_names=, href=www_help_check_marker= and ; href=www_help_called_by= (which create hyperlinks to headers). ; ; As a secondary use it sets the defaults for style.title ; (converted to uppercase) ; ; Also used for crosslinking with other help systems??? ; ; html_top : if a help system is created for software in a given directory tree ; the name of the top directory can be specified here as a shorthand ; replacement html_top[0] (e.g. 'SSW') and a fully-qualified ; directory name html_top[1] (typically these will be the name and ; value of an environment variable). In the html help files the name ; of the top directory is replaced by style.html_top[0] (with a ; dollar sign prefixed). ; ; Note that for the cgi-script www_help.cgi to be able to reconstruct ; the full file name the line ; $html_top[0]=html_top[1] ; needs to be added to the auxilliary file www_help.lst ; ; title : title for help pages ; Written to html file in href=www_help_make=. Used in href=www_help= ; for displaying message on screen. ; ; anycase : if set then checking for sections is case insensitive. The keyword ; also affects the way the name of a procedure is tracked down. ; See href=www_help_get_header= and sections_ssw.txt for more information. ; Used by href=www_help_get_header= and href=www_help_is_section=. ; ; automatic : can only be used for IDL and Fortran code. ; If set then the information in the CALLS section is ignored and instead ; href=www_help_get_info= is used to determine which procedures and functions ; are referenced by a particular module. ; This option is only accepted if: ; - either /idlcode or /sswcode is set ; - html_top[1] is set to a (hopefully) valid directory ; - environment variable 'www_help' is set. ; MODIFICATION HISTORY: ; JAN-2001, Paul Hick (UCSD/CASS) ; JAN-2002, Paul Hick (UCSD/CASS) ; Added html_top keyword ; JAN-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Added calls_file keyword ;- InitVar, idlcode , /key InitVar, sswcode , /key InitVar, script , /key InitVar, fortran , /key InitVar, c_code , /key InitVar, cppcode , /key InitVar, automatic , /key InitVar, use_path , /key code = [idlcode,sswcode,script,fortran,c_code,cppcode] IF total(code) EQ 0 THEN idlcode = 1 code = [idlcode,sswcode,script,fortran,c_code,cppcode] code = total(code*indgen(n_elements(code))) InitVar, tabsize , 8 InitVar, html_top , ['',''] InitVar, master , 'master' html_type = '.html' CASE use_path OF 0: idl_path = expand_path('+'+html_top[1]) 1: idl_path = !path ENDCASE InitVar, html_name , ([ 'pro', 'ssw','script','for','c','cpp'])[code] InitVar, anycase , ([ 0 , 1, 0 , 0 , 0 , 0 ])[code] start_char = ([';+' ,';+' ,'#+' ,'C+' , '/*+', '//+'])[code] stop_char = ([';-' ,';-' ,'#-' ,'C-' , '-*/', '//-'])[code] commentchar = ([';' ,';' ,'#' ,'C' , ' *', '//' ])[code] sect_type = ([ 'pro', 'ssw','script','for', 'c' , 'cpp'])[code] IF automatic THEN BEGIN IF NOT idlcode AND NOT sswcode AND NOT fortran THEN $ message, 'either /idlcode or /sswcode must be selected to use /automatic' IF (idlcode OR sswcode) AND idl_path EQ '' THEN $ message, 'a valid top directory must be specified in html_top to use /automatic' IF getenv('www_help') EQ '' THEN BEGIN message, /info, 'enviroment variable "www_help" must be set to use /automatic' message, 'it must be set to a directory where the user has write access' ENDIF automatic = automatic AND $ (idlcode OR sswcode OR fortran) AND $ (fortran OR idl_path NE '' ) AND $ getenv('www_help') NE '' ENDIF InitVar, title , html_name InitVar, calls_file, '' style = {www_help_style, $ commentchar : commentchar, $ start_char : start_char, $ stop_char : stop_char, $ sect_type : sect_type, $ tabsize : tabsize, $ html_type : html_type, $ html_name : html_name, $ html_top : html_top, $ idl_path : idl_path, $ title : title, $ anycase : anycase, $ master : master, $ automatic : automatic, $ calls_file : calls_file } RETURN, style & END