From 2d740bec3cc50480980d8aae3a06e27a5f0649e5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtes Date: Sat, 2 Jul 2005 02:04:46 +0000 Subject: Started relying on the per-module reader; first doc produced ever! First document compiled by Skribilo to HTML! * src/guile/skribilo/module.scm (define-skribe-module): Use the `#:reader' option of `define-module' (not yet integrated in Guile 1.7). Plus lots of other things... git-archimport-id: lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-3 --- src/guile/skribilo.scm | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'src/guile/skribilo.scm') diff --git a/src/guile/skribilo.scm b/src/guile/skribilo.scm index ae21fab..a43ec66 100755 --- a/src/guile/skribilo.scm +++ b/src/guile/skribilo.scm @@ -59,10 +59,6 @@ exec ${GUILE-guile} --debug -l $0 -c "(apply $main (cdr (command-line)))" "$@" the-arg)))))))) -(set! %load-hook - (lambda (file) - (format #t "~~ loading `~a'...~%" file))) - (define-module (skribilo)) @@ -415,6 +411,11 @@ Processes a Skribilo/Skribe source file and produces its output. (set-skribe-debug! (string->number debugging-level)) + (if (> (skribe-debug) 4) + (set! %load-hook + (lambda (file) + (format #t "~~ loading `~a'...~%" file)))) + (set! %skribilo-load-path (cons load-path %skribilo-load-path)) (set! %skribilo-bib-path @@ -426,9 +427,6 @@ Processes a Skribilo/Skribe source file and produces its output. ;; Load the user rc file ;(load-rc) - ;; load the basic Skribe modules - (load-skribe-modules) - ;; Load the base file to bootstrap the system as well as the files ;; that are in the PRELOAD variable. (find-engine 'base) @@ -442,24 +440,28 @@ Processes a Skribilo/Skribe source file and produces its output. (reverse! variants)) (let ((files (option-ref options '() '()))) - (if (null? files) - (error "you must specify at least the input file" files)) + (if (> (length files) 2) (error "you can specify at most one input file and one output file" files)) - (let* ((source-file (car files)) - (dest-file (if (null? (cdr files)) #f (cadr files))) - (source-port (open-input-file source-file))) + (let* ((source-file (if (null? files) #f (car files))) + (dest-file (if (or (not source-file) + (null? (cdr files))) + #f + (cadr files))) + (do-it! (lambda () + (if (string? dest-file) + (with-output-to-file dest-file doskribe) + (doskribe))))) (if (and dest-file (file-exists? dest-file)) (delete-file dest-file)) - (with-input-from-file source-file - (lambda () - (if (string? dest-file) - (with-output-to-file dest-file doskribe) - (doskribe)))))))) + (if source-file + (with-input-from-file source-file + do-it!) + (do-it!)))))) (define main skribilo) -- cgit v1.2.3