diff --git a/pollen/private/command.rkt b/pollen/private/command.rkt index 861050d..d637bb6 100644 --- a/pollen/private/command.rkt +++ b/pollen/private/command.rkt @@ -119,7 +119,7 @@ version print the version" (current-server-port) (make-publish-di (when (render-recursively?) (for ([path (in-list dirlist)] #:when (and (directory-exists? path) - (not (unpublished-path? path)))) + (not (omitted-path? path)))) (render-one-dir (->complete-path path)))))) (begin ; first arg is a file (displayln (format "rendering ~a" (string-join (map ->string path-args) " "))) @@ -175,8 +175,7 @@ version print the version" (current-server-port) (make-publish-di (copy-directory/files source-dir target-dir) (parameterize ([current-project-root (current-directory)]) (define (delete-from-publish-dir? p) - (and (unpublished-path? p) - (not ((setup:extra-published-path?) p)))) + (and (omitted-path? p) (not (extra-path? p)))) (for-each delete-it (find-files delete-from-publish-dir? target-dir))) (displayln "completed")) diff --git a/pollen/private/file-utils.rkt b/pollen/private/file-utils.rkt index e450955..85b368a 100644 --- a/pollen/private/file-utils.rkt +++ b/pollen/private/file-utils.rkt @@ -294,7 +294,7 @@ (define (ends-with? str ender) (define pat (regexp (format "~a$" ender))) (and (regexp-match pat str) #t)) - + (define+provide (magic-directory? path) (and (directory-exists? path) @@ -305,7 +305,7 @@ (ormap (λ(cache-name) (ends-with? (path->string path) cache-name)) default-cache-names)) -(define+provide (unpublished-path? file) +(define+provide (omitted-path? file) (ormap (λ(proc) (proc file)) (list preproc-source? markup-source? @@ -316,4 +316,10 @@ racket-source? magic-directory? cache-file? - (setup:unpublished-path?)))) \ No newline at end of file + (setup:omitted-path?) + (setup:unpublished-path?)))) + +(define+provide (extra-path? file) + (ormap (λ(proc) (proc file)) (list + (setup:extra-path?) + (setup:extra-published-path?)))) \ No newline at end of file diff --git a/pollen/private/ts.rktd b/pollen/private/ts.rktd index 3778725..cb329a4 100644 --- a/pollen/private/ts.rktd +++ b/pollen/private/ts.rktd @@ -1 +1 @@ -1464975591 +1466203240 diff --git a/pollen/scribblings/raco.scrbl b/pollen/scribblings/raco.scrbl index bd91194..0400c94 100644 --- a/pollen/scribblings/raco.scrbl +++ b/pollen/scribblings/raco.scrbl @@ -110,7 +110,7 @@ If you're already in your project directory and want to publish somewhere other You can determine the default publishing destination for a project by overriding @racket[default-publish-directory]. -You can determine the files that get filtered out in a project by overriding @racket[default-unpublished-path?]. You can override these filters — that is, force a path to be published — by overriding @racket[default-extra-published-path?]. +You can determine the files that get filtered out in a project by overriding @racket[default-omitted-path?]. You can override these filters — that is, force a path to be published — by overriding @racket[default-extra-path?]. @section{@exec{raco pollen setup}} diff --git a/pollen/scribblings/setup.scrbl b/pollen/scribblings/setup.scrbl index a6a212e..3f8c773 100644 --- a/pollen/scribblings/setup.scrbl +++ b/pollen/scribblings/setup.scrbl @@ -118,9 +118,13 @@ Default separators used in decoding. The first two are initialized to @racket["\ @defoverridable[publish-directory (or/c path-string? path-for-some-system?)]{Default target for @secref{raco_pollen_publish}. A complete path is used as is; a relative path is published to the desktop. Default is @racket["publish"].} -@defoverridable[unpublished-path? (path? . -> . boolean?)]{Predicate that determines whether a path is omitted from @secref{raco_pollen_publish} operations. If the predicate evaluated to @racket[#t], then the path is omitted. The default predicate, therefore, is @racket[(lambda (path) #f)].} +@defoverridable[unpublished-path? (path? . -> . boolean?)]{Deprecated. Please use @racket[omitted-path?].} -@defoverridable[extra-published-path? (path? . -> . boolean?)]{Predicate that determines if path is published, overriding @racket[(setup:unpublished-path?)] above, and Pollen's default publish settings. For instance, Pollen automatically omits files with a @racket[.rkt] extension. If you wanted to force a @racket[.rkt] file to be published, you could include it here. Default is @racket[(lambda (path) #f)].} +@defoverridable[omitted-path? (path? . -> . boolean?)]{Predicate that determines whether a path is omitted from @secref{raco_pollen_render} and @secref{raco_pollen_publish} operations. If the predicate evaluated to @racket[#t], then the path is omitted. The default predicate, therefore, is @racket[(lambda (path) #f)].} + +@defoverridable[extra-published-path? (path? . -> . boolean?)]{Deprecated. Please use @racket[extra-path?].} + +@defoverridable[extra-path? (path? . -> . boolean?)]{Predicate that determines if path is rendered & published, overriding @racket[(setup:omitted-path?)] above, and Pollen's default publish settings. For instance, Pollen automatically omits files with a @racket[.rkt] extension. If you wanted to force a @racket[.rkt] file to be published, you could include it here. Default is @racket[(lambda (path) #f)].} @defoverridable[splicing-tag symbol?]{Key used to signal that an X-expression should be spliced into its containing X-expression. Default is @val[default-splicing-tag].} diff --git a/pollen/setup.rkt b/pollen/setup.rkt index a48083c..9581c91 100644 --- a/pollen/setup.rkt +++ b/pollen/setup.rkt @@ -109,8 +109,12 @@ (define-settable render-cache-active #t) (define-settable compile-cache-max-size (* 10 1024 1024)) ; = 10 megabytes -(define-settable unpublished-path? (λ(path) #f)) -(define-settable extra-published-path? (λ(path) #f)) +(define-settable unpublished-path? (λ(path) #f)) ; deprecated in favor of `omitted-path?` +(define-settable omitted-path? (λ(path) #f)) + +(define-settable extra-published-path? (λ(path) #f)) ; deprecated in favor of `extra-path?` +(define-settable extra-path? (λ(path) #f)) + (define-settable here-path-key 'here-path)