World
1 Parameters
world:  current-server-port
world:  current-project-root
world:  current-server-extras-path
world:  current-poly-target
2 World overrides
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:  main-root-node
world:  current-main-root-node
world:  block-tags
world:  current-block-tags
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:  splicing-tag
world:  current-splicing-tag
world:  poly-source-ext
world:  current-poly-source-ext
world:  poly-targets
world:  current-poly-targets
6.4.0.4

World

 (require pollen/world) package: pollen

Global values that are used throughout the Pollen system.

1 Parameters

I mean parameters in the Racket sense, i.e. values that can be fed to parameterize.

parameter

(world:current-server-port)  integer?

(world:current-server-port port)  void?
  port : integer?
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).

parameter

(world:current-server-extras-path)  path?

(world:current-server-extras-path dir)  void?
  dir : path?
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.

2 World overrides

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

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

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

  3. Assign it whatever value you like.

  4. 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 world 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 removing these defined values from "pollen.rkt".

These values are each equipped with a corresponding world:current-name function that will return the value loaded from the world submodule (if name was defined there), otherwise it returns the original value for world:name. For instance, world:command-char will always be , but in the example above, world:current-command-char would return 🎸.

value

world:default-port : integer?

procedure

(world:current-default-port)  integer?

Determines the default HTTP port for the project server. Initialized to 8080.

value

world:main-export : symbol?

procedure

(world:current-main-export)  symbol?

The main X-expression exported from a compiled Pollen source file. Initialized to doc.

value

world:meta-export : symbol?

procedure

(world:current-meta-export)  symbol?

The meta hashtable exported from a compiled Pollen source file. Initialized to metas.

value

world:meta-tag-name : symbol?

procedure

(world:current-meta-tag-name)  symbol?

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 #\_.

value

world:preproc-source-ext : symbol?

procedure

(world:current-preproc-source-ext)  symbol?

value

world:markup-source-ext : symbol?

procedure

(world:current-markup-source-ext)  symbol?

value

world:markdown-source-ext : symbol?

procedure

(world:current-markdown-source-ext)  symbol?

value

world:null-source-ext : symbol?

procedure

(world:current-null-source-ext)  symbol?

value

world:pagetree-source-ext : symbol?

procedure

(world:current-pagetree-source-ext)  symbol?

value

world:template-source-ext : symbol?

procedure

(world:current-template-source-ext)  symbol?

value

world:scribble-source-ext : symbol?

procedure

(world:current-scribble-source-ext)  symbol?

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

value

world:decodable-extensions : (listof symbol?)

procedure

(world:current-decodable-extensions)  (listof symbol?)

File extensions that are eligible for decoding.

value

world:default-pagetree : string?

procedure

(world:current-default-pagetree)  string?

Pagetree that Pollen dashboard loads by default in each directory. Initialized to "index.ptree".

value

world:pagetree-root-node : symbol?

procedure

(world:current-pagetree-root-node)  symbol?

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.

value

world:main-root-node : symbol?

procedure

(world:current-main-root-node)  symbol?

Name of the root node in a decoded doc. Initialized to 'root.

value

world:block-tags : (listof symbol?)

procedure

(world:current-block-tags)  (listof symbol?)

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 world:current-main-root-node.

value

world:command-char : char?

procedure

(world:current-command-char)  char?

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".

value

world:template-meta-key : symbol?

procedure

(world:current-template-meta-key)  symbol?

Meta key used to store a template name for that particular source file. Initialized to 'template.

value

world:newline : string?

procedure

(world:current-newline)  string?

value

world:linebreak-separator : string?

procedure

(world:current-linebreak-separator)  string?

value

world:paragraph-separator : string?

procedure

(world:current-paragraph-separator)  string?

Default separators used in decoding. The first two are initialized to "\n"; the third to "\n\n".

value

world:dashboard-css : string?

procedure

(world:current-dashboard-css)  string?

CSS file used for the dashboard. Initialized to "poldash.css".

value

world:paths-excluded-from-dashboard : (listof path?)

procedure

(world:current-paths-excluded-from-dashboard)  (listof path?)

Paths not shown in the Pollen dashboard.

value

world:render-cache-active : boolean?

procedure

(world:current-render-cache-active)  boolean?

Whether the render cache, which speeds up interactive sessions by reusing rendered versions of Pollen output files, is active. Default is active (#t).

value

world:compile-cache-active : boolean?

procedure

(world:current-compile-cache-active)  boolean?

Whether the compile cache, which speeds up interactive sessions by saving compiled versions of Pollen source files, is active. Default is active (#t).

value

world:compile-cache-max-size : exact-positive-integer?

procedure

(world:current-compile-cache-max-size)

  exact-positive-integer?
Maximum size of the compile cache. Default is 10 megabytes.

value

world:unpublished-path? : (path? . -> . boolean?)

procedure

(world:current-unpublished-path?)  (path? . -> . boolean?)

Predicate that determines whether a path is omitted from (part "raco_pollen_publish") operations. If the predicate is #t, then the path is omitted. The default, therefore, is #f.

value

world:here-path-key : symbol?

procedure

(world:current-here-path-key)  symbol?

Key used to store the absolute path of the current source file in its metas hashtable. Default is 'here-path.

value

world:splicing-tag : symbol?

procedure

(world:current-splicing-tag)  symbol?

Key used to signal that an X-expression should be spliced into its containing X-expression. Default is '@.

value

world:poly-source-ext : symbol?

procedure

(world:current-poly-source-ext)  symbol?

Extension that indicates a source file can target multiple output types. Default is 'poly.

value

world:poly-targets : (listof symbol?)

procedure

(world:current-poly-targets)  (listof symbol?)

List of symbols that denotes the possible targets of a 'poly source file. Default is '(html).