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/pollen/raco-pollen.html

2 lines
17 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>6&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"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="file:///Users/MB/Library/Racket/6.0.1/doc/local-redirect/local-redirect.js"></script><script type="text/javascript" src="file:///Users/MB/Library/Racket/6.0.1/doc/local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-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="" class="tocviewselflink" data-pltdoc="x">Using <span class="stt">raco pollen</span></a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="File_formats.html" class="tocviewlink" data-pltdoc="x">File formats</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="reader.html" class="tocviewlink" data-pltdoc="x">&#9674; command overview</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="Module_reference.html" class="tocviewlink" data-pltdoc="x">Module reference</a></td></tr><tr><td align="right">10&nbsp;</td><td><a href="Acknowledgments.html" class="tocviewlink" data-pltdoc="x">Acknowledgments</a></td></tr><tr><td align="right">11&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>6&nbsp;</td><td><a href="" 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">6.1&nbsp;</td><td><a href="#%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">6.2&nbsp;</td><td><a href="#%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">6.3&nbsp;</td><td><a href="#%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">6.4&nbsp;</td><td><a href="#%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">6.5&nbsp;</td><td><a href="#%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">6.6&nbsp;</td><td><a href="#%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">6.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">6.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">6.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">6.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">6.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">6.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</span></div><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;6.0.1&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.0.1&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="First_tutorial.html" title="backward to &quot;5 First 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;7 File formats&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h3>6<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://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=raco&amp;rel=index.html&amp;version=6.0.1" class="Sq" 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>6.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"><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"><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"><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>6.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>6.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>6.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"><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"><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"><tr><td><p><span class="stt">&gt; raco pollen start . 8088</span></p></td></tr></table></p><h4>6.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"><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>6.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"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, &quot;6.0.1&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.0.1&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="First_tutorial.html" title="backward to &quot;5 First 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;7 File formats&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>