Setup
(require pollen/setup) | package: pollen |
1 How to override setup values
The values below can be changed by overriding them in your "pollen.rkt" source file:
Within this file, create a submodule called setup.
Within this submodule, use define to make a variable with the same name as the one in pollen/setup, but without the setup: prefix.
Assign it whatever value you like.
Repeat as needed.
(Don’t forget to provide the variables from within your setup submodule.)
When Pollen runs, these definitions will supersede those in pollen/setup.
For instance, suppose you wanted the main export of every Pollen source file to be called van-halen rather than doc, the extension of Pollen markup files to be .rock rather than .pm, and the command character to be 🎸 instead of ◊. Your "pollen.rkt" would look like this:
#lang racket/base ;; ... the usual definitions and tag functions ... (module setup racket/base (provide (all-defined-out)) (define main-export 'van-halen) (define markup-source-ext 'rock) (define command-char #\🎸))
Of course, you can restore the defaults simply by removing these defined values from "pollen.rkt".
Every setup:name function will resolve the current value of that variable: it will return the value from the setup submodule (if name was defined there), otherwise it will return the default value (which is directly available from default-name). For instance, default-command-char will always be ◊, but in the example above, (setup:command-char) would return 🎸.
2 Values
procedure
(setup:project-server-port) → integer?
value
procedure
(setup:main-export) → symbol?
value
procedure
(setup:meta-export) → symbol?
value
procedure
(setup:extension-escape-char) → char?
value
procedure
(setup:preproc-source-ext) → symbol?
value
procedure
(setup:markup-source-ext) → symbol?
value
procedure
(setup:markdown-source-ext) → symbol?
value
procedure
(setup:null-source-ext) → symbol?
value
procedure
(setup:pagetree-source-ext) → symbol?
value
procedure
(setup:template-source-ext) → symbol?
value
procedure
(setup:scribble-source-ext) → symbol?
value
procedure
(setup:main-pagetree) → string?
value
procedure
(setup:main-root-node) → symbol?
value
procedure
(setup:block-tags) → (listof symbol?)
value
address article aside blockquote body canvas dd div dl fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hgroup hr li main nav noscript ol output p pre section table tfoot ul video
... plus setup:main-root-node.
procedure
(setup:command-char) → char?
value
procedure
(setup:template-prefix) → string?
value
procedure
(setup:newline) → string?
value
procedure
(setup:linebreak-separator) → string?
value
procedure
(setup:paragraph-separator) → string?
value
procedure
(setup:render-cache-active) → boolean?
value
procedure
(setup:compile-cache-active) → boolean?
value
procedure
(setup:compile-cache-max-size) → exact-positive-integer?
value
= 10485760
procedure
(setup:cache-watchlist) → (listof (or/c path? path-string?))
value
default-cache-watchlist : (listof (or/c path? path-string?))
= '()
If the cache can’t find a certain file on the watchlist, no error will arise. The file will simply be ignored. Therefore, to avoid unexpected behavior, the best policy is to use complete paths (or path strings). One way to generate a complete path to a local file is with define-runtime-path. Another way, if you’re using a module that’s already installed as part of a package, is with resolve-module-path:
(module+ setup (provide (all-defined-out)) (require racket/runtime-path syntax/modresolve) (define-runtime-path my-local-mod "my-module.rkt") (define my-installed-mod (resolve-module-path 'package/my-other-module)) (define cache-watchlist (list my-local-mod my-installed-mod)))
Added in version 1.4 of package pollen.
procedure
→ (or/c path-string? path-for-some-system?)
value
: (or/c path-string? path-for-some-system?) = "publish"
Added in version 1.1 of package pollen.
procedure
(setup:unpublished-path?) → (path? . -> . boolean?)
value
= (λ (path) #f)
Changed in version 1.1 of package pollen: Deprecated. Please use setup:omitted-path?.
procedure
(setup:omitted-path?) → (path? . -> . boolean?)
value
default-omitted-path? : (path? . -> . boolean?) = (λ (path) #f)
Added in version 1.1 of package pollen.
procedure
(setup:extra-published-path?) → (path? . -> . boolean?)
value
= (λ (path) #f)
Changed in version 1.1 of package pollen: Deprecated. Please use setup:extra-path?.
procedure
(setup:extra-path?) → (path? . -> . boolean?)
value
default-extra-path? : (path? . -> . boolean?) = (λ (path) #f)
Added in version 1.1 of package pollen.
procedure
(setup:splicing-tag) → symbol?
value
procedure
(setup:poly-source-ext) → symbol?
value
procedure
(setup:poly-targets) → (listof symbol?)
value
procedure
(setup:index-pages) → (listof string?)
value
procedure
(setup:trim-whitespace?) → boolean?
value
Added in version 1.5 of package pollen.
procedure
(setup:allow-unbound-ids?) → boolean?
value
Added in version 2.0 of package pollen.
3 Parameters
I mean parameters in the Racket sense, i.e. values that can be fed to parameterize.
parameter
(current-server-port) → integer?
(current-server-port port) → void? port : integer?
= default-project-server-port
parameter
(current-project-root) → path?
(current-project-root path) → void? path : path?
parameter
(current-server-extras-path) → path?
(current-server-extras-path dir) → void? dir : path?
= #f
parameter
(current-poly-target) → symbol?
(current-poly-target target) → void? target : symbol?
= 'html