6.2.901.900
14.10 World
Global values that are used throughout the Pollen system.
14.10.1 Parameters
I mean parameters in the Racket sense, i.e. values that can be fed to parameterize.
A parameter that sets the HTTP port for the project server. Initialized to
world:default-port.
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.
14.10.2 Settable values
These values can be changed by overriding them in your "pollen.rkt" source file. Within this file, create a submodule called config. Then within this submodule, use define to make a variable with the same name as the one in pollen/world, but without the world: prefix. Assign it whatever value you like. Repeat as needed. When Pollen runs, these definitions will supersede those in pollen/world.
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:
Though any of the values below can be overridden, it may not always be wise to do so. For instance, if you redefined world:fallback-template-prefix, you would simply break the fallback-template mechanism, because it would look for files that don’t exist. But we don’t live in a nanny state, so you are entrusted to say what you mean and accept the consequences.
Of course, you can restore the defaults simply by deleting these defined values from "pollen.rkt".
These settable values are each equipped with a corresponding world:current-settable-value function that will return the value loaded from the config submodule (if settable-value was defined there), otherwise the default given by world:settable-value. For instance, world:command-char will always be ◊, but in the example above, world:current-command-char would return 🎸.
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.
Name of the tag used to mark metas within Pollen source.
|
(world:current-server-extras-dir) → string?
|
|
Name of directory where server support files live. Initialized to server-extras.
Character for escaping output-file extensions within source-file names. Initialized to #\_.
File extensions for Pollen source files, initialized to the following values:
world:preproc-source-ext = 'pp
world:markup-source-ext = 'pm
world:markdown-source-ext = 'pmd
world:null-source-ext = 'p
world:pagetree-source-ext = 'ptree
world:template-source-ext = 'pt
world:scribble-source-ext = 'scrbl
File extensions that are eligible for decoding.
Pagetree that Pollen dashboard loads by default in each directory. Initialized to "index.ptree".
Name of the root node in a decoded pagetree. It’s ignored by the code, so its only role is to clue you in that you’re looking at something that came out of the pagetree decoder. Initialized to
'pagetree-root.
The magic character that indicates a Pollen command, function, or variable. Initialized to #\◊.
Prefix of the default template. Initialized to "template".
Used to generate the name of the fallback template (i.e., the template used to render a Pollen markup file when no other template can be found). Prefix is combined with the output suffix of the source file. Initialized to "fallback".
Meta key used to store a template name for that particular source file. Initialized to 'template.
Default separators used in decoding. The first two are initialized to "\n"; the third to "\n\n".
CSS file used for the dashboard. Initialized to "poldash.css".
Paths not shown in the Pollen dashboard.
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 store the absolute path of the current source file in its metas hashtable. Default is 'here-path.
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).