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
103 KiB
HTML
2 lines
103 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>11.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"/><link rel="stylesheet" type="text/css" href="mb.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="second-tutorial.html" class="tocviewlink" data-pltdoc="x">Second tutorial</a></td></tr><tr><td align="right">7 </td><td><a href="third-tutorial.html" class="tocviewlink" data-pltdoc="x">Third tutorial</a></td></tr><tr><td align="right">8 </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">9 </td><td><a href="File_formats.html" class="tocviewlink" data-pltdoc="x">File formats</a></td></tr><tr><td align="right">10 </td><td><a href="reader.html" class="tocviewlink" data-pltdoc="x">◊ command overview</a></td></tr><tr><td align="right">11 </td><td><a href="Module_reference.html" class="tocviewselflink" data-pltdoc="x">Module reference</a></td></tr><tr><td align="right">12 </td><td><a href="Acknowledgments.html" class="tocviewlink" data-pltdoc="x">Acknowledgments</a></td></tr><tr><td align="right">13 </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>11 </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">11.1 </td><td><a href="Cache.html" class="tocviewlink" data-pltdoc="x">Cache</a></td></tr><tr><td align="right">11.2 </td><td><a href="Decode.html" class="tocviewlink" data-pltdoc="x">Decode</a></td></tr><tr><td align="right">11.3 </td><td><a href="file-types.html" class="tocviewlink" data-pltdoc="x">File</a></td></tr><tr><td align="right">11.4 </td><td><a href="Pagetree.html" class="tocviewselflink" data-pltdoc="x">Pagetree</a></td></tr><tr><td align="right">11.5 </td><td><a href="Render.html" class="tocviewlink" data-pltdoc="x">Render</a></td></tr><tr><td align="right">11.6 </td><td><a href="Template.html" class="tocviewlink" data-pltdoc="x">Template</a></td></tr><tr><td align="right">11.7 </td><td><a href="Tag.html" class="tocviewlink" data-pltdoc="x">Tag</a></td></tr><tr><td align="right">11.8 </td><td><a href="Top.html" class="tocviewlink" data-pltdoc="x">Top</a></td></tr><tr><td align="right">11.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>11.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">11.4.1 </td><td><a href="Pagetree.html#%28part._.Making_pagetrees_with_a_source_file%29" class="tocviewlink" data-pltdoc="x">Making pagetrees with a source file</a></td></tr><tr><td align="right">11.4.2 </td><td><a href="Pagetree.html#%28part._.Making_pagetrees_by_hand%29" class="tocviewlink" data-pltdoc="x">Making pagetrees by hand</a></td></tr><tr><td align="right">11.4.3 </td><td><a href="Pagetree.html#%28part._.Using_pagetrees_for_navigation%29" class="tocviewlink" data-pltdoc="x">Using pagetrees for navigation</a></td></tr><tr><td align="right">11.4.4 </td><td><a href="Pagetree.html#%28part._.Using_index_ptree_in_the_dashboard%29" class="tocviewlink" data-pltdoc="x">Using <span class="stt">index.ptree</span> in the dashboard</a></td></tr><tr><td align="right">11.4.5 </td><td><a href="Pagetree.html#%28part._.Using_pagetrees_with_raco_pollen_render%29" class="tocviewlink" data-pltdoc="x">Using pagetrees with <span class="stt">raco pollen render</span></a></td></tr><tr><td align="right">11.4.6 </td><td><a href="Pagetree.html#%28part._.Functions%29" class="tocviewlink" data-pltdoc="x">Functions</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">11.4.1<tt> </tt></span><a href="#%28part._.Making_pagetrees_with_a_source_file%29" class="tocsubseclink" data-pltdoc="x">Making pagetrees with a source file</a></td></tr><tr><td><span class="tocsublinknumber">11.4.2<tt> </tt></span><a href="#%28part._.Making_pagetrees_by_hand%29" class="tocsubseclink" data-pltdoc="x">Making pagetrees by hand</a></td></tr><tr><td><span class="tocsublinknumber">11.4.3<tt> </tt></span><a href="#%28part._.Using_pagetrees_for_navigation%29" class="tocsubseclink" data-pltdoc="x">Using pagetrees for navigation</a></td></tr><tr><td><span class="tocsublinknumber">11.4.4<tt> </tt></span><a href="#%28part._.Using_index_ptree_in_the_dashboard%29" class="tocsubseclink" data-pltdoc="x">Using <span class="stt">index.ptree</span> in the dashboard</a></td></tr><tr><td><span class="tocsublinknumber">11.4.5<tt> </tt></span><a href="#%28part._.Using_pagetrees_with_raco_pollen_render%29" class="tocsubseclink" data-pltdoc="x">Using pagetrees with <span class="stt">raco pollen render</span></a></td></tr><tr><td><span class="tocsublinknumber">11.4.6<tt> </tt></span><a href="#%28part._.Functions%29" class="tocsubseclink" data-pltdoc="x">Functions</a></td></tr><tr><td><span class="tocsublinknumber">11.4.6.1<tt> </tt></span><a href="#%28part._.Predicates___validation%29" class="tocsubseclink" data-pltdoc="x">Predicates & validation</a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">pagetree?</span></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"><span class="RktValLink">validate-<wbr></wbr>pagetree</span></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"><span class="RktValLink">pagenode?</span></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"><span class="RktValLink">pagenodeish?</span></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="RktValLink"><span class="nobreak">-<wbr></wbr>></span>pagenode</span></span></a></td></tr><tr><td><span class="tocsublinknumber">11.4.6.2<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"><span class="RktValLink">current-<wbr></wbr>pagetree</span></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"><span class="RktValLink">parent</span></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"><span class="RktValLink">children</span></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"><span class="RktValLink">siblings</span></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"><span class="RktValLink">previous</span></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"><span class="RktValLink">previous*</span></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"><span class="RktValLink">next</span></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"><span class="RktValLink">next*</span></span></a></td></tr><tr><td><span class="tocsublinknumber">11.4.6.3<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"><span class="RktValLink">pagetree-<wbr></wbr>>list</span></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"><span class="RktValLink">in-<wbr></wbr>pagetree?</span></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"><span class="RktValLink">path-<wbr></wbr>>pagenode</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.1.0.5</span></div><div class="navsettop"><span class="navleft"><div class="nosearchform"></div> </span><span class="navright"> <a href="file-types.html" title="backward to "11.3 File"" data-pltdoc="x">← prev</a> <a href="Module_reference.html" title="up to "11 Module reference"" data-pltdoc="x">up</a> <a href="Render.html" title="forward to "11.5 Render"" data-pltdoc="x">next →</a></span> </div><h4>11.4<tt> </tt><a name="(part._.Pagetree)"></a><a name="(mod-path._pollen/pagetree)"></a>Pagetree</h4><p><table cellspacing="0" cellpadding="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>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 pages in a Pollen project don’t know anything about how they’re connected to other pages. In theory, you could maintain this information within the source files. But this would be a poor use of human energy.</p><p>Instead, use a pagetree. A <span style="font-style: italic">pagetree</span> is a simple abstraction for defining & working with sequences of <span style="font-style: italic">pagenodes</span>. Typically these pagenodes will be the names of output files in your project.</p><p>“So it’s a list of web-page filenames?” Sort of. When I think of a web page, I think of an actual file on a disk. Keeping with Pollen’s orientation toward dynamic rendering, pagenodes may — and often do — refer to files that don’t yet exist. Moreover, by referring to output names rather than source names, you retain the flexibility to change the kind of source associated with a particular pagenode (e.g., from preprocessor source to Pollen markup).</p><p>Pagetrees can be flat or hierarchical. A flat pagetree is just a <a href="http://docs.racket-lang.org/guide/Lists__Iteration__and_Recursion.html" data-pltdoc="x">list</a> of pagenodes. A hierarchical pagetree can also contain recursively nested lists of pagenodes. But you needn’t pay attention to this distinction, as the pagetree functions don’t care which kind you use. Neither do I.</p><p>Pagetrees surface throughout the Pollen system. They’re primarily used for navigation — for instance, calculating “previous,” “next,” or “up” links for a given page. A special pagetree, <span class="stt">index.ptree</span>, is used by the project server to order the files in a dashboard. Pagetrees can also be used to define batches of files for certain operations, for instance <a href="http://docs.racket-lang.org/pollen/raco-pollen.html#%28part._raco_pollen_render%29" 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>. You might find other uses for them too.</p><h5>11.4.1<tt> </tt><a name="(part._.Making_pagetrees_with_a_source_file)"></a>Making pagetrees with a source file</h5><p>A pagetree source file either starts with <span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a><span class="RktMeta"></span> and uses the <span class="stt">.ptree</span> extension, or starts with <span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="File_formats.html#%28mod-path._pollen%2Fptree%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/ptree</span></a><span class="RktMeta"></span> and then can have any file extension.</p><p>Unlike other Pollen source files, since the pagetree source is not rendered into an output format, the rest of the filename is up to you.</p><p>Here’s a flat pagetree. Each line is considered a single pagenode (blank lines are ignored). Notice that no Pollen command syntax nor quoting is needed within the pagetree source:</p><div class="fileblock"><div class="SIntrapara"><div class="fileblock_filetitle"><span class="fileblock_filename"><span class="stt">"flat.ptree"</span></span></div></div><div class="SIntrapara"><div class="fileblock_filecontent"><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"> </span></td></tr><tr><td><span class="RktMeta">index.html</span></td></tr><tr><td><span class="RktMeta">introduction.html</span></td></tr><tr><td><span class="RktMeta">main_argument.html</span></td></tr><tr><td><span class="RktMeta">conclusion.html</span></td></tr></table></blockquote></div></div></div></div><p>And here’s the output in DrRacket:</p><blockquote class="SubFlow"><p><span class="RktVal"><span class="stt">'(pagetree-root index.html introduction.html main_argument.html conclusion.html)</span></span></p></blockquote><p>Keeping with usual Pollen policy, this is an <a href="http://docs.racket-lang.org/pollen/second-tutorial.html#%28part._.X-expressions%29" data-pltdoc="x">X-expression</a>. The <span class="RktSym">pagetree-root</span> is just an arbitrary tag that contains the pagetree.</p><p>Upgrading to a hierarchical pagetree is simple. The same basic rule applies — one pagenode per line. But this time, you add Pollen command syntax: a lozenge <span class="RktInBG"><span class="hspace"></span><span class="RktIn">◊</span><span class="hspace"></span></span> in front of a pagenode marks it as the top of a nested list, and the sub-pagenodes of that list go between <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span> curly braces <span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span>, like so:</p><div class="fileblock"><div class="SIntrapara"><div class="fileblock_filetitle"><span class="fileblock_filename"><span class="stt">"hierarchical.ptree"</span></span></div></div><div class="SIntrapara"><div class="fileblock_filecontent"><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"> </span></td></tr><tr><td><span class="RktMeta">toc.html</span></td></tr><tr><td><span class="RktMeta">◊</span><span class="RktSym">first-chapter.html</span><span class="RktPn">{</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta">foreword.html</span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta">introduction.html</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">◊</span><span class="RktSym">second-chapter.html</span><span class="RktPn">{</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta">◊</span><span class="RktSym">main-argument.html</span><span class="RktPn">{</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta">facts.html</span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta">analysis.html</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta">conclusion.html</span><span class="RktPn">}</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">bibliography.html</span></td></tr></table></blockquote></div></div></div></div><p>The output of our hierarchical pagetree:</p><blockquote class="SubFlow"><p><span class="RktVal"><span class="stt">'(pagetree-root toc.html (first-chapter.html foreword.html introduction.html) (second-chapter.html (main-argument.html facts.html analysis.html) conclusion.html) bibliography.html)</span></span></p></blockquote><p>One advantage of using a source file is that when you run it in DrRacket, it will automatically be checked using <span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._validate-pagetree%29%29" class="RktValLink" data-pltdoc="x">validate-pagetree</a></span>, which insures that every element in the pagetree meets <span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></span>, and that all the pagenodes are unique.</p><p>This pagetree has a duplicate pagenode, so it won’t run:</p><div class="fileblock"><div class="SIntrapara"><div class="fileblock_filetitle"><span class="fileblock_filename"><span class="stt">"duplicate-pagenode.ptree"</span></span></div></div><div class="SIntrapara"><div class="fileblock_filecontent"><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"> </span></td></tr><tr><td><span class="RktMeta">index.html</span></td></tr><tr><td><span class="RktMeta">introduction.html</span></td></tr><tr><td><span class="RktMeta">main_argument.html</span></td></tr><tr><td><span class="RktMeta">conclusion.html</span></td></tr><tr><td><span class="RktMeta">index.html</span></td></tr></table></blockquote></div></div></div></div><p>Instead, you’ll get an error:</p><blockquote class="SubFlow"><p><span class="RktErr"><span class="stt">validate-pagetree: members-unique? failed because item isn’t unique: (index.html)</span></span></p></blockquote><h5>11.4.2<tt> </tt><a name="(part._.Making_pagetrees_by_hand)"></a>Making pagetrees by hand</h5><p>Experienced programmers may want to know that because a pagetree is just an X-expression, you can synthesize a pagetree using any Pollen or Racket tools for making X-expressions. For example, here’s some Racket code that generates the same pagetree as the <span class="stt">flat.ptree</span> source file above:</p><div class="fileblock"><div class="SIntrapara"><div class="fileblock_filetitle"><span class="fileblock_filename"><span class="stt">"make-flat-ptree.rkt"</span></span></div></div><div class="SIntrapara"><div class="fileblock_filecontent"><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="http://docs.racket-lang.org/reference/index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">racket</span></a><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></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="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">pollen/pagetree</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></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="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">node-names</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/quote.html#%28form._%28%28quote._~23~25kernel%29._quote%29%29" class="RktStxLink" data-pltdoc="x">'</a></span><span class="RktPn">(</span><span class="RktSym">index</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">introduction</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">main_argument</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">conclusion</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></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="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">pt</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/quasiquote.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._quasiquote%29%29" class="RktStxLink" data-pltdoc="x">`</a></span><span class="RktPn">(</span><span class="RktSym">pagetree-root</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/quasiquote.html#%28form._%28%28quote._~23~25kernel%29._unquote-splicing%29%29" class="RktStxLink" data-pltdoc="x">,@</a></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="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="RktPn">(</span><span class="RktSym">n</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/symbols.html#%28def._%28%28quote._~23~25kernel%29._string-~3esymbol%29%29" class="RktValLink" data-pltdoc="x">string->symbol</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/Writing.html#%28def._%28%28quote._~23~25kernel%29._format%29%29" class="RktValLink" data-pltdoc="x">format</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">"~a.html"</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">n</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">node-names</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">pt</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">pt</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">"Oops,</span><span class="hspace"> </span><span class="RktVal">not</span><span class="hspace"> </span><span class="RktVal">a</span><span class="hspace"> </span><span class="RktVal">pagetree"</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote></div></div></div></div><p>Note that you need to take more care when building a pagetree by hand. Pagenodes are symbols, not strings, thus the use of <span class="RktSym"><a href="http://docs.racket-lang.org/reference/symbols.html#%28def._%28%28quote._~23~25kernel%29._string-~3esymbol%29%29" class="RktValLink" data-pltdoc="x">string->symbol</a></span> is mandatory. One benefit of using a pagetree source file is that it takes care of this housekeeping for you.</p><h5>11.4.3<tt> </tt><a name="(part._.Using_pagetrees_for_navigation)"></a>Using pagetrees for navigation</h5><p>Typically you’ll call the pagetree-navigation functions from inside templates, using the special variable <span class="RktSym">here</span> as the starting point. For more on this technique, see <a href="second-tutorial.html#%28part._tutorial-2._.Pagetree_navigation%29" data-pltdoc="x">Pagetree navigation</a>.</p><h5>11.4.4<tt> </tt><a name="(part._.Using_index_ptree_in_the_dashboard)"></a>Using <span class="stt">index.ptree</span> in the dashboard</h5><p>When you’re using the project server to view the files in a directory, the server will first look for a file called <span class="stt">index.ptree</span>. If it finds this pagetree file, it will use it to build the dashboard. If not, then it will synthesize a pagetree using a directory listing. For more on this technique, see <a href="http://docs.racket-lang.org/pollen/first-tutorial.html#%28part._.Using_the_dashboard%29" data-pltdoc="x">Using the dashboard</a>.</p><h5>11.4.5<tt> </tt><a name="(part._.Using_pagetrees_with_raco_pollen_render)"></a>Using pagetrees with <span class="stt">raco pollen render</span></h5><p>The <span class="stt">raco pollen render</span> command is used to regenerate an output file from its source. If you pass a pagetree to <span class="stt">raco pollen render</span>, it will automatically render each file listed in the pagetree.</p><p>For instance, many projects have auxiliary pages that don’t really belong in the main navigational flow. You can collect these pages in a separate pagetree:</p><div class="fileblock"><div class="SIntrapara"><div class="fileblock_filetitle"><span class="fileblock_filename"><span class="stt">"utility.ptree"</span></span></div></div><div class="SIntrapara"><div class="fileblock_filecontent"><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"> </span></td></tr><tr><td><span class="RktMeta">404-error.html</span></td></tr><tr><td><span class="RktMeta">terms-of-service.html</span></td></tr><tr><td><span class="RktMeta">webmaster.html</span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">[</span><span class="RktMeta">...</span><span class="hspace"> </span><span class="RktMeta">and</span><span class="hspace"> </span><span class="RktMeta">so</span><span class="hspace"> </span><span class="RktMeta">on</span><span class="RktPn">]</span><span class="RktMeta"></span></td></tr></table></blockquote></div></div></div></div><p>Thus, when you’re using pagetree-navigation functions within a template, you can use your main pagetree, and restrict the navigation to the main editorial content. But when you render the project, you can pass both pagetrees to <span class="stt">raco pollen render</span>.</p><p>For more on this technique, see <a href="http://docs.racket-lang.org/pollen/raco-pollen.html#%28part._raco_pollen_render%29" 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>.</p><h5>11.4.6<tt> </tt><a name="(part._.Functions)"></a>Functions</h5><h5>11.4.6.1<tt> </tt><a name="(part._.Predicates___validation)"></a>Predicates & validation</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">pagetree?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></span>, and each is unique within <span class="RktVar">possible-pagetree</span> (not counting the root node).</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></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" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></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" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._validate-pagetree%29%29" class="RktValDef RktValLink" data-pltdoc="x">validate-pagetree</a></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="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</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">Like <span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></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" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._validate-pagetree%29%29" class="RktValLink" data-pltdoc="x">validate-pagetree</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._validate-pagetree%29%29" class="RktValLink" data-pltdoc="x">validate-pagetree</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._validate-pagetree%29%29" class="RktValLink" data-pltdoc="x">validate-pagetree</a></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: members-unique? failed because items</span></p></td></tr><tr><td><p><span class="RktErr">aren’t unique: (mama.html son.html)</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">pagenode?</a></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" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></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" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">pagenodeish?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._-~3epagenode%29%29" class="RktValLink" data-pltdoc="x"><span class="nobreak">-></span>pagenode</a></span>.</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Example:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="RktValLink" data-pltdoc="x">pagenodeish?</a></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" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._-~3epagenode%29%29" class="RktValDef RktValLink" data-pltdoc="x"><span class="nobreak">-></span>pagenode</a></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="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</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="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="RktValLink" data-pltdoc="x">pagenodeish?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Convert <span class="RktVar">v</span> to a pagenode.</div></p><p><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="RktValLink" data-pltdoc="x">pagenodeish?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._-~3epagenode%29%29" class="RktValLink" data-pltdoc="x"><span class="nobreak">-></span>pagenode</a></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>11.4.6.2<tt> </tt><a name="(part._.Navigation)"></a>Navigation</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-pagetree</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: pollen/pagetree | Package: pollen"><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValDef RktValLink" data-pltdoc="x">current-pagetree</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></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" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._parent%29%29" class="RktValDef RktValLink" data-pltdoc="x">parent</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="RktValLink" data-pltdoc="x">pagenodeish?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></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" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></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" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._parent%29%29" class="RktValLink" data-pltdoc="x">parent</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._parent%29%29" class="RktValLink" data-pltdoc="x">parent</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._parent%29%29" class="RktValLink" data-pltdoc="x">parent</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._parent%29%29" class="RktValLink" data-pltdoc="x">parent</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._parent%29%29" class="RktValLink" data-pltdoc="x">parent</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._parent%29%29" class="RktValLink" data-pltdoc="x">parent</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._parent%29%29" class="RktValLink" data-pltdoc="x">parent</a></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" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._children%29%29" class="RktValDef RktValLink" data-pltdoc="x">children</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="RktValLink" data-pltdoc="x">pagenodeish?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></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" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></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" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._children%29%29" class="RktValLink" data-pltdoc="x">children</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._children%29%29" class="RktValLink" data-pltdoc="x">children</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._children%29%29" class="RktValLink" data-pltdoc="x">children</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._children%29%29" class="RktValLink" data-pltdoc="x">children</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._children%29%29" class="RktValLink" data-pltdoc="x">children</a></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" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._siblings%29%29" class="RktValDef RktValLink" data-pltdoc="x">siblings</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="RktValLink" data-pltdoc="x">pagenodeish?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></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" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></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" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._siblings%29%29" class="RktValLink" data-pltdoc="x">siblings</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._siblings%29%29" class="RktValLink" data-pltdoc="x">siblings</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._siblings%29%29" class="RktValLink" data-pltdoc="x">siblings</a></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" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%29%29" class="RktValDef RktValLink" data-pltdoc="x">previous</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="RktValLink" data-pltdoc="x">pagenodeish?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%2A%29%29" class="RktValDef RktValLink" data-pltdoc="x">previous*</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="RktValLink" data-pltdoc="x">pagenodeish?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%2A%29%29" class="RktValLink" data-pltdoc="x">previous*</a></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" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></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" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%29%29" class="RktValLink" data-pltdoc="x">previous</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%29%29" class="RktValLink" data-pltdoc="x">previous</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%29%29" class="RktValLink" data-pltdoc="x">previous</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%29%29" class="RktValLink" data-pltdoc="x">previous</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%29%29" class="RktValLink" data-pltdoc="x">previous</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%2A%29%29" class="RktValLink" data-pltdoc="x">previous*</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._previous%2A%29%29" class="RktValLink" data-pltdoc="x">previous*</a></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" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%29%29" class="RktValDef RktValLink" data-pltdoc="x">next</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="RktValLink" data-pltdoc="x">pagenodeish?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%2A%29%29" class="RktValDef RktValLink" data-pltdoc="x">next*</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenodeish~3f%29%29" class="RktValLink" data-pltdoc="x">pagenodeish?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%2A%29%29" class="RktValLink" data-pltdoc="x">next*</a></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" cellpadding="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></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" cellpadding="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%29%29" class="RktValLink" data-pltdoc="x">next</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%29%29" class="RktValLink" data-pltdoc="x">next</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%29%29" class="RktValLink" data-pltdoc="x">next</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%29%29" class="RktValLink" data-pltdoc="x">next</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%29%29" class="RktValLink" data-pltdoc="x">next</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%2A%29%29" class="RktValLink" data-pltdoc="x">next*</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._next%2A%29%29" class="RktValLink" data-pltdoc="x">next*</a></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>11.4.6.3<tt> </tt><a name="(part._.Utilities)"></a>Utilities</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree-~3elist%29%29" class="RktValDef RktValLink" data-pltdoc="x">pagetree->list</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></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" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._in-pagetree~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">in-pagetree?</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._current-pagetree%29%29" class="RktValLink" data-pltdoc="x">current-pagetree</a></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" cellpadding="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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._path-~3epagenode%29%29" class="RktValDef RktValLink" data-pltdoc="x">path->pagenode</a></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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagenode~3f%29%29" class="RktValLink" data-pltdoc="x">pagenode?</a></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/index.html#%28def._%28%28lib._sugar%2Fcoerce..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"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._in-pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">in-pagetree?</a></span>).</div></p><div class="navsetbottom"><span class="navleft"><div class="nosearchform"></div> </span><span class="navright"> <a href="file-types.html" title="backward to "11.3 File"" data-pltdoc="x">← prev</a> <a href="Module_reference.html" title="up to "11 Module reference"" data-pltdoc="x">up</a> <a href="Render.html" title="forward to "11.5 Render"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html> |