You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pollen/doc/raco-pollen.html

2 lines
15 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>7&nbsp;Using raco pollen</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="racket.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.css" title="default"/><script type="text/javascript" src="scribble-common.js"></script><script type="text/javascript" src="manual-racket.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="scribble-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9660;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Pollen:<span class="mywbr"> &nbsp;</span> the book is a program</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="Installation.html" class="tocviewlink" data-pltdoc="x">Installation</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="quick-tour.html" class="tocviewlink" data-pltdoc="x">Quick tour</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="Backstory.html" class="tocviewlink" data-pltdoc="x">Backstory</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="big-picture.html" class="tocviewlink" data-pltdoc="x">The big picture</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="first-tutorial.html" class="tocviewlink" data-pltdoc="x">First tutorial</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="second-tutorial.html" class="tocviewlink" data-pltdoc="x">Second tutorial</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="raco-pollen.html" class="tocviewselflink" data-pltdoc="x">Using <span class="stt">raco pollen</span></a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="File_formats.html" class="tocviewlink" data-pltdoc="x">File formats</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="reader.html" class="tocviewlink" data-pltdoc="x">&#9674; command overview</a></td></tr><tr><td align="right">10&nbsp;</td><td><a href="Module_reference.html" class="tocviewlink" data-pltdoc="x">Module reference</a></td></tr><tr><td align="right">11&nbsp;</td><td><a href="Acknowledgments.html" class="tocviewlink" data-pltdoc="x">Acknowledgments</a></td></tr><tr><td align="right">12&nbsp;</td><td><a href="License___source_code.html" class="tocviewlink" data-pltdoc="x">License &amp; source code</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_1&quot;);">&#9658;</a></td><td>7&nbsp;</td><td><a href="raco-pollen.html" class="tocviewselflink" data-pltdoc="x">Using <span class="stt">raco pollen</span></a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">7.1&nbsp;</td><td><a href="raco-pollen.html#%28part._.Making_sure_raco_pollen_works%29" class="tocviewlink" data-pltdoc="x">Making sure <span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span> works</a></td></tr><tr><td align="right">7.2&nbsp;</td><td><a href="raco-pollen.html#%28part._raco_pollen%29" class="tocviewlink" data-pltdoc="x"><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span></a></td></tr><tr><td align="right">7.3&nbsp;</td><td><a href="raco-pollen.html#%28part._raco_pollen_help%29" class="tocviewlink" data-pltdoc="x"><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">help</span></a></td></tr><tr><td align="right">7.4&nbsp;</td><td><a href="raco-pollen.html#%28part._raco_pollen_start%29" class="tocviewlink" data-pltdoc="x"><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">start</span></a></td></tr><tr><td align="right">7.5&nbsp;</td><td><a href="raco-pollen.html#%28part._raco_pollen_render%29" class="tocviewlink" data-pltdoc="x"><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">render</span></a></td></tr><tr><td align="right">7.6&nbsp;</td><td><a href="raco-pollen.html#%28part._raco_pollen_clone%29" class="tocviewlink" data-pltdoc="x"><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">clone</span></a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">7.1<tt>&nbsp;</tt></span><a href="#%28part._.Making_sure_raco_pollen_works%29" class="tocsubseclink" data-pltdoc="x">Making sure <span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span> works</a></td></tr><tr><td><span class="tocsublinknumber">7.2<tt>&nbsp;</tt></span><a href="#%28part._raco_pollen%29" class="tocsubseclink" data-pltdoc="x"><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span></a></td></tr><tr><td><span class="tocsublinknumber">7.3<tt>&nbsp;</tt></span><a href="#%28part._raco_pollen_help%29" class="tocsubseclink" data-pltdoc="x"><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">help</span></a></td></tr><tr><td><span class="tocsublinknumber">7.4<tt>&nbsp;</tt></span><a href="#%28part._raco_pollen_start%29" class="tocsubseclink" data-pltdoc="x"><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">start</span></a></td></tr><tr><td><span class="tocsublinknumber">7.5<tt>&nbsp;</tt></span><a href="#%28part._raco_pollen_render%29" class="tocsubseclink" data-pltdoc="x"><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">render</span></a></td></tr><tr><td><span class="tocsublinknumber">7.6<tt>&nbsp;</tt></span><a href="#%28part._raco_pollen_clone%29" class="tocsubseclink" data-pltdoc="x"><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">clone</span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.0.1.13</span></div><div class="navsettop"><span class="navleft"><div class="nosearchform"></div>&nbsp;&nbsp;</span><span class="navright">&nbsp;&nbsp;<a href="second-tutorial.html" title="backward to &quot;6 Second tutorial&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;Pollen: the book is a program&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="File_formats.html" title="forward to &quot;8 File formats&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h3>7<tt>&nbsp;</tt><a name="(part._raco-pollen)"></a>Using <span class="stt">raco pollen</span></h3><p>Racket provides centralized command-line options through <span class="RktSym">raco</span> (short for <span class="RktSym">racket</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">command</span><span class="RktMeta"></span>, see <a href="http://docs.racket-lang.org/raco/index.html" data-pltdoc="x"><span class="stt">raco</span>: Racket Command-Line Tools</a>).</p><p>Once you install Pollen, you can access the following Pollen-specific commands through <span class="RktSym">raco</span> using the subcommand <span class="stt">raco pollen</span>.</p><h4>7.1<tt>&nbsp;</tt><a name="(part._.Making_sure_raco_pollen_works)"></a>Making sure <span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span> works</h4><p>Open a terminal window and type:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="stt">&gt; raco pollen test</span></p></td></tr></table></p><p>If <span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span> is installed correctly, you&rsquo;ll see:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="stt">raco pollen is installed correctly</span></p></td></tr></table></p><p>But if you get:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="stt">raco: Unrecognized command: pollen</span></p></td></tr></table></p><p>You&rsquo;ll need to fix the problem before proceeding, most likely by reinstalling Pollen (see <span class="RktSym">Installation</span>).</p><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>Pro tip: I have an alias in my <span class="stt">.bash_profile</span> like so: <span class="stt">alias polcom=</span>'<span class="stt">raco pollen</span>'</p></blockquote></blockquote></blockquote><h4>7.2<tt>&nbsp;</tt><a name="(part._raco_pollen)"></a><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span></h4><p>Same as <span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">help</span>.</p><h4>7.3<tt>&nbsp;</tt><a name="(part._raco_pollen_help)"></a><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">help</span></h4><p>Displays a list of available commands.</p><h4>7.4<tt>&nbsp;</tt><a name="(part._raco_pollen_start)"></a><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">start</span></h4><p>Starts the project server from the current directory using the default port, which is the value of the parameter <span class="RktSym"><a href="World.html#%28def._%28%28lib._pollen%2Fworld..rkt%29._world~3acurrent-server-port%29%29" class="RktValLink" data-pltdoc="x">world:current-server-port</a></span> (by default, port 8080).</p><p>This command can be invoked with two optional arguments.</p><p><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">start</span><span class="stt"> </span><span class="RktVar">path</span> will start the project server in <span class="RktVar">path</span> rather than the current directory.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="stt">&gt; raco pollen start ~/path/to/project/</span></p></td></tr></table></p><p><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">start</span><span class="stt"> </span><span class="RktVar">path</span><span class="stt"> </span><span class="RktVar">port</span> will start the project server in <span class="RktVar">path</span> using <span class="RktVar">port</span> rather than <span class="RktSym"><a href="World.html#%28def._%28%28lib._pollen%2Fworld..rkt%29._world~3acurrent-server-port%29%29" class="RktValLink" data-pltdoc="x">world:current-server-port</a></span>. This is useful if you want to have multiple project servers running simultaneously.</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="stt">&gt; raco pollen start ~/path/to/project/</span></p></td></tr><tr><td><p><span class="stt">&gt; raco pollen start ~/path/to/project/scribblings 8088</span></p></td></tr></table></p><p>If you want to start in the current directory but with a different port, use <span class="RktInBG"><span class="hspace"></span><span class="RktIn">.</span><span class="hspace"></span></span> as the path:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="stt">&gt; raco pollen start . 8088</span></p></td></tr></table></p><h4>7.5<tt>&nbsp;</tt><a name="(part._raco_pollen_render)"></a><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">render</span></h4><p>Renders all preprocessor source files and then all pagetree files found in the current directory.</p><p>This command can be invoked with extra arguments.</p><p><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">render</span><span class="stt"> </span><span class="RktVar">directory</span> will render the preprocessor source files and pagetree files in the specified directory.</p><p>Alternatively, the command can take a variable number of path arguments. <span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">render</span><span class="stt"> </span><span class="RktVar">path...</span> will render only the paths specified in <span class="RktVar">path...</span>. Consistent with the usual command-line idiom, this can be a single path, a list of paths, or a pattern:</p><p><table cellspacing="0" cellpadding="0"><tr><td><p><span class="stt">&gt; raco pollen render foo.html.pm</span></p></td></tr><tr><td><p><span class="stt">&gt; raco pollen render foo.html.pm bar.html.pm zam.css.pp</span></p></td></tr><tr><td><p><span class="stt">&gt; raco pollen render *.html.pm</span></p></td></tr></table></p><h4>7.6<tt>&nbsp;</tt><a name="(part._raco_pollen_clone)"></a><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">clone</span></h4><p>Makes a copy of the project directory on the desktop, and removes any source files or other Pollen-related files.</p><p><span class="RktSym">raco</span><span class="stt"> </span><span class="RktSym">pollen</span><span class="stt"> </span><span class="RktSym">clobe</span><span class="stt"> </span><span class="RktVar">directory-path</span> will perform the same copying and filtering, but using <span class="RktVar">directory-path</span> as the destination rather than the desktop.</p><div class="navsetbottom"><span class="navleft"><div class="nosearchform"></div>&nbsp;&nbsp;</span><span class="navright">&nbsp;&nbsp;<a href="second-tutorial.html" title="backward to &quot;6 Second tutorial&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;Pollen: the book is a program&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="File_formats.html" title="forward to &quot;8 File formats&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>