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/pollen/System_overview.html

2 lines
15 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>4&nbsp;System overview</title><link rel="stylesheet" type="text/css" href="../scribble.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/git/fracket/doc/local-redirect/local-redirect.js"></script><script type="text/javascript" src="file:///Users/MB/Library/Racket/6.0/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,&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="" class="tocviewselflink" data-pltdoc="x">System overview</a></td></tr><tr><td align="right">5&nbsp;</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&nbsp;</td><td><a href="File_formats.html" class="tocviewlink" data-pltdoc="x">File formats</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="reader.html" class="tocviewlink" data-pltdoc="x">&#9674; command overview</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="Module_reference.html" class="tocviewlink" data-pltdoc="x">Module reference</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="Acknowledgments.html" class="tocviewlink" data-pltdoc="x">Acknowledgments</a></td></tr><tr><td align="right">10&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="" class="tocviewselflink" data-pltdoc="x">System overview</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="#%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="#%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="#%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="#%28part._.A_special_data_structure_for_.H.T.M.L%29" class="tocviewlink" data-pltdoc="x">A special data structure for HTML</a></td></tr><tr><td align="right">4.5&nbsp;</td><td><a href="#%28part._.Preprocessor_source_files%29" class="tocviewlink" data-pltdoc="x">Preprocessor source files</a></td></tr><tr><td align="right">4.6&nbsp;</td><td><a href="#%28part._.Templated_source_files%29" class="tocviewlink" data-pltdoc="x">Templated source files</a></td></tr><tr><td align="right">4.7&nbsp;</td><td><a href="#%28part._.Utility_source_files%29" class="tocviewlink" data-pltdoc="x">Utility source files</a></td></tr><tr><td align="right">4.8&nbsp;</td><td><a href="#%28part._.Pagetrees%29" class="tocviewlink" data-pltdoc="x">Pagetrees</a></td></tr><tr><td align="right">4.9&nbsp;</td><td><a href="#%28part._.Build___deploy%29" class="tocviewlink" data-pltdoc="x">Build &amp; deploy</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">4.1<tt>&nbsp;</tt></span><a href="#%28part._.The_book_is_a_program%29" class="tocsubseclink" data-pltdoc="x">The book is a program</a></td></tr><tr><td><span class="tocsublinknumber">4.2<tt>&nbsp;</tt></span><a href="#%28part._.One_language__multiple_dialects%29" class="tocsubseclink" data-pltdoc="x">One language, multiple dialects</a></td></tr><tr><td><span class="tocsublinknumber">4.3<tt>&nbsp;</tt></span><a href="#%28part._.Development_environment%29" class="tocsubseclink" data-pltdoc="x">Development environment</a></td></tr><tr><td><span class="tocsublinknumber">4.4<tt>&nbsp;</tt></span><a href="#%28part._.A_special_data_structure_for_.H.T.M.L%29" class="tocsubseclink" data-pltdoc="x">A special data structure for HTML</a></td></tr><tr><td><span class="tocsublinknumber">4.5<tt>&nbsp;</tt></span><a href="#%28part._.Preprocessor_source_files%29" class="tocsubseclink" data-pltdoc="x">Preprocessor source files</a></td></tr><tr><td><span class="tocsublinknumber">4.6<tt>&nbsp;</tt></span><a href="#%28part._.Templated_source_files%29" class="tocsubseclink" data-pltdoc="x">Templated source files</a></td></tr><tr><td><span class="tocsublinknumber">4.7<tt>&nbsp;</tt></span><a href="#%28part._.Utility_source_files%29" class="tocsubseclink" data-pltdoc="x">Utility source files</a></td></tr><tr><td><span class="tocsublinknumber">4.8<tt>&nbsp;</tt></span><a href="#%28part._.Pagetrees%29" class="tocsubseclink" data-pltdoc="x">Pagetrees</a></td></tr><tr><td><span class="tocsublinknumber">4.9<tt>&nbsp;</tt></span><a href="#%28part._.Build___deploy%29" class="tocsubseclink" data-pltdoc="x">Build &amp; deploy</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.0</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, &quot;6.0&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.0&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="Backstory.html" title="backward to &quot;3 Backstory&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;Pollen: the book is a program&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="Using_raco_pollen.html" title="forward to &quot;5 Using raco pollen&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h3>4<tt>&nbsp;</tt><a name="(part._.System_overview)"></a>System overview</h3><p>A summary of the key components &amp; concepts of the Pollen publishing system and how they fit together. If you&rsquo;ve completed the <a href="quick-tour.html" data-pltdoc="x">Quick tour</a>, this will lend some context to what you saw. The next tutorials will make more sense if you read this first.</p><h4>4.1<tt>&nbsp;</tt><a name="(part._.The_book_is_a_program)"></a>The book is a program</h4><p>This is the core design principle of Pollen. Consistent with this principle, Pollen adopts the habits of software development in its functionality, workflow, and project management.</p><ul><li><p><span style="font-weight: bold">You are a programmer.</span> Don&rsquo;t panic. But let&rsquo;s just admit it &#8212; if your book is a program, then you are, in part, programming it. You don&rsquo;t have to know any programming to start using Pollen. But you&rsquo;ll have to be willing to learn a few programming ideas. (Those who have programmed other template-based HTML generators may have to forget a few things.)</p></li><li><p><span style="font-weight: bold">A Pollen project consists of source files + static files.</span> A <span style="font-style: italic">source file</span> is a file that can be compiled to produce certain output. A <span style="font-style: italic">static file</span> is usable as it stands (e.g., an SVG file or webfont). Generally, the textual content of your book will live in source files, and other elements will be static files.</p></li><li><p><span style="font-weight: bold">Source control is a good idea.</span> Because Pollen projects are software projects, they can be easily managed with systems for source control and collaboration, like <a href="http://github.com">GitHub</a>. If you&rsquo;re a writer at heart, don&rsquo;t fear these systems &#8212;&#160;they really do make revision &amp; edit tracking easier than it is with Word or PDF files.</p></li></ul><h4>4.2<tt>&nbsp;</tt><a name="(part._.One_language__multiple_dialects)"></a>One language, multiple dialects</h4><ul><li><p><span style="font-weight: bold">Everything is Racket.</span> The Pollen system is built entirely in the Racket programming language. Some of your source files will be in Racket. Others will be in one of the Pollen language dialects. But under the hood, everything becomes Racket code. So if you plan to do any serious work in Pollen, you&rsquo;ll want to learn some basics about Racket too (for instance <a href="http://download.racket-lang.org/docs/6.0/html/local-redirect/index.html?tag=%28part._%28.%27%28lib._scribblings%2Fquick%2Fquick..scrbl%29.%27._.%27top.%27%29%29&amp;version=6.0" class="Sq" data-pltdoc="x">Quick: An Introduction to Racket with Pictures</a>).</p></li><li><p><span style="font-weight: bold">The Pollen language is based on Scribble.</span> Scribble is a variant of the Racket language that flips the usual programming syntax: instead of code with embedded textual content, a Scribble source file is text with embedded code (an idea borrowed from <a href="https://en.wikipedia.org/wiki/TeX">TeX</a>). The Pollen language is adapted from Scribble. So most things that are true about Scribble are also true about Pollen (see <a href="http://download.racket-lang.org/docs/6.0/html/local-redirect/index.html?tag=%28part._%28.%27%28lib._scribblings%2Fscribble%2Fscribble..scrbl%29.%27._.%27top.%27%29%29&amp;version=6.0" class="Sq" data-pltdoc="x">Scribble: The Racket Documentation Tool</a>).</p></li><li><p><span style="font-weight: bold">The Pollen language is divided into dialects.</span> The Pollen dialects share a common syntax and structure. But they&rsquo;re different in details that makes them better adapted to certain types of source files (for instance, one dialect of Pollen understands Markdown; the others don&rsquo;t). You can use whichever suits the task at hand.</p></li></ul><h4>4.3<tt>&nbsp;</tt><a name="(part._.Development_environment)"></a>Development environment</h4><p>The Pollen development environment has two main pieces: the DrRacket code editor, and the Pollen project server.</p><ul><li><p><span style="font-weight: bold">Edit source files with DrRacket.</span> DrRacket is Racket&rsquo;s GUI code editor. Sure, you can also use a generic text editor. But DrRacket lets you immediately run your source file and see if it works. I know your favorite programming language doesn&rsquo;t have that. But trust me, it&rsquo;s very convenient.</p></li><li><p><span style="font-weight: bold">Render &amp; preview web pages with the Pollen project server.</span> Pollen has a built-in development web server called the <span style="font-style: italic">project server</span>. After you start the project server, you can preview &amp; test your web pages within a web browser with maximum accuracy. Everything is rendered to static HTML so you can see exactly what you&rsquo;ll get.</p></li><li><p><span style="font-weight: bold">One directory for everything.</span> Rather than separating your source files and static files, Pollen keeps them all in one directory so it&rsquo;s simple to make links between them.</p></li></ul><h4>4.4<tt>&nbsp;</tt><a name="(part._.A_special_data_structure_for_.H.T.M.L)"></a>A special data structure for HTML</h4><p>X-expression</p><p>Tags can be tags</p><p>Or tags can be functions</p><h4>4.5<tt>&nbsp;</tt><a name="(part._.Preprocessor_source_files)"></a>Preprocessor source files</h4><p>Lower level of abstraction</p><p>Work directly</p><p>Text output</p><p>Any kind of file!</p><h4>4.6<tt>&nbsp;</tt><a name="(part._.Templated_source_files)"></a>Templated source files</h4><p>Higher level of abstraction</p><p>Work indirectly</p><p>X-expression output</p><p>Markdown</p><p>Markup</p><p>Templates</p><h4>4.7<tt>&nbsp;</tt><a name="(part._.Utility_source_files)"></a>Utility source files</h4><p>Scribble</p><p>Null</p><h4>4.8<tt>&nbsp;</tt><a name="(part._.Pagetrees)"></a>Pagetrees</h4><p>Navigation</p><p>Hierarchy</p><p>Subsetting</p><p>Build script</p><h4>4.9<tt>&nbsp;</tt><a name="(part._.Build___deploy)"></a>Build &amp; deploy</h4><p>Pollen is not a production server</p><p>Render &amp; clone</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, &quot;6.0&quot;, &quot;../&quot;);" onfocus="this.style.color=&quot;black&quot;; this.style.textAlign=&quot;left&quot;; if (this.value == &quot;...search manuals...&quot;) this.value=&quot;&quot;;" onblur="if (this.value.match(/^ *$/)) { this.style.color=&quot;#888&quot;; this.style.textAlign=&quot;center&quot;; this.value=&quot;...search manuals...&quot;; }"/></form>&nbsp;&nbsp;<a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot(&quot;6.0&quot;);">top</a></span><span class="navright">&nbsp;&nbsp;<a href="Backstory.html" title="backward to &quot;3 Backstory&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="index.html" title="up to &quot;Pollen: the book is a program&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="Using_raco_pollen.html" title="forward to &quot;5 Using raco pollen&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>