6.3.90.900
14.7 Setup
14.7.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:
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 🎸.
14.7.2 Values
Determines the default HTTP port for the project server. Initialized to 8080.
The main X-expression exported from a compiled Pollen source file. Initialized to doc.
The meta hashtable exported from a compiled Pollen source file. Initialized to metas.
Character for escaping output-file extensions within source-file names. Initialized to #\_.
File extensions for Pollen source files, initialized to the following values:
default-preproc-source-ext = 'pp
default-markup-source-ext = 'pm
default-markdown-source-ext = 'pmd
default-null-source-ext = 'p
default-pagetree-source-ext = 'ptree
default-template-source-ext = 'pt
default-scribble-source-ext = 'scrbl
Pagetree that Pollen dashboard loads by default in each directory. Initialized to "index.ptree".
Name of the root node in a decoded
doc. Initialized to
'root.
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.
The magic character that indicates a Pollen command, function, or variable. Initialized to #\◊.
Prefix of the default template. Initialized to "template".
Default separators used in decoding. The first two are initialized to "\n"; the third to "\n\n".
Whether the render cache, which speeds up interactive sessions by reusing rendered versions of Pollen output files, is active. Default is active (#t).
Whether the compile cache, which speeds up interactive sessions by saving compiled versions of Pollen source files, is active. Default is active (#t).
Maximum size of the compile cache. Default is 10 megabytes.
Predicate that determines whether a path is omitted from
raco pollen publish operations. If the predicate is
#t, then the path is omitted. The default, therefore, is
#f.
Key used to signal that an X-expression should be spliced into its containing X-expression. Default is '@.
Extension that indicates a source file can target multiple output types. Default is 'poly.
List of symbols that denotes the possible targets of a 'poly source file. Default is '(html).
14.7.3 Parameters
I mean parameters in the Racket sense, i.e. values that can be fed to parameterize.
A parameter that holds the root directory of the current project (e.g., the directory where you launched raco pollen start).
A parameter that reports the path to the directory of support files for the project server. Initialized to #f, but set to a proper value when the server runs.
A parameter that reports the current rendering target for poly source files. Initialized to 'html.