/usr/share/doc/racket/scribble-pp/html-resources.html is in racket-doc 6.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | <!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>2.3 HTML Resources</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="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../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">Scribble as Preprocessor</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="text.html" class="tocviewlink" data-pltdoc="x">Text Generation</a></td></tr><tr><td align="right">2 </td><td><a href="html.html" class="tocviewselflink" data-pltdoc="x">HTML Generation</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>2 </td><td><a href="html.html" class="tocviewlink" data-pltdoc="x">HTML Generation</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">2.1 </td><td><a href="html-html.html" class="tocviewlink" data-pltdoc="x">Generating HTML Strings</a></td></tr><tr><td align="right">2.2 </td><td><a href="html-xml.html" class="tocviewlink" data-pltdoc="x">Generating XML Strings</a></td></tr><tr><td align="right">2.3 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">HTML Resources</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._scribble%2Fhtml%2Fresource..rkt%29._resource%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">resource</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._url-roots%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">url-<wbr></wbr>roots</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource~3f%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">resource?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._render-all%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">render-<wbr></wbr>all</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._file-writer%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">file-<wbr></wbr>writer</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><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.7", "../");" 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.7");">top</a></span><span class="navright"> <a href="html-xml.html" title="backward to "2.2 Generating XML Strings"" data-pltdoc="x">← prev</a> <a href="html.html" title="up to "2 HTML Generation"" data-pltdoc="x">up</a> <a href="doc-index.html" title="forward to "Index"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/scribble/scribble-pp.scrbl")" x-source-pkg="scribble-doc" x-part-tag=""html-resources"">2.3<tt> </tt><a name="(part._html-resources)"></a><a name="(mod-path._scribble/html/resource)"></a>HTML Resources</h4><p><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left" colspan="2"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">scribble/html/resource</span></a><span class="RktPn">)</span></td></tr><tr><td align="left"> </td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">scribble-html-lib</span></span></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._scribble/html/resource..rkt)._resource))"></a><span title="Provided from: scribble/html/resource | Package: scribble-html-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource%29%29" class="RktValDef RktValLink" data-pltdoc="x">resource</a></span></span><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span><span class="RktVar">renderer</span><span class="hspace"> </span>[<span class="RktPn">#:exists</span><span class="hspace"> </span><span class="RktVar">exists</span>]<span class="RktPn">)</span></p></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._and%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">and/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource~3f%29%29" class="RktValLink" data-pltdoc="x">resource?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%252A%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span>*</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="text.html#%28def._%28%28lib._scribble%2Ftext..rkt%29._outputable%2Fc%29%29" class="RktValLink" data-pltdoc="x">outputable/c</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">renderer</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">exists</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">delete-file</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">delete-file</span></td></tr></table></blockquote></div><div class="SIntrapara">Creates and returns a new <a name="(tech._resource)"></a><span style="font-style: italic">resource</span> value. Creating a
resource registers <span class="RktVar">renderer</span> (if non-<span class="RktVal">#f</span>) to be called when rendering is
initiated by <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._render-all%29%29" class="RktValLink" data-pltdoc="x">render-all</a></span>, while calling the result resource as
a function generates a URL for the resource.</div></p><p>For example, a typical use of <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource%29%29" class="RktValLink" data-pltdoc="x">resource</a></span> is to register the
generation of a CSS file, where the value produced by
<span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource%29%29" class="RktValLink" data-pltdoc="x">resource</a></span> itself renders as the URL for the generated CSS
file. Another possible use of <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource%29%29" class="RktValLink" data-pltdoc="x">resource</a></span> is to generate an HTML
file, where the <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource%29%29" class="RktValLink" data-pltdoc="x">resource</a></span> result renders as the URL of the
generated HTML page.</p><p>The <span class="RktVar">path</span> argument specifies the path of the output file,
relative to the working directory, indicating where the resource file
should be placed. Though <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._url-roots%29%29" class="RktValLink" data-pltdoc="x">url-roots</a></span>, <span class="RktVar">path</span> also
determines the ultimate URL. The <span class="RktVar">path</span> string must be a
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">/</span><span class="hspace"></span></span>-separated relative path with no <span class="RktInBG"><span class="hspace"></span><span class="RktIn">..</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">.</span><span class="hspace"></span></span>,
or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">//</span><span class="hspace"></span></span>. The <span class="RktVar">path</span> string can end in <span class="RktInBG"><span class="hspace"></span><span class="RktIn">/</span><span class="hspace"></span></span>, in
which case <span class="RktVal">"index.html"</span> is effectively added to the string.
Using <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource%29%29" class="RktValLink" data-pltdoc="x">resource</a></span> with <span class="RktVal">#f</span> as <span class="RktVar">renderer</span> is
useful for converting a path to a URL according to <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._url-roots%29%29" class="RktValLink" data-pltdoc="x">url-roots</a></span>.</p><p>The <span class="RktVar">renderer</span> argument (when non-<span class="RktVal">#f</span>) renders the resource, receiving the
path for the file to be created. The path provided to
<span class="RktVar">renderer</span> will be different from <span class="RktVar">path</span>, because the
function is invoked in the target directory.</p><p>The resulting resource value is a function that returns the URL for
the resource. The function accepts an optional boolean; if a true
value is provided, the result is an absolute URL, instead of relative.
Note that the function can be used as a value for <span class="RktSym"><a href="text.html#%28def._%28%28lib._scribble%2Ftext..rkt%29._output%29%29" class="RktValLink" data-pltdoc="x">output</a></span>,
which uses the resource value as a thunk (that renders as the relative
URL for the resource). The default relative resulting URL is, of
course, a value that depends on the currently rendered resource that
uses this value.</p><p>When <span class="RktVar">renderer</span> is called by <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._render-all%29%29" class="RktValLink" data-pltdoc="x">render-all</a></span>, more
resources can be created while rendering; the newly created resources
will also be rendered, in turn, until no more new resources are
created.</p><p>If <span class="RktVar">exists</span> is <span class="RktVal">'</span><span class="RktVal">delete-file</span> and the target file exists
when <span class="RktVar">renderer</span> is to be called, then the file is deleted
before <span class="RktVar">renderer</span> is called.</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>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._scribble/html/resource..rkt)._url-roots))"></a><span title="Provided from: scribble/html/resource | Package: scribble-html-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._url-roots%29%29" class="RktValDef RktValLink" data-pltdoc="x">url-roots</a></span></span><span class="RktPn"></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._listof%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._cons%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._cons%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._listof%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">abs</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">index</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: scribble/html/resource | Package: scribble-html-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._url-roots%29%29" class="RktValDef RktValLink" data-pltdoc="x">url-roots</a></span></span><span class="hspace"> </span><span class="RktVar">roots</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">void?</a></span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">roots</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">:</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._listof%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._cons%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._cons%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._listof%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">abs</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">index</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">A parameter that determines how resource paths are converted to URLs
for reference. A <span class="RktVal">#f</span> value is equivalent to an empty list.</div></p><p>The parameter value is a mapping from path prefixes to URLs (actually,
any string). When two paths have the same prefix, links from one to
the other are relative (unless absolute links are requested); if they
have different prefixes, the full URL is used. The paths enclosed by
two root paths must be disjoint (e.g., the list must not include
both <span class="RktVal">"/colors"</span> and <span class="RktVal">"/colors/red"</span>, but it can include
both <span class="RktVal">"/colors/red"</span> and <span class="RktVal">"/colors/blue"</span>).</p><p>If an item in the parameter’s list includes <span class="RktVal">'</span><span class="RktVal">abs</span>, then a
site-local, absolute URL (i.e., a URL that starts with <span class="RktInBG"><span class="hspace"></span><span class="RktIn">/</span><span class="hspace"></span></span>) is
produced for references among files within the corresponding prefix.</p><p>If an item in the parameter’s list includes <span class="RktVal">'</span><span class="RktVal">index</span>, then a
reference to a directory path is converted to a reference to
<span class="stt">"index.html"</span>, otherwise a reference to <span class="stt">"index.html"</span>
is converted to a directory path.</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._scribble/html/resource..rkt)._resource~3f))"></a><span title="Provided from: scribble/html/resource | Package: scribble-html-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">resource?</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="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&version=6.7" class="RktValLink Sq" 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="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">v</span> is a procedure (that takes 0 or 1
arguments) produced by <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource%29%29" class="RktValLink" data-pltdoc="x">resource</a></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._scribble/html/resource..rkt)._render-all))"></a><span title="Provided from: scribble/html/resource | Package: scribble-html-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._render-all%29%29" class="RktValDef RktValLink" data-pltdoc="x">render-all</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">void?</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Generates all resources registered via <span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource%29%29" class="RktValLink" data-pltdoc="x">resource</a></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._scribble/html/resource..rkt)._file-writer))"></a><span title="Provided from: scribble/html/resource | Package: scribble-html-lib"><span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._file-writer%29%29" class="RktValDef RktValLink" data-pltdoc="x">file-writer</a></span></span><span class="hspace"> </span><span class="RktVar">content-writer</span><span class="hspace"> </span><span class="RktVar">content</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">content-writer</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="text.html#%28def._%28%28lib._scribble%2Ftext..rkt%29._outputable%2Fc%29%29" class="RktValLink" data-pltdoc="x">outputable/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=port-ops.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._output-port%7E3f%2529%2529&version=6.7" class="RktValLink Sq" data-pltdoc="x">output-port?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%2529%2529&version=6.7" class="RktStxLink Sq" data-pltdoc="x">any</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">content</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="text.html#%28def._%28%28lib._scribble%2Ftext..rkt%29._outputable%2Fc%29%29" class="RktValLink" data-pltdoc="x">outputable/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a function that is useful as a <span class="RktVar">writer</span> argument to
<span class="RktSym"><a href="#%28def._%28%28lib._scribble%2Fhtml%2Fresource..rkt%29._resource%29%29" class="RktValLink" data-pltdoc="x">resource</a></span>. Given a path, the produced function writes
<span class="RktVar">content</span> to the path by passing <span class="RktVar">content</span> and an output
port for the file to <span class="RktVar">content-writer</span>.</div></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.7", "../");" 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.7");">top</a></span><span class="navright"> <a href="html-xml.html" title="backward to "2.2 Generating XML Strings"" data-pltdoc="x">← prev</a> <a href="html.html" title="up to "2 HTML Generation"" data-pltdoc="x">up</a> <a href="doc-index.html" title="forward to "Index"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|