;			     -*-scheme-*-

(message 1 "Loading linuxdoc." #\newline
	   "Please forgive, but this is a real hack yet.")

;(set! docpath-from-arguments 
;      `("/usr/lib/linuxdoc-sgml/dtd/%N.dtd"
;	,(string-append "/usr/lib/linuxdoc-sgml/rep/"
;			(cond
;			 ((equal? doc-output "html") "html")
;			 ((equal? doc-output "info") "info")
;			 ((equal? doc-output "latex") "latex2e")
;			 ((equal? doc-output "man") "groff")
;			 (else "latin1"))
;			"/%N:")
;	. ,docpath-from-arguments))

(set! docpath-from-arguments 
      (let* ((ld-dir "/usr/lib/linuxdoc-sgml")
	     (ldr-dir (string-append ld-dir "/rep/"))
	     (subdir
	      (cond
	       ((equal? doc-output "html") "html")
	       ((equal? doc-output "info") "info")
	       ((equal? doc-output "latex") "latex2e")
	       ((equal? doc-output "man") "groff")
	       (else "latin1"))))
	`(,(string-append ld-dir "/dtd/%N.dtd")
	  ,(apply
	    string-append
	    (map
	     (lambda (i)
	       (string-append i "/sgml/target/"
			      (if (equal? subdir "latin1")
				  "lout" subdir)
			      "/linuxdoc/%N:"))
	     *typeset-lib*))
	  ,(string-append ldr-dir subdir "/%N:")
	  . ,docpath-from-arguments)))
