From 9a5d336c4c31fcd2de9a07fe9bb54b74d94b8c1e Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 19 Mar 2014 18:39:28 -0700 Subject: [PATCH] improving render --- command.rkt | 6 +++--- raco.rkt | 6 +++--- render.rkt | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/command.rkt b/command.rkt index 8d98afc..b744252 100644 --- a/command.rkt +++ b/command.rkt @@ -19,8 +19,8 @@ clone copies rendered files to desktop (displayln (format "Rendering ~a" dir-or-path)) (list dir-or-path)) (begin - (displayln (format "Rendering preproc & pagetree files in directory ~a" dir-or-path) - (apply append (map (λ(proc) (filter proc (directory-list dir-or-path))) (list preproc-source? pagetree-source?))))))))))) + (displayln (format "Rendering preproc & pagetree files in directory ~a" dir-or-path)) + (apply append (map (λ(proc) (filter proc (directory-list dir-or-path))) (list preproc-source? pagetree-source?)))))))))) (define (handle-start directory [port #f]) @@ -45,7 +45,7 @@ clone copies rendered files to desktop [("render") `(begin ;; todo: take extensions off the comand line (displayln "Render preproc & pagetree files ...") - (require "render.rkt" "file-tools.rkt" "world.rkt") + (require "render.rkt" "file.rkt" "world.rkt") (apply render-batch (append-map project-files-with-ext (list world:preproc-source-ext world:pagetree-source-ext))))] [("clone") (let ([target-path (if (> (len args) 1) diff --git a/raco.rkt b/raco.rkt index d999419..53ac619 100644 --- a/raco.rkt +++ b/raco.rkt @@ -7,7 +7,7 @@ (define-for-syntax arg-command-name (with-handlers ([exn:fail? (λ(exn) #f)]) (vector-ref args 0))) -(define-for-syntax arg-project-directory +(define-for-syntax first-arg-or-current-dir (with-handlers ([exn:fail? (λ(exn) (current-directory))]) (path->complete-path (simplify-path (string->path (vector-ref args 1)))))) @@ -24,8 +24,8 @@ (datum->syntax stx (case arg-command-name [(#f "help") (handle-help)] - [("start") (handle-start arg-project-directory arg-server-port)] - [("render") (handle-render (vector-ref args 1))] + [("start") (handle-start first-arg-or-current-dir arg-server-port)] + [("render") (handle-render first-arg-or-current-dir)] [else (handle-else arg-command-name)]))) (select-syntax-for-command) diff --git a/render.rkt b/render.rkt index 1b1d395..9f82516 100644 --- a/render.rkt +++ b/render.rkt @@ -48,7 +48,7 @@ (reset-modification-dates) (for-each (λ(x) ((if (pagetree-source? x) render-pagetree - render-to-file-if-needed) x)) xs)) + render-from-source-or-output-path) x)) xs)) (define/contract+provide (render-pagetree pagetree-or-path)