about summary refs log tree commit diff
path: root/src/guile/skribilo.scm
diff options
context:
space:
mode:
authorLudovic Courtes2005-07-02 02:04:46 +0000
committerLudovic Courtes2005-07-02 02:04:46 +0000
commit2d740bec3cc50480980d8aae3a06e27a5f0649e5 (patch)
tree8a19b85eed59cd9902c1dc81fc7b6180ff65ef45 /src/guile/skribilo.scm
parentefea4dc93f2565555e47de0bfd027614a9c8674d (diff)
downloadskribilo-2d740bec3cc50480980d8aae3a06e27a5f0649e5.tar.gz
skribilo-2d740bec3cc50480980d8aae3a06e27a5f0649e5.tar.lz
skribilo-2d740bec3cc50480980d8aae3a06e27a5f0649e5.zip
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
Diffstat (limited to 'src/guile/skribilo.scm')
-rwxr-xr-xsrc/guile/skribilo.scm36
1 files changed, 19 insertions, 17 deletions
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)