From ff6220f4482c6cdf62d715f80e4ffabffaed8720 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Thu, 3 Sep 2015 16:19:21 -0700 Subject: [PATCH] add env variable to docs (closes #86) --- scribblings/raco.scrbl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scribblings/raco.scrbl b/scribblings/raco.scrbl index bc651a7..fbfd892 100644 --- a/scribblings/raco.scrbl +++ b/scribblings/raco.scrbl @@ -127,3 +127,27 @@ Can also be invoked as @racket[raco pollen reset _directory], which will reset a Would you believe this prints the Pollen version number. +@section{The @exec{POLLEN} environment variable} + +Pollen recognizes a @exec{POLLEN} environment variable on the command line, which can be used to pass through any value you like. This value can be used within your project files with @racket[(getenv "POLLEN")], which if not set, returns @racket[#f]. Take this file, for instance: + +@fileblock["test.txt.pp" @codeblock{ +#lang pollen +Result is ◊or[(getenv "POLLEN")]{nothing} +}] + +The @exec{POLLEN} environment variable will change how it's rendered: + +@terminal{ +> raco pollen render test.txt ; cat test.txt +rendering test.txt.pp +rendering: /test.txt.pp as /test.txt +Result is nothing + +> POLLEN=DEBUG raco pollen render test.txt ; cat test.txt +rendering test.txt.pp +rendering: /test.txt.pp as /test.txt +Result is DEBUG + +} +