#$Id: makeDoc.xotcl,v 1.6 2006/09/27 08:12:40 neumann Exp $
package require XOTcl 1.6
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 -exact xotcl::xodoc 0.84
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
}
set files [lrange $argv 1 end]
foreach file $files {
puts "...$file"
if {[catch {XODoc documentFileAsHTML $file $DOCDIR} fb]} {
puts stderr "\terror processing $file:\n[string replace $::errorInfo 400 end ...]"
} else {
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 ne "langRef-xotcl"} {
set tail ", "
if {$dir != $filesDir} {
append filesHtml "