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
27 KiB
HTML
2 lines
27 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>6 File formats</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="racket.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.css" title="default"/><script type="text/javascript" src="scribble-common.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="scribble-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Pollen:<span class="mywbr"> </span> the book is a program</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" 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="The_big_picture.html" class="tocviewlink" data-pltdoc="x">The big picture</a></td></tr><tr><td align="right">5 </td><td><a href="Using_raco_pollen.html" class="tocviewlink" data-pltdoc="x">Using <span class="stt">raco pollen</span></a></td></tr><tr><td align="right">6 </td><td><a href="File_formats.html" class="tocviewselflink" data-pltdoc="x">File formats</a></td></tr><tr><td align="right">7 </td><td><a href="reader.html" class="tocviewlink" data-pltdoc="x">◊ command overview</a></td></tr><tr><td align="right">8 </td><td><a href="Module_reference.html" class="tocviewlink" data-pltdoc="x">Module reference</a></td></tr><tr><td align="right">9 </td><td><a href="Acknowledgments.html" class="tocviewlink" data-pltdoc="x">Acknowledgments</a></td></tr><tr><td align="right">10 </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>6 </td><td><a href="File_formats.html" class="tocviewselflink" data-pltdoc="x">File formats</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">6.1 </td><td><a href="File_formats.html#%28part._.Source_formats%29" class="tocviewlink" data-pltdoc="x">Source formats</a></td></tr><tr><td align="right">6.2 </td><td><a href="File_formats.html#%28part._.Utility_formats%29" class="tocviewlink" data-pltdoc="x">Utility formats</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">6.1<tt> </tt></span><a href="#%28part._.Source_formats%29" class="tocsubseclink" data-pltdoc="x">Source formats</a></td></tr><tr><td><span class="tocsublinknumber">6.1.1<tt> </tt></span><a href="#%28part._.Command_syntax_using__%29" class="tocsubseclink" data-pltdoc="x">Command syntax using ◊</a></td></tr><tr><td><span class="tocsublinknumber">6.1.2<tt> </tt></span><a href="#%28part._.Any_command_is_valid%29" class="tocsubseclink" data-pltdoc="x">Any command is valid</a></td></tr><tr><td><span class="tocsublinknumber">6.1.3<tt> </tt></span><a href="#%28part._.Standard_exports%29" class="tocsubseclink" data-pltdoc="x">Standard exports</a></td></tr><tr><td><span class="tocsublinknumber">6.1.4<tt> </tt></span><a href="#%28part._.Custom_exports%29" class="tocsubseclink" data-pltdoc="x">Custom exports</a></td></tr><tr><td><span class="tocsublinknumber">6.1.5<tt> </tt></span><a href="#%28part._.The_project-require_rkt_file%29" class="tocsubseclink" data-pltdoc="x">The <span class="RktSym">project-<wbr></wbr>require.rkt</span><span class="RktMeta"></span> file</a></td></tr><tr><td><span class="tocsublinknumber">6.1.6<tt> </tt></span><a href="#%28part._.Preprocessor___pp_extension_%29" class="tocsubseclink" data-pltdoc="x">Preprocessor (.pp extension)</a></td></tr><tr><td><span class="tocsublinknumber">6.1.7<tt> </tt></span><a href="#%28part._.Markdown___pmd_extension_%29" class="tocsubseclink" data-pltdoc="x">Markdown (.pmd extension)</a></td></tr><tr><td><span class="tocsublinknumber">6.1.8<tt> </tt></span><a href="#%28part._.Markup___pm_extension_%29" class="tocsubseclink" data-pltdoc="x">Markup (.pm extension)</a></td></tr><tr><td><span class="tocsublinknumber">6.1.9<tt> </tt></span><a href="#%28part._.Pagetree____ptree_extension_%29" class="tocsubseclink" data-pltdoc="x">Pagetree (.ptree extension)</a></td></tr><tr><td><span class="tocsublinknumber">6.2<tt> </tt></span><a href="#%28part._.Utility_formats%29" class="tocsubseclink" data-pltdoc="x">Utility formats</a></td></tr><tr><td><span class="tocsublinknumber">6.2.1<tt> </tt></span><a href="#%28part._.Scribble____scrbl_extension_%29" class="tocsubseclink" data-pltdoc="x">Scribble (.scrbl extension)</a></td></tr><tr><td><span class="tocsublinknumber">6.2.2<tt> </tt></span><a href="#%28part._.Null___p_extension_%29" class="tocsubseclink" data-pltdoc="x">Null (.p extension)</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.0.1.6</span></div><div class="navsettop"><span class="navleft"> </span><span class="navright"> <a href="Using_raco_pollen.html" title="backward to "5 Using raco pollen"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Pollen: the book is a program"" data-pltdoc="x">up</a> <a href="reader.html" title="forward to "7 ◊ command overview"" data-pltdoc="x">next →</a></span> </div><h3>6<tt> </tt><a name="(part._.File_formats)"></a>File formats</h3><h4>6.1<tt> </tt><a name="(part._.Source_formats)"></a><a name="(mod-path._pollen/pre)"></a><a name="(mod-path._pollen/markdown)"></a><a name="(mod-path._pollen/markup)"></a><a name="(mod-path._pollen/ptree)"></a>Source formats</h4><p><table cellspacing="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="File_formats.html#%28mod-path._pollen%2Fpre%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/pre</span></a></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">pollen</span></span></td></tr><tr><td align="left" colspan="2"><span class="hspace"> </span><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="File_formats.html#%28mod-path._pollen%2Fmarkdown%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/markdown</span></a></td></tr><tr><td align="left" colspan="2"><span class="hspace"> </span><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="File_formats.html#%28mod-path._pollen%2Fmarkup%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/markup</span></a></td></tr><tr><td align="left" colspan="2"><span class="hspace"> </span><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="File_formats.html#%28mod-path._pollen%2Fptree%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/ptree</span></a></td></tr></table></p><p>The Pollen language is divided into variants, or <span style="font-style: italic">dialects</span>, that are tailored to suit each of the core source formats.</p><p>These dialects can be invoked one of two ways: either by invoking a specific dialect in the first line of the file (also known as the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#lang</span><span class="hspace"></span></span> line), or by using the generic <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#lang pollen</span><span class="hspace"></span></span> as the first line, and then the correct dialect will be automatically selected based on the source file extension.</p><p>If the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#lang</span><span class="hspace"></span></span> line specifies a dialect different from the one specified by the file extension, the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#lang</span><span class="hspace"></span></span> line will take precedence.</p><p>For ease of use, the behavior of the Pollen language departs from the standard Racket language in several ways. The differences are noted below.</p><h5>6.1.1<tt> </tt><a name="(part._.Command_syntax_using__)"></a>Command syntax using ◊</h5><p>Commands must start with the special lozenge character <span class="RktInBG"><span class="hspace"></span><span class="RktIn">◊</span><span class="hspace"></span></span>. Other material is interpreted as plain text. See <a href="reader.html" data-pltdoc="x">◊ command overview</a> for more.</p><p><span style="font-weight: bold">How is this different from Racket?</span> In Racket, everything is a command, and plain text must be quoted.</p><h5>6.1.2<tt> </tt><a name="(part._.Any_command_is_valid)"></a>Any command is valid</h5><p>There are no undefined commands in Pollen. If a command has not already been defined, it’s treated as a tag function. See <a href="reader.html" data-pltdoc="x">◊ command overview</a> for more.</p><p><span style="font-weight: bold">How is this different from Racket?</span> In Racket, if you try to treat an identifier as a function before defining it with <span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span>, you’ll get an error.</p><h5>6.1.3<tt> </tt><a name="(part._.Standard_exports)"></a>Standard exports</h5><p>By default, every Pollen source file exports two symbols, which you can access by using the source file with <span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span>:</p><p><span class="RktVal">'</span><span class="RktVal">doc</span> contains the output of the file. The type of output depends on the source format (documented below).</p><p><span class="RktVal">'</span><span class="RktVal">metas</span> is a hash of key–value pairs with extra information that is extracted from the source. These <span class="RktVal">'</span><span class="RktVal">metas</span> will always contain the key <span class="RktVal">'</span><span class="RktVal">here-path</span>, which returns a string representation of the full path to the source file. Beyond that, the only <span class="RktVal">'</span><span class="RktVal">metas</span> are the ones that are specified within the source file (see the source formats below for more detail on how to specify metas).</p><p><span style="font-weight: bold">How is this different from Racket?</span> In Racket, you must explicitly <span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span> and then <span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._provide%29%29" class="RktStxLink" data-pltdoc="x">provide</a></span> any values you want to export.</p><h5>6.1.4<tt> </tt><a name="(part._.Custom_exports)"></a>Custom exports</h5><p>Any value or function that is defined within the source file using <span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span> is automatically exported.</p><p><span style="font-weight: bold">How is this different from Racket?</span> In Racket, you must explicitly <span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._provide%29%29" class="RktStxLink" data-pltdoc="x">provide</a></span> any values you want to export. Unlike Racket, every Pollen source file impliedly uses <span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._provide%29%29" class="RktStxLink" data-pltdoc="x">provide</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._all-defined-out%29%29" class="RktStxLink" data-pltdoc="x">all-defined-out</a></span><span class="RktPn">)</span><span class="RktPn">)</span>.</p><h5>6.1.5<tt> </tt><a name="(part._.The_project-require_rkt_file)"></a>The <span class="RktSym">project-require.rkt</span><span class="RktMeta"></span> file</h5><p>If a file called <span class="RktSym">project-require.rkt</span><span class="RktMeta"></span> exists in the same directory with a source file, it’s automatically imported when the source file is compiled.</p><p><span style="font-weight: bold">How is this different from Racket?</span> In Racket, you must explicitly import files using <span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span>.</p><h5>6.1.6<tt> </tt><a name="(part._.Preprocessor___pp_extension_)"></a>Preprocessor (.pp extension)</h5><p>Invoke the preprocessor dialect by using <span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="File_formats.html#%28mod-path._pollen%2Fpre%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/pre</span></a><span class="RktMeta"></span> as the first line of your source file, or by using <span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a><span class="RktMeta"></span> with a file extension of <span class="RktSym">.pp</span><span class="RktMeta"></span>. These forms are equivalent:</p><blockquote class="SCodeFlow"><blockquote class="Rfilebox"><p class="Rfiletitle"><span class="Rfilename"><span class="stt">"sample.css.pp"</span></span></p><blockquote class="Rfilecontent"><table cellspacing="0" class="RktBlk"><tr><td><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a></td></tr><tr><td><span class="RktVar">...source...</span></td></tr></table></blockquote></blockquote></blockquote><blockquote class="SCodeFlow"><blockquote class="Rfilebox"><p class="Rfiletitle"><span class="Rfilename"><span class="stt">"sample.css"</span></span></p><blockquote class="Rfilecontent"><table cellspacing="0" class="RktBlk"><tr><td><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="File_formats.html#%28mod-path._pollen%2Fpre%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/pre</span></a></td></tr><tr><td><span class="RktVar">...source...</span></td></tr></table></blockquote></blockquote></blockquote><p>When no dialect is explicitly specified by either the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#lang</span><span class="hspace"></span></span> line or the file extension, Pollen will default to using the preprocessor dialect. For instance, this file will be treated as preprocessor source:</p><blockquote class="SCodeFlow"><blockquote class="Rfilebox"><p class="Rfiletitle"><span class="Rfilename"><span class="stt">"test.yyz"</span></span></p><blockquote class="Rfilecontent"><table cellspacing="0" class="RktBlk"><tr><td><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a></td></tr><tr><td><span class="RktVar">...source...</span></td></tr></table></blockquote></blockquote></blockquote><p>Of course, you’re better off specifying the preprocessor dialect explicitly rather than relying on this default behavior.</p><p>The output of the preprocessor dialect, provided by <span class="RktVal">'</span><span class="RktVal">doc</span>, is plain text.</p><h5>6.1.7<tt> </tt><a name="(part._.Markdown___pmd_extension_)"></a>Markdown (.pmd extension)</h5><p>Invoke the Markdown dialect by using <span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="File_formats.html#%28mod-path._pollen%2Fmarkdown%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/markdown</span></a><span class="RktMeta"></span> as the first line of your source file, or by using <span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a><span class="RktMeta"></span> with a file extension of <span class="RktSym">.pmd</span><span class="RktMeta"></span>. These forms are equivalent:</p><blockquote class="SCodeFlow"><blockquote class="Rfilebox"><p class="Rfiletitle"><span class="Rfilename"><span class="stt">"sample.txt.pmd"</span></span></p><blockquote class="Rfilecontent"><table cellspacing="0" class="RktBlk"><tr><td><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a></td></tr><tr><td><span class="RktVar">...source...</span></td></tr></table></blockquote></blockquote></blockquote><blockquote class="SCodeFlow"><blockquote class="Rfilebox"><p class="Rfiletitle"><span class="Rfilename"><span class="stt">"sample.txt"</span></span></p><blockquote class="Rfilecontent"><table cellspacing="0" class="RktBlk"><tr><td><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="File_formats.html#%28mod-path._pollen%2Fmarkdown%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/markdown</span></a></td></tr><tr><td><span class="RktVar">...source...</span></td></tr></table></blockquote></blockquote></blockquote><p>The output of the Markdown dialect, provided by <span class="RktVal">'</span><span class="RktVal">doc</span>, is a tagged X-expression.</p><h5>6.1.8<tt> </tt><a name="(part._.Markup___pm_extension_)"></a>Markup (.pm extension)</h5><p>Invoke the Pollen markup dialect by using <span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="File_formats.html#%28mod-path._pollen%2Fmarkup%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/markup</span></a><span class="RktMeta"></span> as the first line of your source file, or by using <span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a><span class="RktMeta"></span> with a file extension of <span class="RktSym">.pm</span><span class="RktMeta"></span>. These forms are equivalent:</p><blockquote class="SCodeFlow"><blockquote class="Rfilebox"><p class="Rfiletitle"><span class="Rfilename"><span class="stt">"about.html.pm"</span></span></p><blockquote class="Rfilecontent"><table cellspacing="0" class="RktBlk"><tr><td><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a></td></tr><tr><td><span class="RktVar">...source...</span></td></tr></table></blockquote></blockquote></blockquote><blockquote class="SCodeFlow"><blockquote class="Rfilebox"><p class="Rfiletitle"><span class="Rfilename"><span class="stt">"about.html"</span></span></p><blockquote class="Rfilecontent"><table cellspacing="0" class="RktBlk"><tr><td><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="File_formats.html#%28mod-path._pollen%2Fmarkup%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/markup</span></a></td></tr><tr><td><span class="RktVar">...source...</span></td></tr></table></blockquote></blockquote></blockquote><p>The output of the Pollen markup dialect, provided by <span class="RktVal">'</span><span class="RktVal">doc</span>, is a tagged X-expression.</p><h5>6.1.9<tt> </tt><a name="(part._.Pagetree____ptree_extension_)"></a>Pagetree (.ptree extension)</h5><p>Invoke the pagetree dialect by using <span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="File_formats.html#%28mod-path._pollen%2Fptree%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/ptree</span></a><span class="RktMeta"></span> as the first line of your source file, or by using <span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a><span class="RktMeta"></span> with a file extension of <span class="RktSym">.ptree</span><span class="RktMeta"></span>. These forms are equivalent:</p><blockquote class="SCodeFlow"><blockquote class="Rfilebox"><p class="Rfiletitle"><span class="Rfilename"><span class="stt">"main.ptree"</span></span></p><blockquote class="Rfilecontent"><table cellspacing="0" class="RktBlk"><tr><td><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a></td></tr><tr><td><span class="RktVar">...source...</span></td></tr></table></blockquote></blockquote></blockquote><blockquote class="SCodeFlow"><blockquote class="Rfilebox"><p class="Rfiletitle"><span class="Rfilename"><span class="stt">"main.rkt"</span></span></p><blockquote class="Rfilecontent"><table cellspacing="0" class="RktBlk"><tr><td><a href="http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._hash-lang%29" class="RktModLink" data-pltdoc="x"><span class="RktMod">#lang</span></a><span class="hspace"> </span><a href="File_formats.html#%28mod-path._pollen%2Fptree%29" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen/ptree</span></a></td></tr><tr><td><span class="RktVar">...source...</span></td></tr></table></blockquote></blockquote></blockquote><p>The output of the pagetree dialect, provided by <span class="RktVal">'</span><span class="RktVal">doc</span>, is a <span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._pagetree~3f%29%29" class="RktValLink" data-pltdoc="x">pagetree?</a></span> that is checked for correctness using <span class="RktSym"><a href="Pagetree.html#%28def._%28%28lib._pollen%2Fpagetree..rkt%29._validate-pagetree%29%29" class="RktValLink" data-pltdoc="x">validate-pagetree</a></span>.</p><h4>6.2<tt> </tt><a name="(part._.Utility_formats)"></a>Utility formats</h4><p>These aren’t source formats because they don’t contain a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#lang pollen</span><span class="hspace"></span></span> line. But for convenience, they get special handling by the Pollen project server.</p><h5>6.2.1<tt> </tt><a name="(part._.Scribble____scrbl_extension_)"></a>Scribble (.scrbl extension)</h5><p>Scribble files are recognized by the project server and can be compiled and previewed in single-page mode.</p><h5>6.2.2<tt> </tt><a name="(part._.Null___p_extension_)"></a>Null (.p extension)</h5><p>Files with the null extension are simply rendered as a copy of the file without the extension, so <span class="RktSym">index.html.p</span><span class="RktMeta"></span> becomes <span class="RktSym">index.html</span><span class="RktMeta"></span>.</p><p>This can be useful you’re managing your project with git. Most likely you’ll want to ignore <span class="RktSym">*.html</span><span class="RktMeta"></span> and other file types that are frequently regenerated by the project server. But if you have isolated static files — for instance, a <span class="RktSym">index.html</span><span class="RktMeta"></span> that doesn’t have source associated with it — they’ll be ignored too. You can cure this problem by appending the null extension to these static files, so they’ll be tracked in your source system without actually being source files.</p><div class="navsetbottom"><span class="navleft"> </span><span class="navright"> <a href="Using_raco_pollen.html" title="backward to "5 Using raco pollen"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Pollen: the book is a program"" data-pltdoc="x">up</a> <a href="reader.html" title="forward to "7 ◊ command overview"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html> |