<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Coolnamehere</title>
	<atom:link href="http://coolnamehere.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://coolnamehere.wordpress.com</link>
	<description>Geekery and random babblings</description>
	<lastBuildDate>Sun, 04 May 2008 10:34:23 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='coolnamehere.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/74f6d75bf6b92105fd66754bc20b826e?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Coolnamehere</title>
		<link>http://coolnamehere.wordpress.com</link>
	</image>
			<item>
		<title>Purpose</title>
		<link>http://coolnamehere.wordpress.com/2008/05/04/purpose/</link>
		<comments>http://coolnamehere.wordpress.com/2008/05/04/purpose/#comments</comments>
		<pubDate>Sun, 04 May 2008 10:34:23 +0000</pubDate>
		<dc:creator>coolnamehere</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://coolnamehere.wordpress.com/?p=45</guid>
		<description><![CDATA[I&#8217;ve been thinking about it, and I decided that this would be my new geek blog. My Blogger account just hasn&#8217;t been cutting it for me for a while. Not that it&#8217;s a bad system, but it doesn&#8217;t seem quite as nice as WordPress.
There probably won&#8217;t be a lot of posts here any time soon. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=45&subd=coolnamehere&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been thinking about it, and I decided that this would be my new geek blog. My Blogger account just hasn&#8217;t been cutting it for me for a while. Not that it&#8217;s a bad system, but it doesn&#8217;t seem quite as nice as WordPress.</p>
<p>There probably won&#8217;t be a lot of posts here any time soon. Work&#8217;s been keeping me very busy, and when I&#8217;m not busy I&#8217;m poking through <a href="http://www.greenteapress.com/thinkpython/">How to Think Like a (Python) Programmer</a>. That&#8217;s a fun book, incidentally. There&#8217;s no new educational matter if you already know Python, but I like the way it&#8217;s organized and the exercises are great fun.</p>
<p>I&#8217;ll eventually have something to write about and the time to write about it, though. I&#8217;m sure you&#8217;ll be on pins and needles waiting for it.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coolnamehere.wordpress.com/45/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coolnamehere.wordpress.com/45/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coolnamehere.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coolnamehere.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coolnamehere.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coolnamehere.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coolnamehere.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coolnamehere.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coolnamehere.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coolnamehere.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coolnamehere.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coolnamehere.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=45&subd=coolnamehere&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://coolnamehere.wordpress.com/2008/05/04/purpose/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7f8a6af7d63c962386d5f1c6ce9e0f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">coolnamehere</media:title>
		</media:content>
	</item>
		<item>
		<title>First Post</title>
		<link>http://coolnamehere.wordpress.com/2008/02/10/first-post/</link>
		<comments>http://coolnamehere.wordpress.com/2008/02/10/first-post/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 12:54:34 +0000</pubDate>
		<dc:creator>coolnamehere</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://coolnamehere.wordpress.com/?p=3</guid>
		<description><![CDATA[I&#8217;m just exploring different hosted blog systems right now. I have been thinking a lot about switching my site over to a blog-based system, which does mean transferring content and doing something about categories. My blogger account seems a little straitjacketed for all the stuff I&#8217;m thinking of, so now I&#8217;m looking at WordPress. Impressions [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=3&subd=coolnamehere&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m just exploring different hosted blog systems right now. I have been thinking a lot about switching <a href="http://coolnamehere.com/">my site</a> over to a blog-based system, which does mean transferring content and doing something about categories. My <a href="http://brianwisti.blogspot.com/">blogger account</a> seems a little straitjacketed for all the stuff I&#8217;m thinking of, so now I&#8217;m looking at WordPress. Impressions so far? It&#8217;s pretty.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coolnamehere.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coolnamehere.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coolnamehere.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coolnamehere.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coolnamehere.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coolnamehere.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coolnamehere.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coolnamehere.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coolnamehere.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coolnamehere.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coolnamehere.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coolnamehere.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=3&subd=coolnamehere&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://coolnamehere.wordpress.com/2008/02/10/first-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7f8a6af7d63c962386d5f1c6ce9e0f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">coolnamehere</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://coolnamehere.wordpress.com/2008/02/10/hello-world/</link>
		<comments>http://coolnamehere.wordpress.com/2008/02/10/hello-world/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 12:50:31 +0000</pubDate>
		<dc:creator>coolnamehere</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=1&subd=coolnamehere&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coolnamehere.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coolnamehere.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coolnamehere.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coolnamehere.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coolnamehere.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coolnamehere.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coolnamehere.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coolnamehere.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coolnamehere.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coolnamehere.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coolnamehere.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coolnamehere.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=1&subd=coolnamehere&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://coolnamehere.wordpress.com/2008/02/10/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7f8a6af7d63c962386d5f1c6ce9e0f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">coolnamehere</media:title>
		</media:content>
	</item>
		<item>
		<title>Updating coolnamehere&#8217;s design</title>
		<link>http://coolnamehere.wordpress.com/2008/02/01/updating-coolnameheres-design/</link>
		<comments>http://coolnamehere.wordpress.com/2008/02/01/updating-coolnameheres-design/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 18:07:00 +0000</pubDate>
		<dc:creator>coolnamehere</dc:creator>
				<category><![CDATA[coolnamehere]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://coolnamehere.wordpress.com/2008/02/01/updating-coolnameheres-design/</guid>
		<description><![CDATA[It&#8217;s time to revamp coolnamehere.
I&#8217;ve been using a tweaked version of the Greenery template at OSWD for a couple of years now, and I think it&#8217;s time for a change. This time I actually concocted my own design using one of my photos and Yahoo&#8217;s YUI (I had so much fun with YUI on my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=44&subd=coolnamehere&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It&#8217;s time to revamp <a href="http://coolnamehere.com/">coolnamehere</a>.</p>
<p>I&#8217;ve been using a tweaked version of the <a href="http://www.oswd.org/design/information/id/2448">Greenery</a> template at <a href="http://oswd.org/">OSWD</a> for a couple of years now, and I think it&#8217;s time for a change. This time I actually concocted my own design using one of my photos and <a href="http://developer.yahoo.com/yui/">Yahoo&#8217;s YUI</a> (I had so much fun with YUI on <a href="http://greenlakeumc.org/">my church site</a> that I had to try it out on my own site).</p>
<p>Here&#8217;s a screenshot of the old design:</p>
<p><a href="http://bp0.blogger.com/_fOWGbeeBQLA/R6Nii4ZMqgI/AAAAAAAAADg/6TEpr2fXD4E/s1600-h/coolnamehere-20080128.png"><img style="display:block;text-align:center;cursor:pointer;margin:0 auto 10px;" src="http://bp0.blogger.com/_fOWGbeeBQLA/R6Nii4ZMqgI/AAAAAAAAADg/6TEpr2fXD4E/s320/coolnamehere-20080128.png" alt="" border="0" /></a></p>
<p>There are a lot of things I liked about this design. The grass image dividing the columns gave the site an attractive and natural touch that had been missing before. On the other hand, I felt the need to tweak it so that it would work in all the browsers I used. It&#8217;s nice, though. Much better than the designs I had been coming up with on my own.</p>
<p>The new design has been widely praised by my sample group of two incredibly non-biased people: my wife and my brother. Okay, I will concede that they may have a bias. I like it in general, though. It&#8217;s very &#8230; Seattle. Clouds, water, scotch bloom.</p>
<p><a href="http://bp2.blogger.com/_fOWGbeeBQLA/R6NosYZMqhI/AAAAAAAAADo/97qypUGZaS8/s1600-h/coolnamehere-2008-0128-2.png"><img style="display:block;text-align:center;cursor:pointer;margin:0 auto 10px;" src="http://bp2.blogger.com/_fOWGbeeBQLA/R6NosYZMqhI/AAAAAAAAADo/97qypUGZaS8/s320/coolnamehere-2008-0128-2.png" alt="" border="0" /></a></p>
<p>The design is still in progress. For starters, I <span style="font-style:italic;">hate </span>the navtree menu. That navtree is starting to look a little cumbersome, actually, and is making me rethink how I want to handle navigation through the site. Maybe a simple subpage listing such as the one generated by ZenWeb. I&#8217;m also looking at new publishing options, and the one that is most attractive to me right now is <a href="http://www.blosxom.com/">Blosxom</a>. It&#8217;s relatively old. It is also ridiculously easy to use and fairly straightforward to enhance.</p>
<p>Oh, and I need to sort through the CSS, and probably the content itself. Oh well, at least all the pages are in order.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coolnamehere.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coolnamehere.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coolnamehere.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coolnamehere.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coolnamehere.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coolnamehere.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coolnamehere.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coolnamehere.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coolnamehere.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coolnamehere.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coolnamehere.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coolnamehere.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=44&subd=coolnamehere&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://coolnamehere.wordpress.com/2008/02/01/updating-coolnameheres-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7f8a6af7d63c962386d5f1c6ce9e0f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">coolnamehere</media:title>
		</media:content>

		<media:content url="http://bp0.blogger.com/_fOWGbeeBQLA/R6Nii4ZMqgI/AAAAAAAAADg/6TEpr2fXD4E/s320/coolnamehere-20080128.png" medium="image" />

		<media:content url="http://bp2.blogger.com/_fOWGbeeBQLA/R6NosYZMqhI/AAAAAAAAADo/97qypUGZaS8/s320/coolnamehere-2008-0128-2.png" medium="image" />
	</item>
		<item>
		<title>PHP&#8217;s extract and compact functions</title>
		<link>http://coolnamehere.wordpress.com/2008/01/30/phps-extract-and-compact-functions/</link>
		<comments>http://coolnamehere.wordpress.com/2008/01/30/phps-extract-and-compact-functions/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 18:51:00 +0000</pubDate>
		<dc:creator>coolnamehere</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[tidbit]]></category>

		<guid isPermaLink="false">http://coolnamehere.wordpress.com/2008/01/30/phps-extract-and-compact-functions/</guid>
		<description><![CDATA[I&#8217;ve been brushing up on my PHP basics lately. Why? Well, it never hurts to
   revisit things you think you already know. There is a good chance you will
   discover something you didn&#8217;t know after all. For example: this time I
   learned about PHP&#8217;s extract and compact functions.

extract takes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=43&subd=coolnamehere&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been brushing up on my PHP basics lately. Why? Well, it never hurts to<br />
   revisit things you think you already know. There is a good chance you will<br />
   discover something you didn&#8217;t know after all. For example: this time I<br />
   learned about <a href="http://php.net">PHP</a>&#8217;s <code>extract</code> and <code>compact</code> functions.
</p>
<p><a href="http://us3.php.net/manual/en/function.extract.php"><code>extract</code></a> takes an associative array and creates local variables on the fly, named for the keys in the array and with the corresponding values matched up. <a href="http://us3.php.net/manual/en/function.compact.php"><code>compact</code></a> is the corresponding function for taking a collection of variables and stuffing them into an associative array.
</p>
<pre><code>&lt;?php

    $book = array(
        &quot;title&quot;     =&gt; &quot;Dad's Own Cookbook&quot;,
        &quot;author&quot;    =&gt; &quot;Bob Sloan&quot;,
    );

    extract($book);
    echo $title . &quot; was written by &quot; . $author . &quot;\n&quot;;

    $first = &quot;Brian&quot;;
    $last  = &quot;Wisti&quot;;
    $keys  = array(&quot;first&quot;, &quot;last&quot;);
    $my_name = compact($keys);
    print_r($my_name);
?&gt;
</code></pre>
<p>Running this code:
</p>
<pre><code>$ php -f extract-compact.php
Dad's Own Cookbook was written by Bob Sloan
Array
(
    [first] =&gt; Brian
    [last] =&gt; Wisti
)
</code></pre>
<p><code>extract</code> is the more immediately useful of the two for my purposes, because<br />
   it simplifies a common tactic I use for creating local variables based on<br />
   database lookups.
</p>
<p>Instead of manually creating local variables, like this:
</p>
<pre><code>&lt;?php

    # ...
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $author = $row[&quot;author&quot;];
        $title  = $row[&quot;title&quot;];
        # ...
    }
?&gt;
</code></pre>
<p>I can save myself a little effort with <code>extract</code>.
</p>
<pre><code>&lt;?php

    # ...
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        extract($row);
        # ...
    }
?&gt;
</code></pre>
<p>I realize that there may be an even easier way to do it, but just this will<br />
   make my life noticeably easier as long as I don&#8217;t abuse it. I would mainly<br />
   tuck a call like this off in a function and probably use it in conjunction with<br />
   a SQL query or something else where I knew exactly what names I would end up with.
</p>
<p>Why didn&#8217;t I know about this before? Well, the manual approach was good enough.<br />
   And since what I had was good enough, I didn&#8217;t think of looking for a better<br />
   approach. Then again, finds like this are exactly why I <em>do</em> go back and review<br />
   what I thought I already knew.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coolnamehere.wordpress.com/43/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coolnamehere.wordpress.com/43/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coolnamehere.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coolnamehere.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coolnamehere.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coolnamehere.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coolnamehere.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coolnamehere.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coolnamehere.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coolnamehere.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coolnamehere.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coolnamehere.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=43&subd=coolnamehere&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://coolnamehere.wordpress.com/2008/01/30/phps-extract-and-compact-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7f8a6af7d63c962386d5f1c6ce9e0f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">coolnamehere</media:title>
		</media:content>
	</item>
		<item>
		<title>SiteTemplate Hiccup</title>
		<link>http://coolnamehere.wordpress.com/2008/01/12/sitetemplate-hiccup/</link>
		<comments>http://coolnamehere.wordpress.com/2008/01/12/sitetemplate-hiccup/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 10:49:00 +0000</pubDate>
		<dc:creator>coolnamehere</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[sitetemplate]]></category>
		<category><![CDATA[writers block]]></category>

		<guid isPermaLink="false">http://coolnamehere.wordpress.com/2008/01/12/sitetemplate-hiccup/</guid>
		<description><![CDATA[I&#8217;m trying to work out the next part of my Site generation series. There&#8217;s two problems. Writing the code is more interesting than the blow-by-blow account of how the code was written. I suspect anybody reading this would be more interested in using the library I&#8217;m talking about rather than writing it. I don&#8217;t really [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=41&subd=coolnamehere&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m trying to work out the next part of my Site generation series. There&#8217;s two problems. Writing the code is more interesting than the blow-by-blow account of how the code was written. I suspect anybody reading this would be more interested in <i>using</i> the library I&#8217;m talking about rather than <i>writing</i> it. I don&#8217;t really know, though, since what traffic I get is coming read about my <a href="http://brianwisti.blogspot.com/2007/12/python-loves-blogger-part-1_28.html">messing with</a> the Google API in Python. I&#8217;m pretty sure this series is for my own amusement, so maybe I&#8217;ll work on the code and then write a nice post about how to use it. Well, it&#8217;s 3 am. I don&#8217;t need to decide right now.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coolnamehere.wordpress.com/41/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coolnamehere.wordpress.com/41/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coolnamehere.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coolnamehere.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coolnamehere.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coolnamehere.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coolnamehere.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coolnamehere.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coolnamehere.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coolnamehere.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coolnamehere.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coolnamehere.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=41&subd=coolnamehere&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://coolnamehere.wordpress.com/2008/01/12/sitetemplate-hiccup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7f8a6af7d63c962386d5f1c6ce9e0f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">coolnamehere</media:title>
		</media:content>
	</item>
		<item>
		<title>REBOL 3 alpha released</title>
		<link>http://coolnamehere.wordpress.com/2008/01/08/rebol-3-alpha-released/</link>
		<comments>http://coolnamehere.wordpress.com/2008/01/08/rebol-3-alpha-released/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 22:16:00 +0000</pubDate>
		<dc:creator>coolnamehere</dc:creator>
				<category><![CDATA[rebol]]></category>

		<guid isPermaLink="false">http://coolnamehere.wordpress.com/2008/01/08/rebol-3-alpha-released/</guid>
		<description><![CDATA[I just saw Petr Krenzelok&#8217;s giddy announcement on the REBOL mailing list that a public alpha of REBOL 3 is available today. I&#8217;ve been waiting to see this for a while and can&#8217;t even begin to describe how excited I am. 
The official announcement is here. I just need to remember that it&#8217;s an alpha. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=40&subd=coolnamehere&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I just saw Petr Krenzelok&#8217;s giddy announcement on the REBOL mailing list that a public alpha of REBOL 3 is available today. I&#8217;ve been waiting to see this for a while and can&#8217;t even begin to describe how excited I am. </p>
<p>The official announcement is <a href="http://www.rebol.com/article/0347.html">here</a>. I just need to remember that it&#8217;s an alpha. Pieces aren&#8217;t going to work. Things will be strange. But it&#8217;s out there for the bold to play with.</p>
<p>Of course I gotta get some work done, but you can be sure I&#8217;ll be poking at this over the next couple of days.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coolnamehere.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coolnamehere.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coolnamehere.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coolnamehere.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coolnamehere.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coolnamehere.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coolnamehere.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coolnamehere.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coolnamehere.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coolnamehere.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coolnamehere.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coolnamehere.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=40&subd=coolnamehere&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://coolnamehere.wordpress.com/2008/01/08/rebol-3-alpha-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7f8a6af7d63c962386d5f1c6ce9e0f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">coolnamehere</media:title>
		</media:content>
	</item>
		<item>
		<title>PageTemplate for Site Generation Part 2</title>
		<link>http://coolnamehere.wordpress.com/2008/01/07/pagetemplate-for-site-generation-part-2/</link>
		<comments>http://coolnamehere.wordpress.com/2008/01/07/pagetemplate-for-site-generation-part-2/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 22:15:00 +0000</pubDate>
		<dc:creator>coolnamehere</dc:creator>
				<category><![CDATA[pagetemplate]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sitetemplate]]></category>

		<guid isPermaLink="false">http://coolnamehere.wordpress.com/2008/01/07/pagetemplate-for-site-generation-part-2/</guid>
		<description><![CDATA[I&#8217;ve got my code filtering
Markdown
   and now I want to stuff that filtered content into an HTML page. I could just use
   maruku#to_html_document, but I need the ability to add details like a title and
   site-related links.

I could use a format similar to my Python blog
files. I won&#8217;t really [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=39&subd=coolnamehere&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve got my code <a href="http://brianwisti.blogspot.com/2008/01/pagetemplate-for-site-generation.html">filtering<br />
Markdown</a><br />
   and now I want to stuff that filtered content into an HTML page. I could just use<br />
   <code>maruku#to_html_document</code>, but I need the ability to add details like a title and<br />
   site-related links.
</p>
<p>I could use a format similar to my <a href="http://brianwisti.blogspot.com/2007/12/python-loves-blogger-part-1_28.html">Python blog<br />
files</a>. I won&#8217;t really need<br />
   PageTemplate if I do that, though. Not for the content file, anyways. That&#8217;s okay, though. The Maruku filter<br />
   was more of a proof-of-concept, anyways. PageTemplate will be useful for fitting the generated content into an<br />
   actual template, though.
</p>
<p>That means I&#8217;m starting over on my content files.
</p>
<p>Given a content file that looks like this:
</p>
<pre><code>title: A Simple Page
--
This page intentionally left blank.
</code></pre>
<p>I want an object that makes the title available in some way (simple Hash style access is fine), and makes the<br />
   HTML-formatted content available. After a few minutes of fiddling and poking around, I end up with tests and<br />
   application code.
</p>
<h4>Article Test Code</h4>
<pre><code>#!/usr/local/bin/ruby

require 'test/unit'
require 'SiteTemplate'

class TC_Article &lt; Test::Unit::TestCase
    def test_article_file()
        article_file = 'simple.txt'
        assert(article = Article.new(article_file))
        assert_equal(article_file, article.source_file)
        assert_equal('A Simple Page', article.metadata['title'])
        assert(article.content =~ %r{&lt;p&gt;This page intentionally left blank.&lt;/p&gt;})
    end
end
</code></pre>
<h4>The Application Code</h4>
<pre><code>#!/usr/local/bin/ruby

require 'rubygems'
require 'maruku'

# A single HTML page generated by a content file
#
# Content files usually look like this:
#
#    title: My Title
#    --
#    Article contents
class Article
    attr_reader :source_file, :metadata, :content
    def initialize(filename)
        @metadata = {}
        parse!(filename)
    end

    def parse!(filename)
        @source_file = filename
        content = ''
        in_content = false
        File.open(filename).each_line do |line|
            if in_content then
                content &lt;&lt; line
            else
                if line =~ /^--$/ then
                    in_content = true
                    next
                end

                if line =~ /^(\w+?):\s*(.+)$/ then
                    key = $1
                    value = $2
                    @metadata[key] = value
                end
            end
        end

        @content = Maruku.new(content).to_html
    end
end
</code></pre>
<p>It&#8217;s a really simple, slow parser, but it works. I won&#8217;t try to optimize it before I&#8217;ve actually figured out<br />
   what it&#8217;s supposed to be doing.
</p>
<h3>The Template</h3>
<p>The next target is stuffing this content into a template. That&#8217;s <em>easy</em>. Here&#8217;s the template:
</p>
<h4>simple.html Template File</h4>
<pre><code>&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;[%var title%]&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;h1&gt;[%var title%]&lt;/h1&gt;
        [%var content%]
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p>I could assemble my page manually if I felt like it. As a matter of fact, let&#8217;s do that in one of the tests.
</p>
<h4>Manual Page Generation Test</h4>
<pre><code>require 'PageTemplate'

class TC_HTML_Page &lt; Test::Unit::TestCase
    def test_manual_page_generation()
        article_file = 'simple.txt'
        template = PageTemplate.new()
        template.load('simple.html')
        article = Article.new(article_file)
        template['title'] = article.metadata['title']
        template['content'] = article.content
        assert_match(%r{&lt;title&gt;A Simple Page&lt;/title&gt;}, template.output)
    end
end
</code></pre>
<p>Do I really want to manually apply even that little bit of code, though? No, I don&#8217;t.
</p>
<h4>Automatic Page Generation Test</h4>
<pre><code>class TC_HTML_Page &lt; Test::Unit::TestCase
    def test_standard_page_generation
        article_file = 'simple.txt'
        template_file = 'simple.html'
        assert(html_page = HTML_Page.new(:article =&gt; article_file, :template =&gt; template_file))
        assert_match(%r{&lt;title&gt;A Simple Page&lt;/title&gt;}, html_page.to_html)
        assert_match(%r{&lt;p&gt;This page}, html_page.to_html)
    end
end
</code></pre>
<h4>Automatic Page Generation Code</h4>
<pre><code>require 'PageTemplate'

class HTML_Page
    def initialize(opts = {})
        @article = Article.new(opts[:article])
        @template = PageTemplate.new()
        @template.load(opts[:template])
    end

    def to_html()
        @template['title'] = @article.metadata['title']
        @template['content'] = @article.content
        return @template.output
    end
end
</code></pre>
<h3>Saving a File</h3>
<p>Okay, now I have article files with content and metadata being consumed, formatted, and handed off to<br />
   PageTemplate for wrapping into a pretty HTML page. The only thing remaining at this stage is to actually<br />
   <em>write</em> the file.
</p>
<h4>Test Writes</h4>
<pre><code>require 'fileutils'

class TC_HTML_Page &lt; Test::Unit::TestCase

    def test_standard_page_generation
        article_file = 'simple.txt'
        template_file = 'simple.html'
        output_file   = 'test/out.simple.html'
        FileUtils::rm_rf(output_file)
        assert(html_page = HTML_Page.new(
            :article     =&gt; article_file,
            :template    =&gt; template_file,
            <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> utput_file =&gt; output_file))
        assert_match(%r{&lt;title&gt;A Simple Page&lt;/title&gt;}, html_page.to_html)
        assert_match(%r{&lt;p&gt;This page}, html_page.to_html)

        html_page.write_to_file
        assert(saved_html = File.open(output_file).read())
        assert_match(%r{&lt;title&gt;A Simple Page&lt;/title&gt;}, saved_html)
        assert_match(%r{&lt;p&gt;This page}, saved_html)
        FileUtils::rm_rf(output_file)
    end
end
</code></pre>
<h4>Code to Make the Writes Happen</h4>
<p>Oh heck, just take the whole thing. This is what my <code>SiteTemplate.rb</code> file looks like right now.
</p>
<pre><code>#!/usr/local/bin/ruby

require 'rubygems'
require 'fileutils'
require 'maruku'
require 'PageTemplate'

# A single HTML page generated by a content file
#
# Content files usually look like this:
#
#    title: My Title
#    --
#    Article contents
class Article
    attr_reader :source_file, :metadata, :content
    def initialize(filename)
        @metadata = {}
        parse!(filename)
    end

    def parse!(filename)
        @source_file = filename
        content = ''
        in_content = false
        File.open(filename).each_line do |line|
            if in_content then
                content &lt;&lt; line
            else
                if line =~ /^--$/ then
                    in_content = true
                    next
                end

                if line =~ /^(\w+?):\s*(.+)$/ then
                    key = $1
                    value = $2
                    @metadata[key] = value
                end
            end
        end

        @content = Maruku.new(content).to_html
    end
end

# Takes an Article and a PageTemplate and mushes them together
# Note: This version still assumes that needed metadata will
# be available. This is not a safe assumption.
class HTML_Page
    def initialize(opts = {})
        @article = Article.new(opts[:article])
        @template = PageTemplate.new()
        @template.load(opts[:template])
        @output_file = opts[:output_file]
    end

    def to_html()
        @template['title'] = @article.metadata['title']
        @template['content'] = @article.content
        return @template.output
    end

    def write_to_file()
        FileUtils::mkdir_p(File.dirname(@output_file))
        File.open(@output_file, 'w') { |f| f.print to_html }
    end
end
</code></pre>
<h3>Wrapup</h3>
<p>This stage is done. We&#8217;ve taken some article files that look a lot like my blog files and turned them into<br />
   fully-fleshed HTML files. They will fit into a PageTemplate that&#8217;s been defined by the site maintainer,<br />
   guaranteeing a standard look for the site.
</p>
<p>My next post on this topic will deal with putting an HTML_Page into the context of a larger site.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coolnamehere.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coolnamehere.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coolnamehere.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coolnamehere.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coolnamehere.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coolnamehere.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coolnamehere.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coolnamehere.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coolnamehere.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coolnamehere.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coolnamehere.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coolnamehere.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=39&subd=coolnamehere&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://coolnamehere.wordpress.com/2008/01/07/pagetemplate-for-site-generation-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7f8a6af7d63c962386d5f1c6ce9e0f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">coolnamehere</media:title>
		</media:content>
	</item>
		<item>
		<title>PageTemplate for Site Generation</title>
		<link>http://coolnamehere.wordpress.com/2008/01/06/pagetemplate-for-site-generation/</link>
		<comments>http://coolnamehere.wordpress.com/2008/01/06/pagetemplate-for-site-generation/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 15:25:00 +0000</pubDate>
		<dc:creator>coolnamehere</dc:creator>
				<category><![CDATA[pagetemplate]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://coolnamehere.wordpress.com/2008/01/06/pagetemplate-for-site-generation/</guid>
		<description><![CDATA[So I was looking at my Python Blogger client and I started thinking. First, I thought that I could probably do the same thing in Ruby. Of course, the fact that my question in the RubyForge forum for gdata-ruby suggests that I might have to do a little more work doing this in Ruby. Then [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=38&subd=coolnamehere&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So I was looking at my <a href="http://brianwisti.blogspot.com/2007/12/python-loves-blogger-part-1_28.html">Python Blogger client</a> and I started thinking. First, I thought that I could probably do the same thing in Ruby. Of course, the fact that <a href="http://rubyforge.org/forum/forum.php?thread_id=20698&amp;forum_id=12166">my question</a> in the RubyForge forum for<a href="http://rubyforge.org/projects/gdata-ruby/"> gdata-ruby</a> suggests that I might have to do a little more work doing this in Ruby. Then again, maybe the package author has just been really busy. Goodness knows I have let <a href="http://pagetemplate.org/">PageTemplate</a> site idle for <em>years</em> at a time even though I still haven&#8217;t actually stopped developing it.
</p>
<p>That, of course, set me off on yet another thought. What if I tried to define my posts in a PageTemplate file and used filters to handle the dirty work? Well, that might be a little challenge. But what if I used this approach to generate a whole Web site? Okay, yeah. That may have come out of nowhere for you. The truth is that I love static site generation tools, from <a href="http://zenspider.com/ZSS/Products/ZenWeb/index.html">ZenWeb</a> to <a href="http://webmake.taint.org/">WebMake</a>. These tools appeal to me because <a href="http://coolnamehere.com/">coolnamehere</a> is pretty much a static site and I love anything which can give that pile of pages a common format without making heavy server demands. Honestly, loading up PHP just so I can have a templated site seems like overkill.
</p>
<p>Let&#8217;s see if I can build a site like coolnamehere with Ruby and PageTemplate. I plan to borrow heavily from ZenWeb, since there are a lot of things to like about the ZenSpider approach. I especially like<br />
  building a site from a collection of pages and a chain of filters. Hey, PageTemplate has filters thanks to Greg Millam. Why don&#8217;t I try <span style="font-style:italic;">using</span> them?
</p>
<h2>Start Small</h2>
<p>I am going to start small, by teaching SiteTemplate about <a href="http://maruku.rubyforge.org/">Maruku</a>.
</p>
<p>It took me a bit of time to get that much done, because I needed to relearn how PageTemplate initializes. <em>Note to self: don&#8217;t ever go a full year without using your own library.</em>
</p>
<p>The test is simple: create a template using the Maruku filter. Compare the output of that template<br />
  with the text minus PageTemplate directives and fed into Maruku. The test passes if they look alike,<br />
  or close enough.
</p>
<pre><code>#!/usr/local/bin/ruby

require 'rubygems'
require 'test/unit'
require 'sitetemplate'

class TC_MarukuFilter &lt; Test::Unit::TestCase
   require 'maruku'

   def test_maruku_filter
       content = "This is a paragraph"

       # template_file contains the text "[%filter :maruku%]This is a paragraph[%end%]"
       template_file = "maruku.txt"
       maruku_doc = Maruku.new(content)
       pt = PageTemplate.new()
       pt.load(template_file)
       assert_equal(maruku_doc.to_html + "\n", pt.output,
           "Check if Maruku filter ran successfully")
   end
end
</code></pre>
<p>Then the code I needed to make that test pass:
</p>
<pre><code>#!/usr/local/bin/ruby
# Utility for generating a static site with PageTemplate

require 'rubygems'
require 'maruku'
require 'pagetemplate'

class PageTemplate
   class DefaultPreprocessor
       class &lt;&lt; self
           def maruku(text)
               return Maruku.new(text).to_html
           end
       end
   end
end
</code></pre>
<p>I cut corners by adding the <code>maruku</code> filter method to PageTemplate&#8217;s DefaultPreprocessor. PageTemplate&#8217;s internals need a little work, since this isn&#8217;t the prettiest way a person might want to add filters. It works well, but it&#8217;s not pretty.
</p>
<p>That works well enough. Next time I&#8217;ll try a template filter, which puts the Maruku output into a template file of my choosing. That way we get the standard look for pages.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coolnamehere.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coolnamehere.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coolnamehere.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coolnamehere.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coolnamehere.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coolnamehere.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coolnamehere.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coolnamehere.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coolnamehere.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coolnamehere.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coolnamehere.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coolnamehere.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=38&subd=coolnamehere&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://coolnamehere.wordpress.com/2008/01/06/pagetemplate-for-site-generation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7f8a6af7d63c962386d5f1c6ce9e0f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">coolnamehere</media:title>
		</media:content>
	</item>
		<item>
		<title>Another Link</title>
		<link>http://coolnamehere.wordpress.com/2008/01/05/another-link/</link>
		<comments>http://coolnamehere.wordpress.com/2008/01/05/another-link/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 02:31:00 +0000</pubDate>
		<dc:creator>coolnamehere</dc:creator>
				<category><![CDATA[link]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://coolnamehere.wordpress.com/2008/01/05/another-link/</guid>
		<description><![CDATA[This blog may well be the single best resource ever created for those of use who are learning how to automate Windows with Ruby.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=37&subd=coolnamehere&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://rubyonwindows.blogspot.com/">This blog</a> may well be the single best resource ever created for those of use who are learning how to automate Windows with Ruby.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/coolnamehere.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/coolnamehere.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/coolnamehere.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/coolnamehere.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/coolnamehere.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/coolnamehere.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/coolnamehere.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/coolnamehere.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/coolnamehere.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/coolnamehere.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/coolnamehere.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/coolnamehere.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=coolnamehere.wordpress.com&blog=2835534&post=37&subd=coolnamehere&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://coolnamehere.wordpress.com/2008/01/05/another-link/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5b7f8a6af7d63c962386d5f1c6ce9e0f?s=96&#38;d=identicon" medium="image">
			<media:title type="html">coolnamehere</media:title>
		</media:content>
	</item>
	</channel>
</rss>