<?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/"
	>

<channel>
	<title>unsafePerformHack &#187; Blogs about blogging</title>
	<atom:link href="http://olsner.se/category/blogs-about-blogging/feed/" rel="self" type="application/rss+xml" />
	<link>http://olsner.se</link>
	<description>Perversions in Computer Science</description>
	<lastBuildDate>Tue, 03 May 2011 23:32:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Literate Haskell Blogging</title>
		<link>http://olsner.se/2008/02/05/literate-haskell-blogging/</link>
		<comments>http://olsner.se/2008/02/05/literate-haskell-blogging/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 00:11:13 +0000</pubDate>
		<dc:creator>olsner</dc:creator>
				<category><![CDATA[Blogs about blogging]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[geshi]]></category>
		<category><![CDATA[literate haskell]]></category>
		<category><![CDATA[markdown]]></category>

		<guid isPermaLink="false">http://olsner.se/?p=9</guid>
		<description><![CDATA[An unfortunate thing with this markdown framework I&#8217;ve been using is that it requires me to indent code blocks by four spaces (or a tab). Editing such text in a web browser really sucks, so I&#8217;ve been thinking about how to hack in literate haskell support into markdown. Well, turns out, it wasn&#8217;t that hard [...]]]></description>
			<content:encoded><![CDATA[<p>An unfortunate thing with this markdown framework I&#8217;ve been using is that it requires me to indent code blocks by four spaces (or a tab). Editing such text in a web browser really sucks, so I&#8217;ve been thinking about how to hack in literate haskell support into markdown. Well, turns out, it wasn&#8217;t that hard after all.</p>

<p>After some real simple modification to the <a href="http://www.dougalstanton.net/blog/index.php/2007/12/15/syntax-highlighting-with-markdown-in-wordpress">markdown+geshi patch</a> referenced in my <a href="http://olsner.se/?p=3">previous blog post</a> I now have literate haskell support! The modification literally took less time than writing this post <img src='http://olsner.se/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Find my new patch attached at the bottom of the page.</p>

<p>So &#8211; the testing! (This should render as normal text.)</p>

<p><div>
<pre class="haskell" style="font-family:monospace;"><span style="color: #339933; font-weight: bold;">&gt;</span> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:and"><span style="font-weight: bold;">and</span></a> <span style="background-color: #3cb371;">&quot;this&quot;</span> <span style="color: #5d478b; font-style: italic;">{-should-}</span> <span style="color: #5d478b; font-style: italic;">-- be rendered as haskell</span></pre>
</div></p>

<p>Now some normal text in between the haskell blocks, before we give haskell highlighting a run for its money.</p>

<p><div>
<pre class="haskell" style="font-family:monospace;"><span style="color: #339933; font-weight: bold;">&gt;</span> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:and"><span style="font-weight: bold;">and</span></a> <span style="color: #339933; font-weight: bold;">.</span> more <span style="color: #339933; font-weight: bold;">.</span> haskell <span style="color: #339933; font-weight: bold;">$</span> <span style="color: green;">&#91;</span><span style="color: red;">1</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">2</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">3</span><span style="color: green;">&#93;</span>
<span style="color: #339933; font-weight: bold;">&gt;</span> main <span style="color: #339933; font-weight: bold;">=</span> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:print"><span style="font-weight: bold;">print</span></a><span style="color: #339933; font-weight: bold;">.</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:take"><span style="font-weight: bold;">take</span></a>`<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:id"><span style="font-weight: bold;">id</span></a>`<span style="color: red;">20</span><span style="color: #339933; font-weight: bold;">$</span>fix<span style="color: #339933; font-weight: bold;">$</span><span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">.</span><span style="color: green;">&#41;</span><span style="color: #339933; font-weight: bold;">&lt;$&gt;</span><span style="color: green;">&#40;</span>:<span style="color: green;">&#41;</span><span style="color: #339933; font-weight: bold;">&lt;*&gt;</span><span style="color: green;">&#40;</span><span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">.</span><span style="color: green;">&#40;</span><span style="color: green;">&#40;</span>:<span style="color: green;">&#91;</span><span style="color: green;">&#93;</span><span style="color: green;">&#41;</span><span style="color: #339933; font-weight: bold;">.</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">=&lt;&lt;</span><span style="color: green;">&#41;</span><span style="color: #339933; font-weight: bold;">.</span><span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">*</span><span style="color: green;">&#41;</span><span style="color: #339933; font-weight: bold;">.</span><span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">*</span><span style="color: red;">2</span><span style="color: green;">&#41;</span><span style="color: green;">&#41;</span><span style="color: #339933; font-weight: bold;">$</span><span style="color: red;">1</span> <span style="color: #5d478b; font-style: italic;">-- print an interesting sequence</span></pre>
</div></p>

<p>End of test.</p>

<p>Anyway, here&#8217;s the <a href="http://olsner.se/wp-content/uploads/2008/02/markdown-lhs.patch">patch for markdown.php</a> (you&#8217;ll also need to cut-n-paste the highlight_helper.php file from <a href="http://www.dougalstanton.net/blog/index.php/2007/12/15/syntax-highlighting-with-markdown-in-wordpress">Dougal Stanton&#8217;s blog</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://olsner.se/2008/02/05/literate-haskell-blogging/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress, take 1</title>
		<link>http://olsner.se/2008/01/21/wordpress-take-1/</link>
		<comments>http://olsner.se/2008/01/21/wordpress-take-1/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 23:44:36 +0000</pubDate>
		<dc:creator>olsner</dc:creator>
				<category><![CDATA[Blogs about blogging]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[blosxom]]></category>
		<category><![CDATA[meta-blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog2.olsner.se/?p=3</guid>
		<description><![CDATA[This was way easier than blosxom, which after almost a whole day&#8217;s customization still looks like this. And that&#8217;s only after stealing dons&#8216; stylesheet and template. Plenty of stuff that doesn&#8217;t really work without hacking it in, or finding a plugin, or the right template (if it&#8217;s still around &#8211; the main blosxom page has [...]]]></description>
			<content:encoded><![CDATA[<p>This was way easier than blosxom, which after almost a whole day&#8217;s customization still looks like <a href="http://betablog.olsner.se/">this</a>. And that&#8217;s only after stealing <a href="http://cgi.cse.unsw.edu.au/~dons/blog">dons</a>&#8216; stylesheet and template. Plenty of stuff that doesn&#8217;t really work without hacking it in, or finding a plugin, or the right template (if it&#8217;s still around &#8211; the main blosxom page has plenty of broken links, esp. when it comes to plugins and &#8220;flavours&#8221;).</p>

<p>The whole WordPress installation took perhaps 10-15 minutes, and that&#8217;s including setting up the database, running the setup wizard, adding a new non-admin account in wordpress and installing markdown, wp-syntax and the <a href="http://www.dougalstanton.net/blog/index.php/2007/12/15/syntax-highlighting-with-markdown-in-wordpress">Syntax Highlighting with Markdown in WordPress</a> changes as recommended by <a href="http://conal.net/blog/posts/switching-blog-engines/">conal</a>.</p>

<p>And here&#8217;s some haskell code!</p>

<p><div>
<pre class="haskell" style="font-family:monospace;"><span style="color: #5d478b; font-style: italic;">-- Test some haskell code</span>
&nbsp;
fib <span style="color: #339933; font-weight: bold;">=</span> <span style="color: red;">1</span>:<span style="color: red;">1</span>:<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zipWith"><span style="font-weight: bold;">zipWith</span></a> <span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">+</span><span style="color: green;">&#41;</span> fib <span style="color: green;">&#40;</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:tail"><span style="font-weight: bold;">tail</span></a> fib<span style="color: green;">&#41;</span></pre>
</div></p>

<p>And now back in the blog text!</p>

<p><div>
<pre class="txt" style="font-family:monospace;">-- And a final line of haskell
main = mapM_ print . take 20 $ fib</pre>
</div></p>

<p>I guess this pretty much proves that WordPress is easier to use and more mature than blosxom. This may well become my long-in-planning programming and haskell blog!</p>

<p>There&#8217;s a little bit of a problem though. The second run of code lines above becomes highlighted as plain text &#8211; this is because the first code block is marked <code>{{lang:haskell}}</code> while the second one isn&#8217;t. What I&#8217;d like here is for them to keep the same language as the previous code block, which would be nice for any literal-haskell-ish blog posts I might post later on. And I <em>really</em> don&#8217;t want to have to write <code>{{lang:haskell}}</code> every other line of blog post. I could of course let haskell be the default rather than text, but what if I want to blog about some other language? Hmm&#8230; Let&#8217;s see if I get around to hacking markdown/highlighting any time soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://olsner.se/2008/01/21/wordpress-take-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

