# -*- tcl -*-
# rules/manpage-html
#
# (c) 2001 Andreas Kupries 
#
# [expand] definitions to convert a tcl based manpage definition into
# a manpage based upon HTML markup. Additional definition files allow
# the conversion into nroff and XML.
#
# This conversion is for standalone manpages ...
#
################################################################
proc here {} [list return [file dirname [info script]]]
source [file join [here] manpage.api]       ; # api, defines all required commands with errors.
source [file join [here] formatting]        ; # HTML basic formatting
proc bgcolor {} {return ""}
proc border  {} {return 0}
# Called before the first pass
proc init_hook {} {setpasses 2}
# Called before the first output.
proc begin_hook {} {
    # Reset the syn flag
    global state
    set state(syn) 0
    set state(req) 0
    return
}
# Called after the last output.
proc end_hook {} {}
################################################################
## Backend for *roff markup
proc manpage_begin {command section version module shortdesc description} {
    set     hdr ""
    append  hdr "$command - $shortdesc "
    append  hdr "[ht_comment {}]\n"
    append  hdr "[ht_comment {Copyright (c) 2000 Andreas Kupries}]\n"
    append  hdr "[ht_comment {All right reserved}]\n"
    append  hdr "[ht_comment {}]\n"
    append  hdr "[ht_comment "CVS: \$Id\$ $command.$section"]\n"
    append  hdr "[ht_comment {}]\n"
    append  hdr " [string trimleft $command :]($section) $version $module \"$shortdesc\"
\n"
    append  hdr "[section NAME]\n"
    append  hdr "[para] $command - $description"
    return $hdr
}
proc manpage_end {} {return