14 Module reference
14.1 Cache
14.2 Decode
14.3 File
14.4 Pagetree
14.5 Pygments
14.6 Render
14.7 Template
14.8 Tag
14.9 Top
14.10 World
14.10 World
On this page:
14.10.1 Parameters
world:  current-server-port
world:  current-project-root
world:  current-server-extras-path
world:  current-poly-target
14.10.2 Settable values
world:  default-port
world:  current-default-port
world:  main-export
world:  current-main-export
world:  meta-export
world:  current-meta-export
world:  meta-tag-name
world:  current-meta-tag-name
world:  server-extras-dir
world:  current-server-extras-dir
world:  extension-escape-char
world:  current-extension-escape-char
world:  preproc-source-ext
world:  current-preproc-source-ext
world:  markup-source-ext
world:  current-markup-source-ext
world:  markdown-source-ext
world:  current-markdown-source-ext
world:  null-source-ext
world:  current-null-source-ext
world:  pagetree-source-ext
world:  current-pagetree-source-ext
world:  template-source-ext
world:  current-template-source-ext
world:  scribble-source-ext
world:  current-scribble-source-ext
world:  decodable-extensions
world:  current-decodable-extensions
world:  default-pagetree
world:  current-default-pagetree
world:  pagetree-root-node
world:  current-pagetree-root-node
world:  command-char
world:  current-command-char
world:  default-template-prefix
world:  current-default-template-prefix
world:  fallback-template-prefix
world:  current-fallback-template-prefix
world:  template-meta-key
world:  current-template-meta-key
world:  newline
world:  current-newline
world:  linebreak-separator
world:  current-linebreak-separator
world:  paragraph-separator
world:  current-paragraph-separator
world:  dashboard-css
world:  current-dashboard-css
world:  paths-excluded-from-dashboard
world:  current-paths-excluded-from-dashboard
world:  render-cache-active
world:  current-render-cache-active
world:  compile-cache-active
world:  current-compile-cache-active
world:  compile-cache-max-size
world:  current-compile-cache-max-size
world:  unpublished-path?
world:  current-unpublished-path?
world:  here-path-key
world:  current-here-path-key
world:  poly-source-ext
world:  current-poly-source-ext
world:  poly-targets
world:  current-poly-targets
6.2.901.900

14.10 World

 (require pollen/world) package: pollen

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.

parameter

(world:current-project-root)  path?

(world:current-project-root port)  void?
  port : path?
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.

parameter

(world:current-poly-target)  symbol??

(world:current-poly-target target)  void?
  target : symbol??
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:

"pollen.rkt"
#lang racket/base
 
;; ... the usual definitions and tag functions ...
 
(module config racket/base
  (provide (all-defined-out))
  (define main-export 'van-halen)
  (define markup-source-ext 'rock)
  (define command-char #\🎸))

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.

value

world:server-extras-dir : string?

procedure

(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).