/usr/share/doc/racket/scriblib/render-cond.html is in racket-doc 6.1-4.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>6 Conditional Content</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">Scriblib:<span class="mywbr"> </span> Extra Scribble Libraries</a></td></tr></table></div><div class="tocviewsublistonly" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="gui-eval.html" class="tocviewlink" data-pltdoc="x">Examples Using the GUI Toolbox</a></td></tr><tr><td align="right">2 </td><td><a href="figure.html" class="tocviewlink" data-pltdoc="x">Figures</a></td></tr><tr><td align="right">3 </td><td><a href="autobib.html" class="tocviewlink" data-pltdoc="x">Bibliographies</a></td></tr><tr><td align="right">4 </td><td><a href="bibtex.html" class="tocviewlink" data-pltdoc="x">Bib<span class="mywbr"> </span>Te<span class="mywbr"> </span>X Bibliographies</a></td></tr><tr><td align="right">5 </td><td><a href="footnotes.html" class="tocviewlink" data-pltdoc="x">Footnotes</a></td></tr><tr><td align="right">6 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Conditional Content</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="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-element%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">cond-<wbr></wbr>element</span></span></a></td></tr><tr><td><a href="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-block%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktStxLink">cond-<wbr></wbr>block</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.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.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.1");">top</a></span><span class="navright"> <a href="footnotes.html" title="backward to "5 Footnotes"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Scriblib: Extra Scribble Libraries"" data-pltdoc="x">up</a> <span class="nonavigation">next →</span></span> </div><h3 x-source-module="(lib "scriblib/scribblings/scriblib.scrbl")" x-part-tag=""render-cond"">6<tt> </tt><a name="(part._render-cond)"></a><a name="(mod-path._scriblib/render-cond)"></a>Conditional Content</h3><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://download.racket-lang.org/docs/6.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.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">scriblib/render-cond</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">scribble-lib</span></span></td></tr></table></p><p>As much as possible, Scribble documents should be independent of the
target format for rendering the document. To customize generated
output, use styes plus “back end” configurations for each target
format (see <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble&rel=config.html&version=6.1" class="Sq" data-pltdoc="x">Extending and Configuring Scribble Output</a> in
<a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble&rel=index.html&version=6.1" class="Sq" data-pltdoc="x">Scribble: The Racket Documentation Tool</a>).</p><p>As a last resort, the <span class="RktSym"><a href="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-element%29%29" class="RktStxLink" data-pltdoc="x">cond-element</a></span> and <span class="RktSym"><a href="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-block%29%29" class="RktStxLink" data-pltdoc="x">cond-block</a></span>
forms support varying the document content depending on the target
format. More precisely, they generate parts of a document where
content is delayed until the <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble&rel=core.html%23%2528tech._traverse._pas%2529&version=6.1" class="techoutside Sq" data-pltdoc="x"><span class="techinside">traverse pass</span></a>
of document rendering. Format detection relies on the
<span class="RktVal">'</span><span class="RktVal">scribble:current-render-mode</span> registration that is accessible
through a <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble&rel=core.html%23%2528def._%2528%2528lib._scribble%252Fcore..rkt%2529._traverse-element%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">traverse-element</a></span> or <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble&rel=core.html%23%2528def._%2528%2528lib._scribble%252Fcore..rkt%2529._traverse-block%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">traverse-block</a></span>.</p><p>The syntax of <span class="RktSym"><a href="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-element%29%29" class="RktStxLink" data-pltdoc="x">cond-element</a></span> and <span class="RktSym"><a href="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-block%29%29" class="RktStxLink" data-pltdoc="x">cond-block</a></span> is based
on SRFI-0.</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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._scriblib/render-cond..rkt)._cond-element))"></a><span title="Provided from: scriblib/render-cond | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-element%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">cond-element</a></span></span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">feature-requirement</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">]</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-element%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">cond-element</a></span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">feature-requirement</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=if.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._else%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">else</a></span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt"> </span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="specgrammar"><tr><td align="right" valign="baseline"><span class="RktVar">feature-requirement</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktVar">identifier</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._not%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">not</a></span><span class="hspace"> </span><span class="RktVar">feature-requirement</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=if.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._and%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">and</a></span><span class="hspace"> </span><span class="RktVar">feature-requirement</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=if.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._or%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktVar">feature-requirement</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Generates a <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble&rel=core.html%23%2528def._%2528%2528lib._scribble%252Fcore..rkt%2529._traverse-element%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">traverse-element</a></span> whose replacement content is
produced by the <span class="RktVar">body</span> of one of the first matching
<span class="RktSym"><a href="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-element%29%29" class="RktStxLink" data-pltdoc="x">cond-element</a></span> clause.</div></p><p>A <span class="RktVar">feature-requirement</span> can be any identifier; a useful
identifier is one whose symbol form can appear in a
<span class="RktVal">'</span><span class="RktVal">scribble:current-render-mode</span> list. The identifier matches
when its symbol form is in the <span class="RktVal">'</span><span class="RktVal">scribble:current-render-mode</span>
list. Typically, the identifier is <span class="RktSym">html</span>, <span class="RktSym">latex</span>, or
<span class="RktSym">text</span> to indicate the corresponding rendering target.</p><p>A <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._not%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">not</a></span><span class="stt"> </span><span class="RktVar">feature-requirement</span><span class="RktPn">)</span> test matches when
<span class="RktVar">feature-requirement</span> does not match, and so on. An
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=if.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._else%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">else</a></span> clause always matches. If no <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=if.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fletstx-scheme..rkt%2529._else%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">else</a></span> clause is
present and no clause matches, then the <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=exns.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._exn%7E3afail%7E3acontract%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">exn:fail:contract</a></span>
exception is raised. Similarly, if the result of the selected
<span class="RktVar">body</span> is not content according to <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble&rel=core.html%23%2528def._%2528%2528lib._scribble%252Fcore..rkt%2529._content%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">content?</a></span>, then the
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=exns.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._exn%7E3afail%7E3acontract%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">exn:fail:contract</a></span> exception is raised.</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>syntax</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(form._((lib._scriblib/render-cond..rkt)._cond-block))"></a><span title="Provided from: scriblib/render-cond | Package: scribble-lib"><span class="RktSym"><a href="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-block%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">cond-block</a></span></span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">feature-requirement</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">]</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-block%29%29" class="RktStxDef RktStxLink" data-pltdoc="x">cond-block</a></span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">feature-requirement</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">]</span><span class="hspace"> </span><span class="RktPn">[</span><span class="RktVar">else</span><span class="hspace"> </span><span class="RktVar">body</span><span class="hspace"> </span><span class="RktMeta">...+</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28form._%28%28lib._scriblib%2Frender-cond..rkt%29._cond-element%29%29" class="RktStxLink" data-pltdoc="x">cond-element</a></span>, but generates a <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble&rel=core.html%23%2528def._%2528%2528lib._scribble%252Fcore..rkt%2529._traverse-block%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">traverse-block</a></span>
where the selected <span class="RktVar">body</span> must produce a block according to
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=scribble&rel=core.html%23%2528def._%2528%2528lib._scribble%252Fcore..rkt%2529._block%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">block?</a></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.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.1");">top</a></span><span class="navright"> <a href="footnotes.html" title="backward to "5 Footnotes"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Scriblib: Extra Scribble Libraries"" data-pltdoc="x">up</a> <span class="nonavigation">next →</span></span> </div></div></div><div id="contextindicator"> </div></body></html>
|