14 Module reference
14.1 Cache
14.2 Core
14.3 Decode
14.4 File
14.5 Pagetree
14.6 Render
14.7 Setup
14.8 Tag
14.9 Template
14.10 Top
On this page:
14.7.1 How to override setup values
14.7.2 Values
setup:  project-server-port
default-project-server-port
setup:  main-export
default-main-export
setup:  meta-export
default-meta-export
setup:  extension-escape-char
default-extension-escape-char
setup:  preproc-source-ext
default-preproc-source-ext
setup:  markup-source-ext
default-markup-source-ext
setup:  markdown-source-ext
default-markdown-source-ext
setup:  null-source-ext
default-null-source-ext
setup:  pagetree-source-ext
default-pagetree-source-ext
setup:  template-source-ext
default-template-source-ext
setup:  scribble-source-ext
default-scribble-source-ext
setup:  main-pagetree
default-main-pagetree
setup:  main-root-node
default-main-root-node
setup:  block-tags
default-block-tags
setup:  command-char
default-command-char
setup:  template-prefix
default-template-prefix
setup:  newline
default-newline
setup:  linebreak-separator
default-linebreak-separator
setup:  paragraph-separator
default-paragraph-separator
setup:  render-cache-active
default-render-cache-active
setup:  compile-cache-active
default-compile-cache-active
setup:  compile-cache-max-size
default-compile-cache-max-size
setup:  unpublished-path?
default-unpublished-path?
setup:  splicing-tag
default-splicing-tag
setup:  poly-source-ext
default-poly-source-ext
setup:  poly-targets
default-poly-targets
14.7.3 Parameters
current-server-port
current-project-root
current-server-extras-path
current-poly-target
6.3.90.900

14.7 Setup

 (require pollen/setup) package: pollen

14.7.1 How to override setup values

The values below can be changed by overriding them in your "pollen.rkt" source file:

  1. Within this file, create a submodule called setup.

  2. Within this submodule, use define to make a variable with the same name as the one in pollen/setup, but without the setup: prefix.

  3. Assign it whatever value you like.

  4. Repeat as needed.

  5. (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:

"pollen.rkt"
#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 🎸.

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.

Tags that are treated as blocks by block-txexpr?. Initialized to the block-level elements in HTML5, namely:

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.

parameter

(current-server-port)  integer?

(current-server-port port)  void?
  port : integer?
A parameter that sets the HTTP port for the project server. Initialized to default-project-server-port.

parameter

(current-project-root)  path?

(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

(current-poly-target)  symbol?

(current-poly-target target)  void?
  target : symbol?
A parameter that reports the current rendering target for poly source files. Initialized to 'html.