diff --git a/info.rkt b/info.rkt index a955bdb..8ad1df8 100644 --- a/info.rkt +++ b/info.rkt @@ -1,7 +1,7 @@ #lang info (define collection 'multi) -(define version "3.0") +(define version "3.1") (define deps '(["base" #:version "6.3"] ["txexpr" #:version "0.2"] ["sugar" #:version "0.2"] diff --git a/pollen/info.rkt b/pollen/info.rkt index 677e5fa..cbfbc95 100644 --- a/pollen/info.rkt +++ b/pollen/info.rkt @@ -4,6 +4,6 @@ (define raco-commands '(("pollen" (submod pollen/private/command raco) "issue Pollen command" #f))) (define compile-omit-paths '("test" "tools" "server-extras" "scribblings/third-tutorial-files")) ;; it's redundant to test "pollen.scrbl" because it incorporates the other scribble sources by reference -(define test-omit-paths '("test/data" "tools" "server-extras" "scribblings/third-tutorial-files" "scribblings")) +(define test-omit-paths '("test/data" "tools" "server-extras" "scribblings/third-tutorial-files")) ;; don't put #"p" in this list because it's not a #lang (define module-suffixes '(#"pp" #"pm" #"pmd" #"ptree")) diff --git a/pollen/private/constants.rkt b/pollen/private/constants.rkt index 1a27457..ec1ef6b 100644 --- a/pollen/private/constants.rkt +++ b/pollen/private/constants.rkt @@ -18,4 +18,6 @@ (define fallback-template-prefix "fallback") (define template-meta-key "template") (define old-cache-names '("pollen.cache" "pollen-cache")) -(define splicing-tag '@) \ No newline at end of file +(define splicing-tag '@) +(define here-path-key 'here-path) +(define extension-escape-char #\_) \ No newline at end of file diff --git a/pollen/private/file-utils.rkt b/pollen/private/file-utils.rkt index a7f11bf..9127f39 100644 --- a/pollen/private/file-utils.rkt +++ b/pollen/private/file-utils.rkt @@ -57,7 +57,7 @@ (not (regexp-match #rx"^\\." (path->string path)))) -(define+provide (escape-last-ext x [escape-char (setup:extension-escape-char)]) +(define+provide (escape-last-ext x [escape-char pollen-extension-escape-char]) ;((pathish?) (char?) . ->* . coerce/path?) ;; if x has a file extension, reattach it with the escape char (define current-ext (get-ext x)) @@ -76,7 +76,7 @@ (define second cadr) (define third caddr) (define (last x) (car (reverse x))) -(define+provide (unescape-ext x [escape-char (setup:extension-escape-char)]) +(define+provide (unescape-ext x [escape-char pollen-extension-escape-char]) ;((coerce/string?) (char?) . ->* . coerce/path?) ;; if x has an escaped extension, unescape it. (define-values (base _ dir?) (split-path x)) diff --git a/pollen/private/reader-base.rkt b/pollen/private/reader-base.rkt index 82e1010..65bf056 100644 --- a/pollen/private/reader-base.rkt +++ b/pollen/private/reader-base.rkt @@ -46,7 +46,7 @@ ;; an inline Pollen submodule doesn't have "pollen.rkt" or `here-path` [POLLEN-REQUIRE-AND-PROVIDES (require+provide-directory-require-files pollen-require-path)] [HERE-PATH reader-here-path] - [HERE-KEY (setup:here-path-key)] + [HERE-KEY pollen-here-path-key] [SOURCE-LINES source-stx] [DOC pollen-main-export] [META-MOD pollen-meta-export] diff --git a/pollen/private/render-helper.rkt b/pollen/private/render-helper.rkt index 68696f8..4811ab8 100644 --- a/pollen/private/render-helper.rkt +++ b/pollen/private/render-helper.rkt @@ -44,7 +44,7 @@ (define doc (cached-doc SOURCE-PATH-STRING)) (define metas (current-metas)) (define here (path->pagenode - (or (select-from-metas (setup:here-path-key SOURCE-PATH-STRING) metas) 'unknown))) + (or (select-from-metas pollen-here-path-key metas) 'unknown))) (if (bytes? doc) ; if main export is binary, just pass it through doc ;; allows `require` in a template diff --git a/pollen/private/ts.rktd b/pollen/private/ts.rktd index 45384bf..2791f79 100644 --- a/pollen/private/ts.rktd +++ b/pollen/private/ts.rktd @@ -1 +1 @@ -1592325356 +1592782348 diff --git a/pollen/scribblings/command.scrbl b/pollen/scribblings/command.scrbl index 06436b8..e956ae2 100644 --- a/pollen/scribblings/command.scrbl +++ b/pollen/scribblings/command.scrbl @@ -614,7 +614,7 @@ Second, the metas are collected into a hash table that is exported with the name '#hasheq((dog . "Roxy") (cat . "Chopper") (here-path . "unsaved-editor")) } -The only key that's automatically defined in every meta table is @racket['#,(setup:here-path-key)], which is the absolute path to the source file. (In this case, because the file hasn't been saved, you'll see the @val{unsaved-editor} name instead.) +The only key that's automatically defined in every meta table is @racket['#,pollen-here-path-key], which is the absolute path to the source file. (In this case, because the file hasn't been saved, you'll see the @val{unsaved-editor} name instead.) Still, you can override this too: diff --git a/pollen/scribblings/core.scrbl b/pollen/scribblings/core.scrbl index 7e53156..4beda12 100644 --- a/pollen/scribblings/core.scrbl +++ b/pollen/scribblings/core.scrbl @@ -16,8 +16,7 @@ These functions are automatically imported into every Pollen source file (meanin @section{Metas} -The only key that's automatically defined in every meta table is @racket['#,(setup:here-path-key)], which holds the absolute path to the source file. For instance, you could retrieve this value with @racket[(select-from-metas '#,(setup:here-path-key) metas)]. You can use something other than @racket['#,(setup:here-path-key)] as the key by overriding @racket[setup:here-path-key]. - +The only key that's automatically defined in every meta table is @racket['#,pollen-here-path-key], which holds the absolute path to the source file. For instance, you could retrieve this value with @racket[(select-from-metas '#,pollen-here-path-key metas)]. For a full introduction to metas, see @secref["Inserting_metas"]. @@ -32,7 +31,7 @@ You can retrieve a meta value — even in the same document where you define it @section{Splicing} @defform[(\@ arg ...)] -Splicing tag: signals that a list should be merged into its containing expression. You can use something other than @racket[\@] by overriding @racket[setup:splicing-tag]. +Splicing tag: signals that a list should be merged into its containing expression. The splicing tag is @racket[setup:splicing-tag]. @examples[#:eval my-eval (module splicer pollen/markup diff --git a/pollen/scribblings/formats.scrbl b/pollen/scribblings/formats.scrbl index 032e275..a046577 100644 --- a/pollen/scribblings/formats.scrbl +++ b/pollen/scribblings/formats.scrbl @@ -46,7 +46,7 @@ By default, every Pollen source file exports two identifiers: Contains the output of the file. The type of output depends on the source format (about which, more below).} @defthing[metas hasheq?]{ -A table of key–value pairs with extra information that is extracted from the source. These @racket[metas] will always contain the key @racket['#,(setup:here-path-key)], which returns a string representation of the full path to the source file. Beyond that, the only @racket[metas] are the ones that are specified within the source file (see the source formats below for more detail on how to specify metas).} +A table of key–value pairs with extra information that is extracted from the source. These @racket[metas] will always contain the key @racket['#,pollen-here-path-key], which returns a string representation of the full path to the source file. Beyond that, the only @racket[metas] are the ones that are specified within the source file (see the source formats below for more detail on how to specify metas).} As usual, you can use @racket[require], @racket[local-require], or @racket[dynamic-require] to retrieve these values. But within a Pollen project, the faster way is to use @racket[get-doc] and @racket[get-metas]. diff --git a/pollen/scribblings/setup.scrbl b/pollen/scribblings/setup.scrbl index e9d74c0..e658b22 100644 --- a/pollen/scribblings/setup.scrbl +++ b/pollen/scribblings/setup.scrbl @@ -56,9 +56,6 @@ Determines the default HTTP port for the project server.} -@defoverridable[extension-escape-char char?]{Character for escaping output-file extensions within source-file names.} - - @defoverridable[main-pagetree string?]{Pagetree that Pollen dashboard loads by default in each directory.} @@ -144,8 +141,6 @@ Both the names and the values of environment variables are case-insensitive, so @history[#:added "2.0"]} -@defoverridable[here-path-key 'symbol]{Key used to store the path of the source file in its metas table. No idea why you'd want to change this.} - @section{Parameters} diff --git a/pollen/scribblings/version-history.scrbl b/pollen/scribblings/version-history.scrbl index d3845c5..74dcb41 100644 --- a/pollen/scribblings/version-history.scrbl +++ b/pollen/scribblings/version-history.scrbl @@ -24,6 +24,10 @@ Beyond keeping the commit history available, I make no promise to maintain the p @section{Changelog} +@subsection{Version 3.1} + +Downgraded the following @racket[pollen/setup] values from configurable to fixed: @racket[here-path-key], @racket[extension-escape-char]. + @subsection{Version 3.0} Changed rendering model to share a namespace between sequential renders, improving speed. diff --git a/pollen/setup.rkt b/pollen/setup.rkt index 1d22623..c919918 100644 --- a/pollen/setup.rkt +++ b/pollen/setup.rkt @@ -109,8 +109,6 @@ (define-settable publish-directory "publish") -(define-settable extension-escape-char #\_) - (define-settable compile-cache-active #t) (define-settable render-cache-active #t) (define-settable compile-cache-max-size (* 10 1024 1024)) ; = 10 megabytes @@ -123,8 +121,6 @@ (define-settable trim-whitespace? #t) -(define-settable here-path-key 'here-path) - (define-settable poly-targets '(html)) ; current target applied to multi-output source files (define+provide current-poly-target (make-parameter (car (poly-targets)))) diff --git a/pollen/test/data/escape-ext/pollen.rkt b/pollen/test/data/escape-ext/pollen.rkt index 7d3d50f..3df8ae1 100644 --- a/pollen/test/data/escape-ext/pollen.rkt +++ b/pollen/test/data/escape-ext/pollen.rkt @@ -3,5 +3,4 @@ (module setup racket/base (provide (all-defined-out)) - (define compile-cache-active #f) - (define extension-escape-char #\$)) \ No newline at end of file + (define compile-cache-active #f)) \ No newline at end of file diff --git a/pollen/test/data/escape-ext/test$html.pp b/pollen/test/data/escape-ext/test_html.pp similarity index 100% rename from pollen/test/data/escape-ext/test$html.pp rename to pollen/test/data/escape-ext/test_html.pp diff --git a/pollen/test/test-escape-ext.rkt b/pollen/test/test-escape-ext.rkt index 9dbcdca..9d28d06 100644 --- a/pollen/test/test-escape-ext.rkt +++ b/pollen/test/test-escape-ext.rkt @@ -3,7 +3,7 @@ ;; define-runtime-path only allowed at top level (define-runtime-path test-dir "data/escape-ext") -(define-runtime-path test-file "data/escape-ext/test$html.pp") +(define-runtime-path test-file "data/escape-ext/test_html.pp") (define-runtime-path result-file "data/escape-ext/test.html") ;; `find-exe` avoids reliance on $PATH of the host system