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
57 KiB
HTML
2 lines
57 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>9.6 Template</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="file:///Users/MB/Library/Racket/6.0.1/doc/local-redirect/local-redirect.js"></script><script type="text/javascript" src="file:///Users/MB/Library/Racket/6.0.1/doc/local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Pollen:<span class="mywbr"> </span> the book is a program</a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="Installation.html" class="tocviewlink" data-pltdoc="x">Installation</a></td></tr><tr><td align="right">2 </td><td><a href="quick-tour.html" class="tocviewlink" data-pltdoc="x">Quick tour</a></td></tr><tr><td align="right">3 </td><td><a href="Backstory.html" class="tocviewlink" data-pltdoc="x">Backstory</a></td></tr><tr><td align="right">4 </td><td><a href="big-picture.html" class="tocviewlink" data-pltdoc="x">The big picture</a></td></tr><tr><td align="right">5 </td><td><a href="First_tutorial.html" class="tocviewlink" data-pltdoc="x">First tutorial</a></td></tr><tr><td align="right">6 </td><td><a href="raco-pollen.html" class="tocviewlink" data-pltdoc="x">Using <span class="stt">raco pollen</span></a></td></tr><tr><td align="right">7 </td><td><a href="File_formats.html" class="tocviewlink" data-pltdoc="x">File formats</a></td></tr><tr><td align="right">8 </td><td><a href="reader.html" class="tocviewlink" data-pltdoc="x">◊ command overview</a></td></tr><tr><td align="right">9 </td><td><a href="Module_reference.html" class="tocviewselflink" data-pltdoc="x">Module reference</a></td></tr><tr><td align="right">10 </td><td><a href="Acknowledgments.html" class="tocviewlink" data-pltdoc="x">Acknowledgments</a></td></tr><tr><td align="right">11 </td><td><a href="License___source_code.html" class="tocviewlink" data-pltdoc="x">License & source code</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">▼</a></td><td>9 </td><td><a href="Module_reference.html" class="tocviewlink" data-pltdoc="x">Module reference</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">9.1 </td><td><a href="Cache.html" class="tocviewlink" data-pltdoc="x">Cache</a></td></tr><tr><td align="right">9.2 </td><td><a href="Decode.html" class="tocviewlink" data-pltdoc="x">Decode</a></td></tr><tr><td align="right">9.3 </td><td><a href="file-types.html" class="tocviewlink" data-pltdoc="x">File</a></td></tr><tr><td align="right">9.4 </td><td><a href="Pagetree.html" class="tocviewlink" data-pltdoc="x">Pagetree</a></td></tr><tr><td align="right">9.5 </td><td><a href="Render.html" class="tocviewlink" data-pltdoc="x">Render</a></td></tr><tr><td align="right">9.6 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Template</a></td></tr><tr><td align="right">9.7 </td><td><a href="Tag.html" class="tocviewlink" data-pltdoc="x">Tag</a></td></tr><tr><td align="right">9.8 </td><td><a href="Top.html" class="tocviewlink" data-pltdoc="x">Top</a></td></tr><tr><td align="right">9.9 </td><td><a href="World.html" class="tocviewlink" data-pltdoc="x">World</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><a href="#%28def._%28%28lib._pollen%2Ftemplate..rkt%29._-~3ehtml%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="nobreak">-<wbr></wbr>></span>html</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Ftemplate..rkt%29._select%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">select</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Ftemplate..rkt%29._select%2A%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">select*</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Ftemplate..rkt%29._select-from-metas%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">select-<wbr></wbr>from-<wbr></wbr>metas</span></a></td></tr><tr><td><a href="#%28def._%28%28lib._pollen%2Ftemplate..rkt%29._select-from-doc%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym">select-<wbr></wbr>from-<wbr></wbr>doc</span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.0.1</span></div><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.0.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.0.1");">top</a></span><span class="navright"> <a href="Render.html" title="backward to "9.5 Render"" data-pltdoc="x">← prev</a> <a href="Module_reference.html" title="up to "9 Module reference"" data-pltdoc="x">up</a> <a href="Tag.html" title="forward to "9.7 Tag"" data-pltdoc="x">next →</a></span> </div><h4>9.6<tt> </tt><a name="(part._.Template)"></a><a name="(mod-path._pollen/template)"></a>Template</h4><p><table cellspacing="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.0.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/template</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>Convenience functions for templates. These are automatically imported into the <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=eval.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._eval%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">eval</a></span> environment when rendering with a template (see <span class="RktSym"><a href="Render.html#%28def._%28%28lib._pollen%2Frender..rkt%29._render%29%29" class="RktValLink" data-pltdoc="x">render</a></span>).</p><p>This module also provides everything from <span class="RktSym">sugar/coerce/value</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._pollen/template..rkt)._-~3ehtml))"></a><span title="Provided from: pollen/template | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym"><span class="nobreak">-></span>html</span></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">xexpr</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktPn">#:tag</span><span class="hspace"> </span><span class="RktVar">html-tag</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:attrs</span><span class="hspace"> </span><span class="RktVar">html-attrs</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:splice</span><span class="hspace"> </span><span class="RktVar">splice-html?</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">xexpr</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=xml&rel=index.html%23%2528def._%2528%2528lib._xml%252Fprivate%252Fxexpr-core..rkt%2529._xexpr%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">xexpr?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">html-tag</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._or%252Fc%2529%2529&version=6.0.1" class="RktValLink Sq" 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="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=txexpr&rel=index.html%23%2528def._%2528%2528lib._txexpr%252Fmain..rkt%2529._txexpr-tag%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">txexpr-tag?</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">html-attrs</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._or%252Fc%2529%2529&version=6.0.1" class="RktValLink Sq" 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="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=txexpr&rel=index.html%23%2528def._%2528%2528lib._txexpr%252Fmain..rkt%2529._txexpr-attrs%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">txexpr-attrs?</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">splice-html?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Convert <span class="RktVar">xexpr</span> to an HTML string. Similar to <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=xml&rel=index.html%23%2528def._%2528%2528lib._xml%252Fmain..rkt%2529._xexpr-%7E3estring%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">xexpr->string</a></span>, but consistent with the HTML spec, text that appears within <span class="RktSym">script</span><span class="RktMeta"></span> or <span class="RktSym">style</span><span class="RktMeta"></span> blocks will not be escaped.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.0.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</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">script</span><span class="hspace"> </span><span class="RktVal">"3 > 2"</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">"Why is 3 > 2?"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=xml&rel=index.html%23%2528def._%2528%2528lib._xml%252Fmain..rkt%2529._xexpr-%7E3estring%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">xexpr->string</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<root><script>3 &gt; 2</script>Why is 3 &gt; 2?</root>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<root><script>3 > 2</script>Why is 3 &gt; 2?</root>"</span></p></td></tr></table></blockquote></td></tr></table></p><p>The optional keyword arguments <span class="RktVar">html-tag</span> and <span class="RktVar">html-attrs</span> let you set the outer tag and attributes for the generated HTML. If <span class="RktVar">xexpr</span> already has an outer tag or attributes, they will be replaced.</p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.0.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</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">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"huff"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">"Bunk beds"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<root id=\"huff\">Bunk beds</root>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktPn">#:tag</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">div</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<div id=\"huff\">Bunk beds</div>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktPn">#:attrs</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"doback"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<root id=\"doback\">Bunk beds</root>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktPn">#:tag</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktPn">#:attrs</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"doback"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<div id=\"doback\">Bunk beds</div>"</span></p></td></tr></table></blockquote></td></tr></table></p><p>Whereas if <span class="RktVar">xexpr</span> has no tag or attributes, they will be added. If you supply attributes without a tag, you’ll get an error.</p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.0.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktVal">"Drum kit"</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"Drum kit"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktPn">#:tag</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">div</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<div>Drum kit</div>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktPn">#:tag</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktPn">#:attrs</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"doback"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<div id=\"doback\">Drum kit</div>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktPn">#:attrs</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"doback"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">->html: can't use attribute list '((id doback)) without a</span></p></td></tr><tr><td><p><span class="RktErr">#:tag argument</span></p></td></tr></table></blockquote></td></tr></table></p><p>If the generated HTML has an outer tag, the <span class="RktVar">splice-html?</span> option will strip it off. Otherwise this option has no effect.</p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.0.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</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">p</span><span class="hspace"> </span><span class="RktVal">"Chicken nuggets"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<root><p>Chicken nuggets</p></root>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktPn">#:splice</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<p>Chicken nuggets</p>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.0.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktVal">"Fancy sauce"</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"Fancy sauce"</span></p></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">This next one won</span><span class="RktCmt">'</span><span class="RktCmt">t do anything</span></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktPn">#:splice</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"Fancy sauce"</span></p></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">Adds the outer tag, but then #:splice removes it</span></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">x</span><span class="hspace"> </span><span class="RktPn">#:tag</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktPn">#:attrs</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"doback"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktPn">#:splice</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"Fancy sauce"</span></p></td></tr></table></blockquote></td></tr></table></p><p>Be careful not to pass existing HTML strings into this function, because the angle brackets will be escaped. Fine if that’s what you want, but you probably don’t.</p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=define.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._define%2529%2529&version=6.0.1" class="RktStxLink Sq" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"You did"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">em</span><span class="hspace"> </span><span class="RktVal">"what?"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<p>You did<em>what?</em></p>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><span class="nobreak">-></span>html</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"&lt;p&gt;You did&lt;em&gt;what?&lt;/em&gt;&lt;/p&gt;"</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/template..rkt)._select))"></a><span title="Provided from: pollen/template | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">select</span></span></span><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span><span class="RktVar">value-source</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._or%252Fc%2529%2529&version=6.0.1" class="RktValLink Sq" 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="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=txexpr&rel=index.html%23%2528def._%2528%2528lib._txexpr%252Fmain..rkt%2529._txexpr-element%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">txexpr-element?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=sugar&rel=Coercion.html%23%2528def._%2528%2528lib._sugar%252Fcoerce%252Fvalue..rkt%2529._symbolish%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">symbolish?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">value-source</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._or%252Fc%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=hashtables.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._hash%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">hash?</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=txexpr&rel=index.html%23%2528def._%2528%2528lib._txexpr%252Fmain..rkt%2529._txexpr%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">txexpr?</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="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=sugar&rel=Coercion.html%23%2528def._%2528%2528lib._sugar%252Fcoerce%252Fvalue..rkt%2529._pathish%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">pathish?</a></span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/template..rkt)._select*))"></a><span title="Provided from: pollen/template | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">select*</span></span></span><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span><span class="RktVar">value-source</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._or%252Fc%2529%2529&version=6.0.1" class="RktValLink Sq" 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://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._listof%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=txexpr&rel=index.html%23%2528def._%2528%2528lib._txexpr%252Fmain..rkt%2529._txexpr-element%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">txexpr-element?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=sugar&rel=Coercion.html%23%2528def._%2528%2528lib._sugar%252Fcoerce%252Fvalue..rkt%2529._symbolish%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">symbolish?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">value-source</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._or%252Fc%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=hashtables.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._hash%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">hash?</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=txexpr&rel=index.html%23%2528def._%2528%2528lib._txexpr%252Fmain..rkt%2529._txexpr%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">txexpr?</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="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=sugar&rel=Coercion.html%23%2528def._%2528%2528lib._sugar%252Fcoerce%252Fvalue..rkt%2529._pathish%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">pathish?</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Find matches for <span class="RktVar">key</span> in <span class="RktVar">value-source</span>, first by looking in its <span class="RktSym">metas</span><span class="RktMeta"></span> (using <span class="RktSym">select-from-metas</span>) and then by looking in its <span class="RktSym">doc</span><span class="RktMeta"></span> (using <span class="RktSym">select-from-doc</span>). With <span class="RktSym">select</span>, you get the first result; with <span class="RktSym">select*</span>, you get them all. In both cases, you get <span class="RktVal">#f</span> if there are no matches.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/template..rkt)._select-from-metas))"></a><span title="Provided from: pollen/template | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">select-from-metas</span></span></span><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span><span class="RktVar">meta-source</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._or%252Fc%2529%2529&version=6.0.1" class="RktValLink Sq" 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="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=txexpr&rel=index.html%23%2528def._%2528%2528lib._txexpr%252Fmain..rkt%2529._txexpr-element%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">txexpr-element?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=sugar&rel=Coercion.html%23%2528def._%2528%2528lib._sugar%252Fcoerce%252Fvalue..rkt%2529._symbolish%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">symbolish?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">meta-source</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._or%252Fc%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=hashtables.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._hash%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">hash?</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="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=sugar&rel=Coercion.html%23%2528def._%2528%2528lib._sugar%252Fcoerce%252Fvalue..rkt%2529._pathish%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">pathish?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Look up the value of <span class="RktVar">key</span> in <span class="RktVar">meta-source</span>. The <span class="RktVar">meta-source</span> argument can be either a set of metas (i.e., a <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=hashtables.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._hash%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">hash</a></span>) or a <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>, from which metas are pulled. If no value exists for <span class="RktVar">key</span>, you get <span class="RktVal">#f</span>.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=module.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._module%2529%2529&version=6.0.1" class="RktStxLink Sq" data-pltdoc="x">module</a></span><span class="hspace"> </span><span class="RktSym">ice-cream</span><span class="hspace"> </span><span class="RktSym">pollen/markup</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">question</span><span class="hspace"> </span><span class="RktVal">"Flavor?"</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">answer</span><span class="hspace"> </span><span class="RktVal">"Chocolate chip"</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">answer</span><span class="hspace"> </span><span class="RktVal">"Maple walnut"</span><span class="RktVal">)</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">meta</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">template</span><span class="hspace"> </span><span class="RktVal">"sub.xml.pt"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">meta</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">target</span><span class="hspace"> </span><span class="RktVal">"print"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">Import doc & metas from </span><span class="RktCmt">'</span><span class="RktCmt">ice-cream submodule</span></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.0.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">ice-cream</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">select-from-metas</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">template</span><span class="hspace"> </span><span class="RktSym">metas</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"sub.xml.pt"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktVal">'</span><span class="RktVal">target</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym">select-from-metas</span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym">metas</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"print"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">select-from-metas</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">nonexistent-key</span><span class="hspace"> </span><span class="RktSym">metas</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._pollen/template..rkt)._select-from-doc))"></a><span title="Provided from: pollen/template | Package: pollen"><span class="RktSym"><span class="RktSymDef RktSym">select-from-doc</span></span></span><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span><span class="RktVar">doc-source</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._or%252Fc%2529%2529&version=6.0.1" class="RktValLink Sq" 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="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=txexpr&rel=index.html%23%2528def._%2528%2528lib._txexpr%252Fmain..rkt%2529._txexpr-element%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">txexpr-element?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=sugar&rel=Coercion.html%23%2528def._%2528%2528lib._sugar%252Fcoerce%252Fvalue..rkt%2529._symbolish%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">symbolish?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">doc-source</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._or%252Fc%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=txexpr&rel=index.html%23%2528def._%2528%2528lib._txexpr%252Fmain..rkt%2529._txexpr%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">txexpr?</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="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=sugar&rel=Coercion.html%23%2528def._%2528%2528lib._sugar%252Fcoerce%252Fvalue..rkt%2529._pathish%7E3f%2529%2529&version=6.0.1" class="RktValLink Sq" data-pltdoc="x">pathish?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Look up the value of <span class="RktVar">key</span> in <span class="RktVar">doc-source</span>. The <span class="RktVar">doc-source</span> argument can be either be a <span class="RktSym">doc</span><span class="RktMeta"></span> (i.e., a <span class="RktSym">txexpr</span>) or a <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>, from which doc is pulled. If no value exists for <span class="RktVar">key</span>, you get <span class="RktVal">#f</span>.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=module.html%23%2528form._%2528%2528quote._%7E23%7E25kernel%2529._module%2529%2529&version=6.0.1" class="RktStxLink Sq" data-pltdoc="x">module</a></span><span class="hspace"> </span><span class="RktSym">gelato</span><span class="hspace"> </span><span class="RktSym">pollen/markup</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">question</span><span class="hspace"> </span><span class="RktVal">"Flavor?"</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">answer</span><span class="hspace"> </span><span class="RktVal">"Nocciola"</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">answer</span><span class="hspace"> </span><span class="RktVal">"Pistachio"</span><span class="RktVal">)</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">meta</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">template</span><span class="hspace"> </span><span class="RktVal">"sub.xml.pt"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">meta</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">target</span><span class="hspace"> </span><span class="RktVal">"print"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">Import doc & metas from </span><span class="RktCmt">'</span><span class="RktCmt">gelato submodule</span></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.0.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.0.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">gelato</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">select-from-doc</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">question</span><span class="hspace"> </span><span class="RktSym">doc</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("Flavor?")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktVal">'</span><span class="RktVal">answer</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym">select-from-doc</span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym">doc</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("Nocciola" "Pistachio")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym">select-from-doc</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">nonexistent-key</span><span class="hspace"> </span><span class="RktSym">doc</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr></table></blockquote></td></tr></table></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.0.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.0.1");">top</a></span><span class="navright"> <a href="Render.html" title="backward to "9.5 Render"" data-pltdoc="x">← prev</a> <a href="Module_reference.html" title="up to "9 Module reference"" data-pltdoc="x">up</a> <a href="Tag.html" title="forward to "9.7 Tag"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html> |