#!/bin/sh # \ exec $CCP4I_TCLTK/tclsh "$0" -- ${1+"$@"} # Copyright (C) 1999-2004 Liz Potterton, Peter Briggs # # This code is distributed under the terms and conditions of the # CCP4 Program Suite Licence Agreement as a CCP4 Library. # A copy of the CCP4 licence can be obtained by writing to the # CCP4 Secretary, Daresbury Laboratory, Warrington WA4 4AD, UK. # #CCP4i_cvs_Id $Id$ # Source startup.tcl appropriate for operating system set system(OPSYS) [string toupper $tcl_platform(platform)] source [file join $env(CCP4I_TOP) bin $system(OPSYS) startup.tcl] # Source the useful utils source [file join $env(CCP4I_TOP) src system.tcl] source [file join $env(CCP4I_TOP) src utils.tcl] #---------------------------------------------------------------------- # The following declarations are liable to change #---------------------------------------------------------------------- # list of files to be processed - the inner loop is. # - a name for the output html file # - the ccp4i subdirectory containing files to be processed # - list of files set doclist [list [list system src system utils] \ [list taskbrowser src task taskbrowser browser_utils] \ [list modules_utils src modules_utils] \ [list CCP4_utils src CCP4_utils ] \ [list local src local ] \ [list database src database runjob projectdirs projectdb ] \ [list windows src window taskwindow exframe varmenu] \ [list mega_widgets src util_windows fileselect directories ] \ [list plugins src fileviewer plugins ] \ [list execute src execute job_utils ] \ [list utilities utils map_utils pdb_utils phasing_utils amore_utils] \ [list install_utils utils CCP4i_packages_utils] \ [list xml_utils utils xml_utils] \ [list maths src vectors] ] set htmlHeader "
$line
\n } index_title { set target [RemoveMetaChars $line] append contentsText "
Argument list: $argList
\n" } desc { append htmlText$line
\n } arg { append htmlText "
[lindex $line 0] [lrange $line 1 end]
\n" } opt0 { if { [llength $line] > 1 } { append htmlText "
[lindex $line 0] [lrange $line 1 end]
\n" } else { append htmlText "
$line
\n" } } opt1 { append htmlText "
$line
\n" } ref { set mode file set path {} switch [lindex $line 0] \ PROGRAMS { set path [file join "../../../../html/" [lindex $line 1]] } CCP4I { set path [file join "../../../help/" [lindex $line 1]] } PROGDOCS { set path [file join "./" [lindex $line 1]] } REMOTE { set path "http://[lindex $line 1]" set mode http } CURRENT { set path "#[lindex $line 1]" } append htmlText "[lrange $line 2 end]" } doc { append htmlText \ "See Programmers Documentation" } # # If find a procedure declaration in file then save the procedure name } elseif { [regexp {^proc } $line0] } { # remove the open/close brace from the line or it might be mishandled by lindex regsub -all {\{|\}} $line0 {} procLine set procName [lindex $procLine 1] # Create a formatted argument list for writing out later set argList "" for {set i 2} {$i<[llength $procLine]} {incr i} { append argList " <[lindex $procLine $i]>" } if {$argList == ""} { set argList "None" } } incr l } } # Write out the html file for this document puts "Writing docs to [file join $docPath $htmlFile]" append htmlText $htmlFooter WriteFile [file join $docPath $htmlFile] $htmlText -overwrite } puts "Writing list of procedures to [file join $docPath $indexFile]" append contentsText \n $indexText $htmlFooter WriteFile [file join $docPath $indexFile] $contentsText -overwrite exit