change `render*` back to `render-batch`

pull/110/head
Matthew Butterick 8 years ago
parent ce1d05753e
commit 3afea47779

@ -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))

@ -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.

@ -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.

Loading…
Cancel
Save