From 3afea47779803ce0b8e690f97493986e23c16f28 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 30 Jan 2016 06:55:06 -0800 Subject: [PATCH] change `render*` back to `render-batch` --- pollen/private/command.rkt | 4 ++-- pollen/render.rkt | 5 +++-- pollen/scribblings/render.scrbl | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pollen/private/command.rkt b/pollen/private/command.rkt index 046e686..1c5c02a 100644 --- a/pollen/private/command.rkt +++ b/pollen/private/command.rkt @@ -111,10 +111,10 @@ version print the version (~a)" (setup:current-server-port) setup [else (displayln (format "rendering preproc & pagetree files in directory ~a" dir)) preprocs-and-static-pagetrees]))) - (apply render* batch-to-render))) + (apply render-batch batch-to-render))) (begin ; first arg is a file (displayln (format "rendering ~a" (string-join (map ->string path-args) " "))) - (apply render* path-args))))) + (apply render-batch path-args))))) (define (handle-start directory-maybe [port #f]) (when (not (directory-exists? directory-maybe)) diff --git a/pollen/render.rkt b/pollen/render.rkt index a6c3de0..567c93c 100644 --- a/pollen/render.rkt +++ b/pollen/render.rkt @@ -45,9 +45,10 @@ (define (list-of-pathish? x) (and (list? x) (andmap pathish? x))) -(define+provide/contract (render* . xs) + +(define+provide/contract (render-batch . xs) (() #:rest list-of-pathish? . ->* . void?) - ;; Why not just (map render ...)? + ;; Why not just (for-each render ...)? ;; Because certain files will pass through multiple times (e.g., templates) ;; And with render, they would be rendered repeatedly. ;; Using reset-modification-dates is sort of like session control. diff --git a/pollen/scribblings/render.scrbl b/pollen/scribblings/render.scrbl index 7cf734b..63d02e9 100644 --- a/pollen/scribblings/render.scrbl +++ b/pollen/scribblings/render.scrbl @@ -55,16 +55,16 @@ If none of these conditions exist, @racket[_output-path] is deemed to be up to d @defproc[ -(render* +(render-batch [source-path pathish?] ...) void?] -Render multiple @racket[_source-paths] in one go. This can be faster than @racket[(for-each render _source-paths)] if your @racket[_source-paths] rely on a common set of templates. Templates may have their own source files that need to be compiled. If you use @racket[render], the templates will be repeatedly (and needlessly) re-compiled. Whereas if you use @racket[render*], each template will only be compiled once. +Render multiple @racket[_source-paths] in one go. This can be faster than @racket[(for-each render _source-paths)] if your @racket[_source-paths] rely on a common set of templates. Templates may have their own source files that need to be compiled. If you use @racket[render], the templates will be repeatedly (and needlessly) re-compiled. Whereas if you use @racket[render-batch], each template will only be compiled once. @defproc[ (render-pagenodes [pt-or-pt-source (or/c pathish? pagetree?)]) void?] -Using @racket[_pt-or-pt-source], render the pagenodes in that pagetree using @racket[render*]. +Using @racket[_pt-or-pt-source], render the pagenodes in that pagetree using @racket[render-batch]. Note that @racket[_pt-or-pt-source] is used strictly as a list of files to render, like a batch file. It is not used as the navigational pagetree for the rendered files.