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?
parameter
(world:current-project-root) → path?
(world:current-project-root port) → void? port : path?
parameter
(world:current-server-extras-path) → path?
(world:current-server-extras-path dir) → void? dir : path?
parameter
(world:current-poly-target) → symbol?
(world:current-poly-target target) → void? target : symbol?
2 World overrides
These values can be changed by overriding them in your "pollen.rkt" source file:
Within this file, create a submodule called world.
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:
#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?
value
world:main-export : symbol?
procedure
(world:current-main-export) → symbol?
value
world:meta-export : symbol?
procedure
(world:current-meta-export) → symbol?
value
world:meta-tag-name : symbol?
procedure
(world:current-meta-tag-name) → symbol?
value
world:server-extras-dir : string?
procedure
value
world:extension-escape-char : char?
procedure
(world:current-extension-escape-char) → char?
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?
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?)
value
world:default-pagetree : string?
procedure
(world:current-default-pagetree) → string?
value
world:pagetree-root-node : symbol?
procedure
(world:current-pagetree-root-node) → symbol?
value
world:main-root-node : symbol?
procedure
(world:current-main-root-node) → symbol?
value
world:block-tags : (listof symbol?)
procedure
(world:current-block-tags) → (listof symbol?)
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?
value
world:default-template-prefix : string?
procedure
(world:current-default-template-prefix) → string?
value
world:fallback-template-prefix : string?
procedure
(world:current-fallback-template-prefix) → string?
value
world:template-meta-key : symbol?
procedure
(world:current-template-meta-key) → symbol?
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?
value
world:dashboard-css : string?
procedure
(world:current-dashboard-css) → string?
value
world:paths-excluded-from-dashboard : (listof path?)
procedure
(world:current-paths-excluded-from-dashboard) → (listof path?)
value
world:render-cache-active : boolean?
procedure
(world:current-render-cache-active) → boolean?
value
world:compile-cache-active : boolean?
procedure
(world:current-compile-cache-active) → boolean?
value
world:compile-cache-max-size : exact-positive-integer?
procedure
→ exact-positive-integer?
value
world:unpublished-path? : (path? . -> . boolean?)
procedure
(world:current-unpublished-path?) → (path? . -> . boolean?)
value
world:here-path-key : symbol?
procedure
(world:current-here-path-key) → symbol?
value
world:splicing-tag : symbol?
procedure
(world:current-splicing-tag) → symbol?
value
world:poly-source-ext : symbol?
procedure
(world:current-poly-source-ext) → symbol?
value
world:poly-targets : (listof symbol?)
procedure
(world:current-poly-targets) → (listof symbol?)