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.
pollen/doc/big-picture.html

3 lines
19 KiB
HTML

11 years ago
<!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>4&nbsp;The big picture</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><script type="text/javascript" src="manual-racket.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="scribble-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9660;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Pollen:<span class="mywbr"> &nbsp;</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&nbsp;</td><td><a href="Installation.html" class="tocviewlink" data-pltdoc="x">Installation</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="quick-tour.html" class="tocviewlink" data-pltdoc="x">Quick tour</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="Backstory.html" class="tocviewlink" data-pltdoc="x">Backstory</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="big-picture.html" class="tocviewselflink" data-pltdoc="x">The big picture</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="First_tutorial.html" class="tocviewlink" data-pltdoc="x">First tutorial</a></td></tr><tr><td align="right">6&nbsp;</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&nbsp;</td><td><a href="File_formats.html" class="tocviewlink" data-pltdoc="x">File formats</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="reader.html" class="tocviewlink" data-pltdoc="x">&#9674; command overview</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="Module_reference.html" class="tocviewlink" data-pltdoc="x">Module reference</a></td></tr><tr><td align="right">10&nbsp;</td><td><a href="Acknowledgments.html" class="tocviewlink" data-pltdoc="x">Acknowledgments</a></td></tr><tr><td align="right">11&nbsp;</td><td><a href="License___source_code.html" class="tocviewlink" data-pltdoc="x">License &amp; 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,&quot;tocview_1&quot;);">&#9658;</a></td><td>4&nbsp;</td><td><a href="big-picture.html" class="tocviewselflink" data-pltdoc="x">The big picture</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">4.1&nbsp;</td><td><a href="big-picture.html#%28part._.The_book_is_a_program%29" class="tocviewlink" data-pltdoc="x">The book is a program</a></td></tr><tr><td align="right">4.2&nbsp;</td><td><a href="big-picture.html#%28part._.One_language__multiple_dialects%29" class="tocviewlink" data-pltdoc="x">One language, multiple dialects</a></td></tr><tr><td align="right">4.3&nbsp;</td><td><a href="big-picture.html#%28part._.Development_environment%29" class="tocviewlink" data-pltdoc="x">Development environment</a></td></tr><tr><td align="right">4.4&nbsp;</td><td><a href="big-picture.html#%28part._.A_special_data_structure_for_.H.T.M.L%29" class="tocviewlink" data-pltdoc="x">A special data structure for HTM
11 years ago
</div><div class="SIntrapara"><blockquote class="SCodeFlow"><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">&nbsp;</span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">pollen</span></a></td></tr><tr><td><span class="RktSym">Hello</span><span class="hspace">&nbsp;</span><span class="RktSym">world:</span><span class="hspace">&nbsp;</span><span class="RktSym">how</span><span class="hspace">&nbsp;</span><span class="RktSym">are</span><span class="hspace">&nbsp;</span><span class="RktSym">you</span><span class="hspace">&nbsp;</span><span class="RktSym">on</span><span class="hspace">&nbsp;</span><span class="RktSym">this</span><span class="hspace">&nbsp;</span><span class="RktSym">fine</span><span class="hspace">&nbsp;</span><span class="RktSym">summer</span><span class="hspace">&nbsp;</span><span class="RktSym">day?</span></td></tr></table></blockquote></div></p></li><li><p><span style="font-weight: bold">Commands start with &#9674;.</span> A simple rule: if a piece of text starts with <span class="RktInBG"><span class="hspace"></span><span class="RktIn">&#9674;</span><span class="hspace"></span></span>, it&rsquo;s treated as a command; otherwise it&rsquo;s treated as ordinary text.</p></li><li><p><span style="font-weight: bold">Write commands in text mode or Racket mode.</span> Commands can use two equivalent notation systems: either Pollen&rsquo;s text-mode command syntax, or standard Racket syntax.</p></li><li><p><span style="font-weight: bold">Everything in Racket is in Pollen too.</span> This isn&rsquo;t some dimwit &ldquo;template language.&rdquo; Racket is a fully provisioned programming language, and every Racket function is available in Pollen.</p></li></ul><h4>4.6<tt>&nbsp;</tt><a name="(part._.The_preprocessor)"></a>The preprocessor</h4><p>The <span style="font-style: italic">preprocessor</span> is the simplest processing mode in Pollen.</p><ul><li><p><span style="font-weight: bold">Text output.</span> The preprocessor scans the source for any Pollen commands, resolves them, and outputs the whole file as text.</p></li><li><p><span style="font-weight: bold">Work with any text file.</span> I hope this blows your mind a teeny bit. You can use the preprocessor with HTML, CSS, Markdown, JavaScript, XML, SVG, or any other text-based file (including source files of other programming languages).</p></li><li><p><span style="font-weight: bold">Start quickly.</span> Because it works with any text file, the preprocessor is an easy way to try out Pollen, because you can mix it into your workflow on an existing project, or even just one file.</p></li></ul><h4>4.7<tt>&nbsp;</tt><a name="(part._.Templated_source_files)"></a>Templated source files</h4><p>If you want to apply a particular page format to multiple sources of content &#8212;&#160;as you would in a book &#8212;&#160;you can use Pollen <span style="font-style: italic">templates</span>.</p><ul><li><p><span style="font-weight: bold">Templates can be any format.</span> Usually Pollen templates will be HTML. But they don&rsquo;t have to be.</p></li><li><p><span style="font-weight: bold">Markdown support.</span> Pollen has a built-in Markdown parser, so you can import Markdown sources into a Pollen publication.</p></li><li><p><span style="font-weight: bold">Custom markup.</span> Pollen&rsquo;s markup mode allows you the freedom to define your own markup tags and attach behavior to them.</p></li><li><p><span style="font-weight: bold">Mix source types.</span> Every text source is converted to an X-expression before going into a template. So it&rsquo;s fine to have multiple kinds of text source in one project.</p></li></ul><h4>4.8<tt>&nbsp;</tt><a name="(part._.Pagetrees)"></a>Pagetrees</h4><p>Similar to a table of contents, a <span style="font-style: italic">pagetree</span> is a special Pollen source file that gets turned into a hierarchical list of pages.</p><ul><li><p><spa