#!/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: create_docs,v 1.9 2008/08/12 10:48:37 pjx Exp $ # This is a copy of the "create_docs" script from $CCP4/ccp4i/bin # which has been modified to generate the documentation for the Tcl # files in the dbccp4i distribution # 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 dbClientAPI_tcl ClientAPI dbClientAPI dbxml ccp4ilite] ] 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 } append htmlText "\n