downgrade two more settables

pull/232/head v3.1
Matthew Butterick 4 years ago
parent 3c39efdead
commit cf9b81738a

@ -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"]

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

@ -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 '@)
(define splicing-tag '@)
(define here-path-key 'here-path)
(define extension-escape-char #\_)

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

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

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

@ -1 +1 @@
1592325356
1592782348

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

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

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

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

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

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

@ -3,5 +3,4 @@
(module setup racket/base
(provide (all-defined-out))
(define compile-cache-active #f)
(define extension-escape-char #\$))
(define compile-cache-active #f))

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

Loading…
Cancel
Save