7 Using raco pollen
Racket provides centralized command-line options through raco (short for racket command, see raco: Racket Command-Line Tools).
Once you install Pollen, you can access the following Pollen-specific commands through raco using the subcommand raco pollen.
7.1 Making sure raco pollen works
Open a terminal window and type:
> raco pollen test |
If raco pollen is installed correctly, you’ll see:
raco pollen is installed correctly |
But if you get:
raco: Unrecognized command: pollen |
You’ll need to fix the problem before proceeding, most likely by reinstalling Pollen (see Installation).
Pro tip: I have an alias in my .bash_profile like so: alias polcom='raco pollen'
7.2 raco pollen
Same as raco pollen help.
7.3 raco pollen help
Displays a list of available commands.
7.4 raco pollen start
Starts the project server from the current directory using the default port, which is the value of the parameter world:current-server-port (by default, port 8080).
This command can be invoked with two optional arguments.
raco pollen start path will start the project server in path rather than the current directory.
> raco pollen start ~/path/to/project/ |
raco pollen start path port will start the project server in path using port rather than world:current-server-port. This is useful if you want to have multiple project servers running simultaneously.
> raco pollen start ~/path/to/project/ |
> raco pollen start ~/path/to/project/scribblings 8088 |
If you want to start in the current directory but with a different port, use . as the path:
> raco pollen start . 8088 |
7.5 raco pollen render
Renders all preprocessor source files and then all pagetree files found in the current directory.
This command can be invoked with extra arguments.
raco pollen render directory will render the preprocessor source files and pagetree files in the specified directory.
Alternatively, the command can take a variable number of path arguments. raco pollen render path... will render only the paths specified in path.... Consistent with the usual command-line idiom, this can be a single path, a list of paths, or a pattern:
> raco pollen render foo.html.pm |
> raco pollen render foo.html.pm bar.html.pm zam.css.pp |
> raco pollen render *.html.pm |
7.6 raco pollen clone
Makes a copy of the project directory on the desktop, and removes any source files or other Pollen-related files.
raco pollen clobe directory-path will perform the same copying and filtering, but using directory-path as the destination rather than the desktop.