commit 40e6579feaa17bb0d92aa2e15d6addf81fa430c9
parent e04f0ca3f4f0e98a23b9454b059251bed5e71a24
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Sat, 1 Dec 2007 13:38:40 +0000
make scribble executable report the output file
svn: r7884
original commit: 2ea9ded9bfda2f04f563d2e1eb91a17639262b6a
Diffstat:
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/collects/scribble/base-render.ss b/collects/scribble/base-render.ss
@@ -34,6 +34,10 @@
(substring s 0 (sub1 (string-length s))))
sep)))
+ (field [report-output? #f])
+ (define/public (report-output!)
+ (set! report-output? #t))
+
;; ----------------------------------------
;; marshal info
@@ -292,7 +296,7 @@
(define/public (render ds fns ri)
(map (lambda (d fn)
- (when #f
+ (when report-output?
(printf " [Output to ~a]\n" fn))
(with-output-to-file fn
#:exists 'truncate/replace
diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss
@@ -525,6 +525,8 @@
part-whole-page?
format-number)
+ (inherit-field report-output?)
+
(define/override (get-suffix) #"")
(define/override (get-dest-directory)
@@ -572,7 +574,8 @@
(define/override (render ds fns ri)
(map (lambda (d fn)
- (printf " [Output to ~a/index.html]\n" fn)
+ (when report-output?
+ (printf " [Output to ~a/index.html]\n" fn))
(unless (directory-exists? fn)
(make-directory fn))
(parameterize ([current-subdirectory (file-name-from-path fn)])
diff --git a/collects/scribble/run.ss b/collects/scribble/run.ss
@@ -69,6 +69,7 @@
(let ([renderer (new ((current-render-mixin) render%)
[dest-dir dir])])
+ (send renderer report-output!)
(let* ([fns (map (lambda (fn)
(let-values ([(base name dir?) (split-path fn)])
(let ([fn (path-replace-suffix (or (current-dest-name) name)