;;;; -*-Scheme-*-
;;;;
;;;; $Revision: 1.18 $
;;;;
;;;; `man' specific definitions for HTML output format
;;; --------------------------------------------------------------------------
;;; Options.
(define-option 'do-signature 'boolean #t)
;;; --------------------------------------------------------------------------
;;; Miscellaneous definitions.
(defstring 'R "®") ; trademark
(defstring 'S "") ; change to default point size
(defstring 'lq "``")
(defstring 'rq "''")
(define-font 'L ' ') ; whatever font L is supposed to be...
;;; --------------------------------------------------------------------------
;;; Bookkeeping for .TH, for requests that occur in pairs, etc.
(define-pair header header? "
\n" "
\n")
(define-pair tag-para tag-para? "\n" "
\n")
(define-pair list-para list-para? "\n")
(define-pair hang-para hang-para? "" "\n")
(define (reset-everything)
(concat
(reset-font)
(center 0)
(header #f)
(preform #f)
(hang-para #f)
(tag-para #f)
(list-para #f)))
(define-nested-pair indent indent-level "- \n" "
\n")
;;; --------------------------------------------------------------------------
;;; File prolog and epilog functions.
(defevent 'prolog 10
(lambda (pathname filename)
(if (not (string=? filename "stdin"))
(set-option! 'document filename))
(let ((docname (option 'document)))
(if docname
(set-output-stream! (open-output-stream (concat docname ".html"))))
(emit-HTML-prolog))))
(defevent 'epilog 10
(lambda _
(complain-if-no-title)
(emit (reset-everything) (indent 0))
(if (option 'do-signature)
(emit
(substitute
"
\nMarkup created by %progname% %version%,")
nbsp nbsp
(substitute "%monthname+% %day%, %year%.\n")))
(emit "