Install parameters in infodir/mit-scheme-doc-config.scm.
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
# 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+# 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
# Massachusetts Institute of Technology
#
# This file is part of MIT/GNU Scheme.
tags TAGS:
-install: install-info-gz install-man $(INST_TARGETS)
+install: install-config install-info-gz install-man $(INST_TARGETS)
+
+install-config: doc-config.scm
+ $(mkinstalldirs) $(DESTDIR)$(infodir)
+ $(INSTALL_DATA) $< $(DESTDIR)$(infodir)/mit-scheme-doc-config.scm
+
+doc-config.scm:
+ @echo "Saving documentation configuration."
+ @ ( echo "(QUOTE"; \
+ echo " ((INSTALL \"$(INSTALL_DATA)\")"; \
+ echo " (HTMLDIR \"${htmldir}\")"; \
+ echo " (PDFDIR \"${pdfdir}\")"; \
+ echo " (PSDIR \"${psdir}\")))" ) >doc-config.scm
install-info-gz install-info:
$(mkinstalldirs) $(DESTDIR)$(infodir)
etc.
Or click mouse button 2 on a menu item or cross reference to select
it.
- --- PLEASE ADD DOCUMENTATION TO THIS TREE. (See INFO topic first.) ---
-* Menu: The list of major topics begins on the next line.
+* Menu:
+
+Programming Languages
* MIT/GNU Scheme FFI: (mit-scheme-ffi).
Foreign Function Interface
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Massachusetts
+ 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Massachusetts
Institute of Technology
This file is part of MIT/GNU Scheme.
(write-string " (standard-system-loader \"" out)
(write-string dirname out)
(write-string "\"))" out))
+
+(define (install-html destdir title)
+ (guarantee-string destdir 'INSTALL-HTML)
+ (guarantee-string title 'INSTALL-HTML)
+ (let ((conf (doc-conf)))
+ (let ((install (conf-words conf 'INSTALL))
+ (htmldir (string-append destdir (conf-value conf 'HTMLDIR)))
+ (files (files)))
+ (run-command (append install files (list htmldir)))
+ (rewrite-file (merge-pathnames "index.html"
+ (pathname-as-directory htmldir))
+ (lambda (in out)
+ (rewrite-html-index (car files) title in out))))))
+
+(define (rewrite-html-index file title in out)
+
+ (define (match line)
+ (if (eof-object? line)
+ (error "Premature end of HTML documentation index." in))
+ (let ((regs (re-string-match "^<li><a href=\"\\(.*\\)\">\\(.*\\)</a></li>$"
+ line)))
+ (if (not regs)
+ #f
+ (cons (re-match-extract line regs 1)
+ (re-match-extract line regs 2)))))
+
+ (define (write-item file.title)
+ (let ((file (car file.title))
+ (title (cdr file.title)))
+ (write-string (string-append "<li><a href=\""file"\">"title"</a></li>")
+ out)
+ (newline out)))
+
+ (define (copy-prefix)
+ (let* ((line (read-line in))
+ (f.t (match line)))
+ (if (not f.t)
+ (begin
+ (write-string line out)
+ (newline out)
+ (copy-prefix))
+ f.t)))
+
+ (define (copy-items)
+ (let loop ((items (list (copy-prefix))))
+ (let* ((line (read-line in))
+ (f.t (match line)))
+ (if f.t
+ (loop (cons f.t items))
+ (let ((items (let ((entry (assoc file items)))
+ (if entry
+ (delq! entry items)
+ items))))
+ (for-each write-item
+ (sort (cons (cons file title) items)
+ (lambda (f.title1 f.title2)
+ (string<? (cdr f.title1)
+ (cdr f.title2)))))
+ line)))))
+
+ (define (copy-suffix line)
+ (if (not (eof-object? line))
+ (begin
+ (write-string line out)
+ (newline out)
+ (copy-suffix (read-line in)))))
+
+ (copy-suffix (copy-items)))
\f
(define (shim-conf)
(load (system-library-pathname "shim-config.scm")))
+(define (doc-conf)
+ (load (string-append (conf-value (shim-conf) 'INFODIR)
+ "mit-scheme-doc-config.scm")))
+
(define (conf-values conf name)
(let ((entry (assq name conf)))
(if (pair? entry)
compile-shim
link-shim
install-shim
- install-load-option))
\ No newline at end of file
+ install-load-option
+ install-html))
\ No newline at end of file
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Massachusetts
+ 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Massachusetts
Institute of Technology
This file is part of MIT/GNU Scheme.
((environment-lookup (->environment '(ffi)) 'install-load-option)
destdir name directory))
+(define (install-html destdir title)
+ (load-ffi-quietly)
+ ((environment-lookup (->environment '(ffi)) 'install-html) destdir title))
+
(define (load-ffi-quietly)
(if (not (name->package '(FFI)))
(let ((kernel (lambda ()
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Massachusetts
+ 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Massachusetts
Institute of Technology
This file is part of MIT/GNU Scheme.
compile-shim
link-shim
install-shim
- install-load-option)
+ install-load-option
+ install-html)
(initialization (initialize-package!)))
(define-package (runtime program-copier)
stack-sampler:debug-internal-errors?
stack-sampler:show-expressions?
with-stack-sampling)
- (initialization (initialize-package!)))
+ (initialization (initialize-package!)))
\ No newline at end of file