stk/Lib/help.stk

42 lines
1.3 KiB
Plaintext

;;;;
;;;; Help management
;;;;
;;;; Copyright © 1993-1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;; Permission to use, copy, and/or distribute this software and its
;;;; documentation for any purpose and without fee is hereby granted, provided
;;;; that both the above copyright notice and this permission notice appear in
;;;; all copies and derived works. Fees for distribution or use of this
;;;; software or derived works may only be charged with express written
;;;; permission of the copyright holder.
;;;; This software is provided ``as is'' without express or implied warranty.
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 14-Sep-1993 13:30
;;;; Last file update: 28-May-1998 19:10
;;;;
(require "www-browser")
(select-module STk)
(define (STk:show-help-file name)
;; Show the file (after having found the Help directory)
(let loop ((l *help-path*))
(if (null? l)
(error "Cannot find help file ~S" name)
(let* ((f (string-append (car l) "/" name))
(fd (open-file f "r")))
(catch (close-port fd))
(if fd
(www:browser :url f)
(loop (cdr l)))))))
(define (help . arg)
(if (null? arg)
(STk:show-help-file "STk-hlp.html")
(STk:show-help-file (format #f "~A.n.html" (car arg))))
#f)
(provide "help")