#$Id: makeDoc.xotcl,v 1.2 2004/08/22 09:30:46 neumann Exp $
package require XOTcl
namespace import ::xotcl::*
@ @File {
description {
Documentation tool for the XOTcl distribution.
Usage: 'makeDoc docdir filename ?filename ...?'
Called by Makefile.
}
}
lappend auto_path [file dirname [info script]]
package require xotcl::package
package verbose 1
package require xotcl::xodoc
set fileList ""
puts "XOTcl Documentation Tool"
puts "------------------------"
if {$argc > 1} {
set DOCDIR [lindex $argv 0]
puts "Documenting to directory $DOCDIR:"
if {![file isdirectory $DOCDIR]} {
file mkdir $DOCDIR
}
if {$::tcl_platform(platform) == "windows"} {
set files ""
foreach f [lrange $argv 1 end] {
eval lappend files [glob -nocomplain $f]
}
} else {
set files [lrange $argv 1 end]
}
foreach file $files {
puts "...$file"
set fb [XODoc documentFileAsHTML $file $DOCDIR]
lappend fileList $file $fb
}
} else {
error "usage: xodoc docdir filename ?filename ...?"
}
set filesHtml ""
set filesDir ""
## write index page
foreach {f fb} $fileList {
set dir .
regexp {^(.*)/[^/]*$} $f _ dir
if {$fb != "langRef-xotcl"} {
set tail ", "
if {$dir != $filesDir} {
append filesHtml "