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.
2 lines
67 KiB
HTML
2 lines
67 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>9.4 Pagetree</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,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Pollen:<span class="mywbr"> </span> the book is a program</a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="Installation.html" class="tocviewlink" data-pltdoc="x">Installation</a></td></tr><tr><td align="right">2 </td><td><a href="quick-tour.html" class="tocviewlink" data-pltdoc="x">Quick tour</a></td></tr><tr><td align="right">3 </td><td><a href="Backstory.html" class="tocviewlink" data-pltdoc="x">Backstory</a></td></tr><tr><td align="right">4 </td><td><a href="big-picture.html" class="tocviewlink" data-pltdoc="x">The big picture</a></td></tr><tr><td align="right">5 </td><td><a href="First_tutorial.html" class="tocviewlink" data-pltdoc="x">First tutorial</a></td></tr><tr><td align="right">6 </td><td><a href="raco-pollen.html" class="tocviewlink" data-pltdoc="x">Using <span class="stt">raco pollen</span></a></td></tr><tr><td align="right">7 </td><td><a href="File_formats.html" class="tocviewlink" data-pltdoc="x">File formats</a></td></tr><tr><td align="right">8 </td><td><a href="reader.html" class="tocviewlink" data-pltdoc="x">◊ command overview</a></td></tr><tr><td align="right">9 </td><td><a href="Module_reference.html" class="tocviewselflink" data-pltdoc="x">Module reference</a></td></tr><tr><td align="right">10 </td><td><a href="Acknowledgments.html" class="tocviewlink" data-pltdoc="x">Acknowledgments</a></td></tr><tr><td align="right">11 </td><td><a href="License___source_code.html" class="tocviewlink" data-pltdoc="x">License & 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,"tocview_1");">▼</a></td><td>9 </td><td><a href="Module_reference.html" class="tocviewlink" data-pltdoc="x">Module reference</a></td></tr></table><div class="tocviewsublist" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">9.1 </td><td><a href="Cache.html" class="tocviewlink" data-pltdoc="x">Cache</a></td></tr><tr><td align="right">9.2 </td><td><a href="Decode.html" class="tocviewlink" data-pltdoc="x">Decode</a></td></tr><tr><td align="right">9.3 </td><td><a href="file-types.html" class="tocviewlink" data-pltdoc="x">File</a></td></tr><tr><td align="right">9.4 </td><td><a href="Pagetree.html" class="tocviewselflink" data-pltdoc="x">Pagetree</a></td></tr><tr><td align="right">9.5 </td><td><a href="Render.html" class="tocviewlink" data-pltdoc="x">Render</a></td></tr><tr><td align="right">9.6 </td><td><a href="Template.html" class="tocviewlink" data-pltdoc="x">Template</a></td></tr><tr><td align="right">9.7 </td><td><a href="Tag.html" class="tocviewlink" data-pltdoc="x">Tag</a></td></tr><tr><td align="right">9.8 </td><td><a href="Top.html" class="tocviewlink" data-pltdoc="x">Top</a></td></tr><tr><td align="right">9.9 </td><td><a href="World.html" class="tocviewlink" data-pltdoc="x">World</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,"tocview_2");">►</a></td><td>9.4 </td><td><a href="Pagetree.html" class="tocviewselflink" data-pltdoc="x">Pagetree</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">9.4.1 </td><td><a href="Pagetree.html#%28part._.Navigation%29" class="tocviewlink" data-pltdoc="x">Navigation</a></td></tr><tr><td align="right">9.4.2 </td><td><a href="Pagetree.html#%28part._.Utilities%29" class="tocviewlink" data-pltdoc="x">Utilities</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">pagetree?</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._validate-pagetree%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">validate-<wbr></wbr>pagetree</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">pagenode?</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">pagenodeish?</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._-~3epagenode%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="nobreak">-<wbr></wbr>></span>pagenode</span></a></td></tr><tr><td><span class="tocsublinknumber">9.4.1<tt> </tt></span><a href="#%28part._.Navigation%29" class="tocsubseclink" data-pltdoc="x">Navigation</a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">current-<wbr></wbr>pagetree</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._parent%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">parent</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._children%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">children</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._siblings%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">siblings</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">previous</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%2A%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">previous*</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">next</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%2A%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">next*</span></a></td></tr><tr><td><span class="tocsublinknumber">9.4.2<tt> </tt></span><a href="#%28part._.Utilities%29" class="tocsubseclink" data-pltdoc="x">Utilities</a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree-~3elist%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">pagetree-<wbr></wbr>>list</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._in-pagetree~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">in-<wbr></wbr>pagetree?</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._path-~3epagenode%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym">path-<wbr></wbr>>pagenode</span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.0.1.11</span></div><div class="navsettop"><span class="navleft"> </span><span class="navright"> <a href="file-types.html" title="backward to "9.3 File"" data-pltdoc="x">← prev</a> <a href="Module_reference.html" title="up to "9 Module reference"" data-pltdoc="x">up</a> <a href="Render.html" title="forward to "9.5 Render"" data-pltdoc="x">next →</a></span> </div><h4>9.4<tt> </tt><a name="(part._.Pagetree)"></a><a name="(mod-path._pollen/pagetree)"></a>Pagetree</h4><p><table cellspacing="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="Pagetree.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/pagetree</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">pollen</span></span></td></tr></table></p><p>A <span style="font-style: italic">pagetree</span> is a hierarchical list of Pollen output files. A pagetree source file has the extension <span class="RktSym">.ptree</span><span class="RktMeta"></span>. A pagetree provides a convenient way of separating the structure of the pages from the page sources, and navigating around this structure.</p><p>Pagetrees are made of <span style="font-style: italic">pagenodes</span>. Usually these pagenodes will be names of output files in your project. (If you think it would’ve been more logical to just call them “pages,” perhaps. When I think of a web page, I think of a file on a disk. Whereas pagenodes may — and often do — refer to files that don’t yet exist.)</p><p>Books and other long documents are usually organized in a structured way — at minimum they have a sequence of pages, but more often they have sections with subsequences within. Individual Pollen source files don’t know anything about how they’re connected to other files. In theory, you could maintain this information within each source file. This would be a poor use of human energy. Let the pagetree figure it out.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._pagetree~3f))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">pagetree?</span></span></span><span class="hspace"> </span><span class="RktVar">possible-pagetree</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">possible-pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Test whether <span class="RktVar">possible-pagetree</span> is a valid pagetree. It must be a <span class="RktSym"><a href="http://docs.racket-lang.org/txexpr/index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span> where all elements are <span class="RktSym">pagenode?</span>, and each is unique within <span class="RktVar">possible-pagetree</span> (not counting the root node).</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">pagetree?</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">index.html</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">pagetree?</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">duplicate.html</span><span class="hspace"> </span><span class="RktVal">duplicate.html</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">pagetree?</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">index.html</span><span class="hspace"> </span><span class="RktVal">"string.html"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">nested-ptree</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">1.html</span><span class="hspace"> </span><span class="RktVal">2.html</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">3.html</span><span class="hspace"> </span><span class="RktVal">3a.html</span><span class="hspace"> </span><span class="RktVal">3b.html</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">pagetree?</span><span class="hspace"> </span><span class="RktSym">nested-ptree</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">pagetree?</span><span class="hspace"> </span><span class="RktVal">`</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">index.html</span><span class="hspace"> </span><span class="RktRdr">,</span><span class="RktSym">nested-ptree</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">subsection.html</span><span class="hspace"> </span><span class="RktVal">more.html</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">Nesting a subtree twice creates duplication</span></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">pagetree?</span><span class="hspace"> </span><span class="RktVal">`</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">index.html</span><span class="hspace"> </span><span class="RktRdr">,</span><span class="RktSym">nested-ptree</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">subsection.html</span><span class="hspace"> </span><span class="RktRdr">,</span><span class="RktSym">nested-ptree</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._validate-pagetree))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">validate-pagetree</span></span></span><span class="hspace"> </span><span class="RktVar">possible-pagetree</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym">pagetree?</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">possible-pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym">pagetree?</span>, but raises a descriptive error if <span class="RktVar">possible-pagetree</span> is invalid, and otherwise returns <span class="RktVar">possible-pagetree</span> itself.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">validate-pagetree</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">mama.html</span><span class="hspace"> </span><span class="RktVal">son.html</span><span class="hspace"> </span><span class="RktVal">daughter.html</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">uncle.html</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(root (mama.html son.html daughter.html) uncle.html)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">validate-pagetree</span><span class="hspace"> </span><span class="RktVal">`</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktRdr">,</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2B%29%29" class="RktValLink" data-pltdoc="x">+</a></span><span class="hspace"> </span><span class="RktVal">son.html</span><span class="hspace"> </span><span class="RktVal">daughter.html</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">uncle.html</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">validate-pagetree</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">mama.html</span><span class="hspace"> </span><span class="RktVal">son.html</span><span class="hspace"> </span><span class="RktVal">son.html</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">mama.html</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">validate-pagetree: items aren’t unique: (son.html mama.html)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._pagenode~3f))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">pagenode?</span></span></span><span class="hspace"> </span><span class="RktVar">possible-pagenode</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">possible-pagenode</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Test whether <span class="RktVar">possible-pagenode</span> is a valid pagenode. A pagenode can be any <span class="RktSym"><a href="http://docs.racket-lang.org/reference/symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span> that is not <span class="RktSym"><a href="Decode.html#%28def._%28%28lib._pollen%2Fdecode..rkt%29._whitespace%2Fnbsp~3f%29%29" class="RktValLink" data-pltdoc="x">whitespace/nbsp?</a></span> Every leaf of a pagetree is a pagenode. In practice, your pagenodes will likely be names of output files.</div></p><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>Pagenodes are symbols (rather than strings) so that pagetrees will be valid tagged X-expressions, which is a more convenient format for validation & processing.</p></blockquote></blockquote></blockquote><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">Three symbols, the third one annoying but valid</span></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Fprivate%2Fmap..rkt%29._map%29%29" class="RktValLink" data-pltdoc="x">map</a></span><span class="hspace"> </span><span class="RktSym">pagenode?</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">symbol</span><span class="hspace"> </span><span class="RktVal">index.html</span><span class="hspace"> </span><span class="RktVal">|</span><span class="hspace"> </span><span class="RktVal">silly</span><span class="hspace"> </span><span class="RktVal">|</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(#t #t #t)</span></p></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">A number, a string, a txexpr, and a whitespace symbol</span></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Fprivate%2Fmap..rkt%29._map%29%29" class="RktValLink" data-pltdoc="x">map</a></span><span class="hspace"> </span><span class="RktSym">pagenode?</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">9.999</span><span class="hspace"> </span><span class="RktVal">"index.html"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">|</span><span class="hspace"> </span><span class="RktVal">|</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(#f #f #f #f)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._pagenodeish~3f))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">pagenodeish?</span></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Return <span class="RktVal">#t</span> if <span class="RktVar">v</span> can be converted with <span class="RktSym"><span class="nobreak">-></span>pagenode</span>.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Example:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Fprivate%2Fmap..rkt%29._map%29%29" class="RktValLink" data-pltdoc="x">map</a></span><span class="hspace"> </span><span class="RktSym">pagenodeish?</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">9.999</span><span class="hspace"> </span><span class="RktVal">"index.html"</span><span class="hspace"> </span><span class="RktVal">|</span><span class="hspace"> </span><span class="RktVal">|</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(#t #t #f)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._-~3epagenode))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym"><span class="nobreak">-></span>pagenode</span></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym">pagenode?</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagenodeish?</span></td></tr></table></blockquote></div><div class="SIntrapara">Convert <span class="RktVar">v</span> to a pagenode.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Fprivate%2Fmap..rkt%29._map%29%29" class="RktValLink" data-pltdoc="x">map</a></span><span class="hspace"> </span><span class="RktSym">pagenodeish?</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">symbol</span><span class="hspace"> </span><span class="RktVal">9.999</span><span class="hspace"> </span><span class="RktVal">"index.html"</span><span class="hspace"> </span><span class="RktVal">|</span><span class="hspace"> </span><span class="RktVal">silly</span><span class="hspace"> </span><span class="RktVal">|</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(#t #t #t #t)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Fprivate%2Fmap..rkt%29._map%29%29" class="RktValLink" data-pltdoc="x">map</a></span><span class="hspace"> </span><span class="RktSym"><span class="nobreak">-></span>pagenode</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">symbol</span><span class="hspace"> </span><span class="RktVal">9.999</span><span class="hspace"> </span><span class="RktVal">"index.html"</span><span class="hspace"> </span><span class="RktVal">|</span><span class="hspace"> </span><span class="RktVal">silly</span><span class="hspace"> </span><span class="RktVal">|</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(symbol |9.999| index.html |</span><span class="hspace"> </span><span class="RktRes">silly</span><span class="hspace"> </span><span class="RktRes">|)</span></p></td></tr></table></blockquote></td></tr></table></p><h5>9.4.1<tt> </tt><a name="(part._.Navigation)"></a>Navigation</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._current-pagetree))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">current-pagetree</span></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym">pagetree?</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">current-pagetree</span></span></span><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/void.html#%28def._%28%28quote._~23~25kernel%29._void~3f%29%29" class="RktValLink" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagetree?</span></td></tr></table></blockquote></div><div class="SIntrapara">A parameter that defines the default pagetree used by pagetree navigation functions (e.g., <span class="RktSym">parent-pagenode</span>, <span class="RktSym">chidren</span>, et al.) if another is not explicitly specified. Initialized to <span class="RktVal">#f</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._parent))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">parent</span></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>[<span class="RktVar">pagetree</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenode?</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenodeish?</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagetree?</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Find the parent pagenode of <span class="RktVar">p</span> within <span class="RktVar">pagetree</span>. Return <span class="RktVal">#f</span> if there isn’t one.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">mama.html</span><span class="hspace"> </span><span class="RktVal">son.html</span><span class="hspace"> </span><span class="RktVal">daughter.html</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">uncle.html</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">parent</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">son.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'mama.html</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">parent</span><span class="hspace"> </span><span class="RktVal">"mama.html"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'root</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">parent</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">parent</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">son.html</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'root</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">parent</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">parent</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">parent</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">son.html</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._children))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">children</span></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>[<span class="RktVar">pagetree</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenode?</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenodeish?</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagetree?</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Find the child pagenodes of <span class="RktVar">p</span> within <span class="RktVar">pagetree</span>. Return <span class="RktVal">#f</span> if there aren’t any.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">mama.html</span><span class="hspace"> </span><span class="RktVal">son.html</span><span class="hspace"> </span><span class="RktVal">daughter.html</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">uncle.html</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">children</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">mama.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(son.html daughter.html)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">children</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">uncle.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">children</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">root</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(mama.html uncle.html)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Fprivate%2Fmap..rkt%29._map%29%29" class="RktValLink" data-pltdoc="x">map</a></span><span class="hspace"> </span><span class="RktSym">children</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">children</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">root</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((son.html daughter.html) #f)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._siblings))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">siblings</span></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>[<span class="RktVar">pagetree</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenode?</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenodeish?</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagetree?</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Find the sibling pagenodes of <span class="RktVar">p</span> within <span class="RktVar">pagetree</span>. The list will include <span class="RktVar">p</span> itself. But the function will still return <span class="RktVal">#f</span> if <span class="RktVar">pagetree</span> is <span class="RktVal">#f</span>.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">mama.html</span><span class="hspace"> </span><span class="RktVal">son.html</span><span class="hspace"> </span><span class="RktVal">daughter.html</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">uncle.html</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">siblings</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">son.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(son.html daughter.html)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">siblings</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">daughter.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(son.html daughter.html)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">siblings</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">mama.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(mama.html uncle.html)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._previous))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">previous</span></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>[<span class="RktVar">pagetree</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenode?</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenodeish?</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagetree?</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._previous*))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">previous*</span></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>[<span class="RktVar">pagetree</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym">pagenode?</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenodeish?</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagetree?</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Return the pagenode immediately before <span class="RktVar">p</span>. For <span class="RktSym">previous*</span>, return all the pagenodes before <span class="RktVar">p</span>, in sequence. In both cases, return <span class="RktVal">#f</span> if there aren’t any pagenodes. The root pagenode is ignored.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">mama.html</span><span class="hspace"> </span><span class="RktVal">son.html</span><span class="hspace"> </span><span class="RktVal">daughter.html</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">uncle.html</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">previous</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">daughter.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'son.html</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">previous</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">son.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'mama.html</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">previous</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">previous</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">daughter.html</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'mama.html</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">previous</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">mama.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">previous*</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">daughter.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(mama.html son.html)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">previous*</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">uncle.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(mama.html son.html daughter.html)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._next))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">next</span></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>[<span class="RktVar">pagetree</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenode?</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenodeish?</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagetree?</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._next*))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">next*</span></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>[<span class="RktVar">pagetree</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym">pagenode?</span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym">pagenodeish?</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagetree?</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Return the pagenode immediately after <span class="RktVar">p</span>. For <span class="RktSym">next*</span>, return all the pagenodes after <span class="RktVar">p</span>, in sequence. In both cases, return <span class="RktVal">#f</span> if there aren’t any pagenodes. The root pagenode is ignored.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">mama.html</span><span class="hspace"> </span><span class="RktVal">son.html</span><span class="hspace"> </span><span class="RktVal">daughter.html</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">uncle.html</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">next</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">son.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'daughter.html</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">next</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">daughter.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'uncle.html</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">next</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">next</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">son.html</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'uncle.html</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">next</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">uncle.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">next*</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">mama.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(son.html daughter.html uncle.html)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">next*</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">daughter.html</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(uncle.html)</span></p></td></tr></table></blockquote></td></tr></table></p><h5>9.4.2<tt> </tt><a name="(part._.Utilities)"></a>Utilities</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._pagetree-~3elist))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">pagetree->list</span></span></span><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list~3f%29%29" class="RktValLink" data-pltdoc="x">list?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagetree?</span></td></tr></table></blockquote></div><div class="SIntrapara">Convert <span class="RktVar">pagetree</span> to a simple list. Equivalent to a pre-order depth-first traversal of <span class="RktVar">pagetree</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._in-pagetree~3f))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">in-pagetree?</span></span></span><span class="hspace"> </span><span class="RktVar">pagenode</span><span class="hspace"> </span>[<span class="RktVar">pagetree</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pagenode</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagenode?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pagetree</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">pagetree?</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">current-pagetree</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Report whether <span class="RktVar">pagenode</span> is in <span class="RktVar">pagetree</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/pagetree..rkt)._path-~3epagenode))"></a><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">path->pagenode</span></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym">pagenode?</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/sugar/Coercion.html#%28def._%28%28lib._sugar%2Fcoerce%2Fvalue..rkt%29._pathish~3f%29%29" class="RktValLink" data-pltdoc="x">pathish?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Convert path <span class="RktVar">p</span> to a pagenode — meaning, make it relative to <span class="RktSym">current-project-root</span>, run it through <span class="RktSym"><a href="file-types.html#%28def._%28%28lib._pollen%2Ffile..rkt%29._-~3eoutput-path%29%29" class="RktValLink" data-pltdoc="x"><span class="nobreak">-></span>output-path</a></span>, and convert it to a symbol. Does not tell you whether the resultant pagenode actually exists in the current pagetree (for that, use <span class="RktSym">in-pagetree?</span>).</div></p><div class="navsetbottom"><span class="navleft"> </span><span class="navright"> <a href="file-types.html" title="backward to "9.3 File"" data-pltdoc="x">← prev</a> <a href="Module_reference.html" title="up to "9 Module reference"" data-pltdoc="x">up</a> <a href="Render.html" title="forward to "9.5 Render"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html> |