<?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>Marcus Hellberg</title>
	<atom:link href="http://www.marcushellberg.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marcushellberg.com</link>
	<description>blog.</description>
	<lastBuildDate>Wed, 01 Dec 2010 07:41:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Missing feature in the iPhone mail client?</title>
		<link>http://www.marcushellberg.com/2010/12/01/missing-feature-in-the-iphone-mail-client/</link>
		<comments>http://www.marcushellberg.com/2010/12/01/missing-feature-in-the-iphone-mail-client/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 07:41:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Phones]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=281</guid>
		<description><![CDATA[Even though the iPhone Mail client is arguably the best mail client on a mobile device, I still feel that it&#8217;s missing a crucial feature. Even Nokia phones that didn&#8217;t support receiving HTML formatted mail until recently, have had this feature for ages. I&#8217;m talking about scheduled mail downloading. I don&#8217;t read mail when I [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Even though the iPhone Mail client is arguably the best mail client on a mobile device, I still feel that it&#8217;s missing a crucial feature. Even Nokia phones that didn&#8217;t support receiving HTML formatted mail until recently, have had this feature for ages.</p>
<p>I&#8217;m talking about scheduled mail downloading. I don&#8217;t read mail when I sleep. I also do not want any work-related mail on weekends. On my Nokia, I could easily set it to fetch mail Mon-Fri 8:00–17:00. If I want the same functionality on my iPhone I need to go to the advanced mail settings twice daily to manually switch fetching on or off.</p>
<p>This is such a simple feature, that I&#8217;m honestly confused that Apple hasn&#8217;t included it in the client. Or am I just missing something?</p>
<div class="shr-publisher-281"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/12/01/missing-feature-in-the-iphone-mail-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Swimming in crap</title>
		<link>http://www.marcushellberg.com/2010/11/29/swimming-in-crap/</link>
		<comments>http://www.marcushellberg.com/2010/11/29/swimming-in-crap/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 19:12:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[crap]]></category>
		<category><![CDATA[gym]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=277</guid>
		<description><![CDATA[What&#8217;s the first thing that you feel like doing after a sweaty workout? If your answer isn&#8217;t swimming in crap, you might want to stay clear of Motivus in Turku. When I came to the gym, I noticed that the floor in the bathroom was wet, but didn&#8217;t pay much attention to it. When I [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>What&#8217;s the first thing that you feel like doing after a sweaty workout? If your answer isn&#8217;t swimming in crap, you might want to stay clear of <a href="http://www.motivus.fi/kuntokeskukset/centrum/">Motivus in Turku</a>.</p>
<p>When I came to the gym, I noticed that the floor in the bathroom was wet, but didn&#8217;t pay much attention to it. When I got back from my workout, getting ready to hit the showers I noticed that the floor wasn&#8217;t only wet, it was flooded. And it wasn&#8217;t flooded with just water. No – there were floaters. And toilet paper. Ugh.</p>
<p><a href="http://www.marcushellberg.com/wp-content/uploads/2010/11/photo.jpg"><img class="aligncenter size-medium wp-image-278" title="photo" src="http://www.marcushellberg.com/wp-content/uploads/2010/11/photo-224x300.jpg" alt="" width="224" height="300" /></a></p>
<p>On my way out, I asked the person at the front desk if they were aware that their bathroom was overflowing with crap. She said that they knew, but couldn&#8217;t do anything about it before a plumber got there. How about you tell me next time, so I can go home before I stand there ankle deep in crap?</p>
<div class="shr-publisher-277"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/11/29/swimming-in-crap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spotify iPhone app forgetting how to multitask</title>
		<link>http://www.marcushellberg.com/2010/11/27/spotify-iphone-app-forgetting-how-to-multitask/</link>
		<comments>http://www.marcushellberg.com/2010/11/27/spotify-iphone-app-forgetting-how-to-multitask/#comments</comments>
		<pubDate>Sat, 27 Nov 2010 15:47:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[Phones]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[spotify]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=274</guid>
		<description><![CDATA[Spotify on the iPhone seems to have a weird &#8220;feature&#8221;, where it forgets how to multitask every once in a while. It plays music fine, but immediately when you lock the screen or background it, it fades out the music and stops. Sometimes, it starts working by quitting the app from the task switcher and [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Spotify on the iPhone seems to have a weird &#8220;feature&#8221;, where it forgets how to multitask every once in a while. It plays music fine, but immediately when you lock the screen or background it, it fades out the music and stops.</p>
<p>Sometimes, it starts working by quitting the app from the task switcher and restarting. Most of the times, however, I need to restart my phone to get it working, which is really annoying. So far, Spotify has been by far the #1 reason for rebooting my iPhone.</p>
<p>Strange.</p>
<div class="shr-publisher-274"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/11/27/spotify-iphone-app-forgetting-how-to-multitask/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling AirPrint in OS X 10.6.5</title>
		<link>http://www.marcushellberg.com/2010/11/25/enabling-airprint-in-os-x-10-6-5/</link>
		<comments>http://www.marcushellberg.com/2010/11/25/enabling-airprint-in-os-x-10-6-5/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 14:37:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=270</guid>
		<description><![CDATA[For some reason Apple decided to remove support for AirPrint at the last moment before shipping the newest update of OS X. Of course, it didn&#8217;t take long for people to figure out how to fix that. All you had to do was download three files that were included in prerelease versions of the update. [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>For some reason Apple decided to remove support for AirPrint <a href="http://www.engadget.com/2010/11/10/mac-os-x-10-6-5-update-available-now/">at the last moment before shipping</a> the newest update of OS X.</p>
<p>Of course, it didn&#8217;t take long for people to figure out how to fix that. All you had to do was download three files that were included in prerelease versions of the update. Now, downloading different files and putting them in the correct location is a pain. Fortunately, the good people at <a href="http://netputing.com/">Netputing</a> have released <a href="http://netputing.com/airprinthacktivator/">AirPrint Hacktivator</a> that includes these files and handles all the tricky stuff.</p>
<p><a href="http://www.marcushellberg.com/wp-content/uploads/2010/11/Screen-shot-2010-11-25-at-4.26.31-PM.png"><img class="aligncenter size-full wp-image-271" title="Screen shot 2010-11-25 at 4.26.31 PM" src="http://www.marcushellberg.com/wp-content/uploads/2010/11/Screen-shot-2010-11-25-at-4.26.31-PM.png" alt="" width="318" height="270" /></a></p>
<p>Download the file, enable AirPrint and you&#8217;re almost done. The only annoying thing is that you need to re-add all your printers before you can print to them.</p>
<p>At least my Samsung printer worked like a charm.</p>
<p><a href="http://www.marcushellberg.com/wp-content/uploads/2010/11/photo.png"><img class="aligncenter size-full wp-image-272" title="photo" src="http://www.marcushellberg.com/wp-content/uploads/2010/11/photo.png" alt="" width="320" height="480" /></a></p>
<div class="shr-publisher-270"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/11/25/enabling-airprint-in-os-x-10-6-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Post-Its</title>
		<link>http://www.marcushellberg.com/2010/11/25/post-its/</link>
		<comments>http://www.marcushellberg.com/2010/11/25/post-its/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 14:23:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=262</guid>
		<description><![CDATA[Post-it notes are awesome. They are my #1 tool in keeping focused on things I&#8217;m doing instead of worrying about what I should be doing. If I&#8217;m doing something but start thinking about having to do something else, I write it down on a post-it note and continue working on it. Having it written down [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Post-it notes are awesome. They are my #1 tool in keeping focused on things I&#8217;m doing instead of worrying about what I should be doing.</p>
<p>If I&#8217;m doing something but start thinking about having to do something else, I write it down on a post-it note and continue working on it. Having it written down lets me concentrate on what I&#8217;m doing, as I don&#8217;t have to try to keep the next ten things I need to do in my head at the same time.</p>
<p>A post-it note is also useful as it can only fit a limited amount of things to do – just like your day. Mark McGuinnes wrote about a similar thing in his blog post <a href="http://the99percent.com/tips/6945/if-it-wont-fit-on-a-post-it-it-wont-fit-in-your-day">If It Won&#8217;t Fit On A Post-It, It Won&#8217;t Fit In Your Day</a>.</p>
<p>I use one post it TODO-note per day. Having limited space to write down things you need to do that day will force you to think about what you can realistically get done in a day.</p>
<div class="shr-publisher-262"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/11/25/post-its/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting things done</title>
		<link>http://www.marcushellberg.com/2010/11/15/getting-things-done/</link>
		<comments>http://www.marcushellberg.com/2010/11/15/getting-things-done/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 18:15:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[planning]]></category>
		<category><![CDATA[procrastination]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=244</guid>
		<description><![CDATA[I am at this moment Working Writing a thesis Taking three university courses This means that the amount of things that I need to do can easily become overwhelming at times. The trick to managing all the things I have to do and simply get them done is, however, quite simple. To make the seemingly [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I am at this moment</p>
<ol>
<li>Working</li>
<li>Writing a thesis</li>
<li>Taking three university courses</li>
</ol>
<p>This means that the amount of things that I need to do can easily become overwhelming at times. The trick to managing all the things I have to do and simply get them done is, however, quite simple.</p>
<p>To make the seemingly impossible amount of tasks that need to be done more manageable, there are a few things you need:</p>
<ol>
<li>A clear picture of what needs to be done</li>
<li>A plan</li>
<li>Perseverance</li>
</ol>
<p>The first step towards minimizing the feeling of being overwhelmed and not getting anything done is to actually figure out what exactly you need to have done. And when do  you need to have this done by?</p>
<p>For me, this step works miracles. Now, instead of constantly having a feeling of &#8220;there&#8217;s something I should be doing right now,&#8221; I know exactly what I should be doing and in which order I need to do it.</p>
<p>Now, if the deadlines you have still seem impossible, <em>negotiate</em>. Deadlines are almost always negotiable. The important thing is that you let others know <strong>ahead of time</strong> that you need to move a deadline. Usually, you can get the deadline moved a few days to make it fit your schedule.</p>
<p>The next step is having a <em>plan</em>. This may seem trivial, but many still seem to skip this part. I usually make a quick plan for the next week on a Sunday, based on the list of things I need to get done. This is a very rough plan, usually just putting down a task or two per day.</p>
<p>The beauty of having a plan is that instead of having a goal like &#8220;write for three hours,&#8221; I have a goal &#8220;finish chapter on Test-Driven Development.&#8221; With a clear goal in mind, at least for me, it&#8217;s much easier to get things done.</p>
<p>The last thing is perseverance. Unfortunately, there is only so much you can hack and optimize. At a certain point you have to just sit down and do the work. If you find that you spend most of your time trying to optimize what you are doing, you should probably stop and concentrate on doing the thing that needs to be done instead.</p>
<p>Oh, I almost forgot. Make sure that when you plan, that you leave in time for sports and free time. I strive to keep at least one day a week entirely off work. A human brain is not a machine, it needs to rest. Working long days every day may work for a while, but in the long run it&#8217;ll hurt your productivity. Make sure you get enough rest, and you&#8217;ll be able to handle the rest of your work much more effectively.</p>
<div class="shr-publisher-244"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/11/15/getting-things-done/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dear Apple</title>
		<link>http://www.marcushellberg.com/2010/11/15/dear-apple/</link>
		<comments>http://www.marcushellberg.com/2010/11/15/dear-apple/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 17:32:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[rants]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/2010/11/15/dear-apple/</guid>
		<description><![CDATA[I pay for unlimited 3G for a reason: to use it. Why are you imposing an arbitrary download limit of 20 MB on files I download over 3G? I want to be able to take advantage of the service I&#8217;m paying for. If some operators require you to limit this size (looking at you, AT&#38;T), [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I pay for unlimited 3G for a reason: to use it. Why are you imposing an arbitrary download limit of 20 MB on files I download over 3G? I want to be able to take advantage of the service I&#8217;m paying for.</p>
<p>If some operators require you to limit this size (looking at you, AT&amp;T), you should do this on a operator-by-operator basis, not punish your entire user base.</p>
<p><a href="http://www.marcushellberg.com/wp-content/uploads/2010/11/download_limit.png"><img class="aligncenter size-full wp-image-255" title="download_limit" src="http://www.marcushellberg.com/wp-content/uploads/2010/11/download_limit.png" alt="" width="320" height="480" /></a></p>
<div class="shr-publisher-252"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/11/15/dear-apple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eight months</title>
		<link>http://www.marcushellberg.com/2010/11/13/eight-months/</link>
		<comments>http://www.marcushellberg.com/2010/11/13/eight-months/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 13:02:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=240</guid>
		<description><![CDATA[So, apparently it has been eight months since I last updated my blog. Wow. That&#8217;s just incredibly lame. Like 95% of all blogs (fun fact, 84% of all facts are made up on the spot), I started with a bang and then eventually forgot about blogging altogether. It just sunk too low on my TODO-list that [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>So, apparently it has been eight months since I last updated my blog. Wow. That&#8217;s just incredibly lame.</p>
<p>Like 95% of all blogs (fun fact, 84% of all facts are made up on the spot), I started with a bang and then eventually forgot about blogging altogether. It just sunk too low on my TODO-list that finally it fell off.</p>
<p>Maybe the problem is that I&#8217;ve been too strict with keeping my blog tech-related. Sure, I work with technology and spend much of my free time with it, but it&#8217;s far from being the only thing in my life. I think that in the future, I&#8217;ll view my blog as an extended Twitter, a place where I can comment on things I find interesting and maybe spark a little discussion if someone else also finds that particular thing interesting.</p>
<p>No promises this time, we&#8217;ll see how it goes <img src='http://www.marcushellberg.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="shr-publisher-240"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/11/13/eight-months/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update</title>
		<link>http://www.marcushellberg.com/2010/03/20/update/</link>
		<comments>http://www.marcushellberg.com/2010/03/20/update/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 12:39:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Info]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[touchkit]]></category>
		<category><![CDATA[vaadin]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=235</guid>
		<description><![CDATA[So apparently I haven&#8217;t updated my blog in quite a while. Quite a lot has happened since the last update. I started working at IT Mill, the company behind the Vaadin framework.I&#8217;ve gotten off to a good start, I&#8217;m currently working on something I call TouchKit. It&#8217;s a combination of a few custom components and [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>So apparently I haven&#8217;t updated my blog in quite a while. Quite a lot has happened since the last update.</p>
<p>I started working at IT Mill, the company behind the <a href="http://vaadin.com">Vaadin framework</a>.I&#8217;ve gotten off to a good start, I&#8217;m currently working on something I call TouchKit. It&#8217;s a combination of a few custom components and extensions to Vaadin that allows you to create web applications that look like iPhone applications using nothing but Java. Check out the video preview below:</p>
<p><object width="400" height="738"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10278516&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10278516&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="738"></embed></object></p>
<p>Well, that&#8217;s all for now. I&#8217;ll try to get back to the habit of updating the blog a bit more often again <img src='http://www.marcushellberg.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div class="shr-publisher-235"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/03/20/update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Textile to XHTML converter</title>
		<link>http://www.marcushellberg.com/2010/01/22/textile-to-xhtml-converter/</link>
		<comments>http://www.marcushellberg.com/2010/01/22/textile-to-xhtml-converter/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 11:42:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=225</guid>
		<description><![CDATA[A while back, I needed to quickly write some documentation that needed to be in XHTML format. Writing in plain XHTML is a pain, so I decided to write the documentation in Textile and then convert it to XHTML before publishing. The problem I found was that all Textile converters were made for use in [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>A while back, I needed to quickly write some documentation that needed to be in XHTML format. Writing in plain XHTML is a pain, so I decided to write the documentation in Textile and then convert it to XHTML before publishing.</p>
<p>The problem I found was that all Textile converters were made for use in blogs and other online tools. What I needed was a good old-fashioned command line program to convert a given textile file into XHTML.</p>
<p>Fortunately, using Ruby and the excellent RedCloth gem, I could write a small script to accomplish this in a few minutes.</p>
<p>If you have any similar needs, copy the source into a file named textile2html, make it executable (chmod +x) and place it somewhere in your path. Then all you have to do is call textile2html with the textile file as an argument:</p>
<pre>$ textile2html documentation.textile</pre>
<pre class="brush:ruby">#!/usr/bin/env ruby -wKU
require "rubygems"
require "RedCloth"

if ARGV.size != 1
puts "Usage: textile2html file.textile"
exit
end

# Read input file
textile_string = ""
begin
  input_file = File.new(ARGV[0], "r")
  input_file.each do |line|
    textile_string+=line
  end
  input_file.close
rescue
  puts "Could not read input file."
  exit
end

# Create output file
filename = ARGV[0].gsub(/\.\w+$/, "")
begin
  output_file = File.new("#{filename}.html", "w")
rescue
  puts "Could not create output file."
  exit
end

html_header = &lt;&lt;DOC
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;
&lt;head&gt;
&lt;title&gt;
DOC

html_header += filename;
html_header += &lt;&lt;DOC
&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
DOC

html_footer = &lt;&lt;DOC
&lt;/body&gt;
&lt;/html&gt;
DOC

html_output = RedCloth.new(textile_string).to_html
output_file.puts(html_header)
output_file.puts(html_output)
output_file.puts(html_footer)
output_file.close

puts "Done."
</pre>
<p>Questions? Comments? Post them below.</p>
<div class="shr-publisher-225"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/01/22/textile-to-xhtml-converter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

