<?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>Jabbering Giraffe &#187; textile</title>
	<atom:link href="http://happygiraffe.net/blog/tag/textile/feed/" rel="self" type="application/rss+xml" />
	<link>http://happygiraffe.net/blog</link>
	<description></description>
	<lastBuildDate>Wed, 19 Oct 2011 10:40:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>S5 with textile</title>
		<link>http://happygiraffe.net/blog/2006/01/30/s5-with-textile/</link>
		<comments>http://happygiraffe.net/blog/2006/01/30/s5-with-textile/#comments</comments>
		<pubDate>Mon, 30 Jan 2006 00:10:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[s5]]></category>
		<category><![CDATA[textile]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2006/01/30/s5-with-textile/</guid>
		<description><![CDATA[I&#8217;ve started working on a presentation for skillswap. Like any paranoid coder, I want to keep my work under revision control, so I prefer a text based format. Of these, the best option presently seems to be S5. But it &#8230; <a href="http://happygiraffe.net/blog/2006/01/30/s5-with-textile/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started working on a presentation for  <a href="http://www.skillswap.org/">skillswap</a>.  Like any paranoid coder, I want to keep my work under revision control, so I prefer a text based format.  Of these, the best option presently seems to be <a href="http://meyerweb.com/eric/tools/s5/">S5</a>.  But it does require you to write a fair chunk of <span class="caps">HTML</span>.  These days though, I prefer <a href="http://hobix.com/textile/">textile</a>.</p>
<p>So, I wrote a small standalone textile processor in ruby:</p>
<pre>
#!/usr/bin/env ruby
require 'rubygems'
require_gem 'RedCloth'
puts RedCloth.new(File.new(ARGV[0]).read).to_html
</pre>
<p>This, combined with a small Makefile lets me build the S5 presentation quite simply from the textile file.</p>
<pre>
index.html: s5-head.html vc-intro-svn.txt s5-foot.html
        (cat s5-head.html; \
         ./textile vc-intro-svn.txt; \
         cat s5-foot.html) &gt; $@
</pre>
<p>The only mildly irritating limitation is that you still have to explicitly wrap the slides in <code>&lt;div class='slide'&gt;...&lt;/div&gt;</code>.  But I can live with that.</p>
<p>There was still one thing missing though.  If you printed out the presentation, all the links wouldn&#8217;t show up.  Because textile outputs well formed xhtml, it was a simple matter to use a small bit of <span class="caps">XSLT</span> to harvest the links on each slide and insert a handout div listing them.</p>
<pre>
&lt;xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:output omit-xml-declaration="yes"/&gt;
  &lt;xsl:template match="@* | node()"&gt;
    &lt;xsl:copy&gt;
      &lt;xsl:apply-templates select="@* | node()"/&gt;
    &lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;
  &lt;xsl:template match="div[@class='slide']"&gt;
    &lt;div class="slide"&gt;
      &lt;xsl:apply-templates/&gt;
      &lt;xsl:if test=".//a"&gt;
        &lt;div class="handout"&gt;
          &lt;p&gt;Links from the slide:&lt;/p&gt;
          &lt;ul&gt;
            &lt;xsl:for-each select=".//a"&gt;
              &lt;li&gt;
                &lt;xsl:value-of select="."/&gt;
                &lt;xsl:text&gt;: &lt;/xsl:text&gt;
                &lt;a href="{@href}"&gt;&lt;xsl:value-of select="@href"/&gt;&lt;/a&gt;
              &lt;/li&gt;
            &lt;/xsl:for-each&gt;
          &lt;/ul&gt;
        &lt;/div&gt;
      &lt;/xsl:if&gt;
    &lt;/div&gt;
  &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
</pre>
<p>Like all <span class="caps">XSLT</span>, it looks more verbose than it actually is (something it shares with Java, <span class="caps">IMHO</span>).  But it serves a useful purpose.  Now, the printed slides  aren&#8217;t lacking in information.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2006/01/30/s5-with-textile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vim Syntax for Textile</title>
		<link>http://happygiraffe.net/blog/2006/01/25/vim-syntax-for-textile/</link>
		<comments>http://happygiraffe.net/blog/2006/01/25/vim-syntax-for-textile/#comments</comments>
		<pubDate>Wed, 25 Jan 2006 02:50:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[textile]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2006/01/25/vim-syntax-for-textile/</guid>
		<description><![CDATA[I&#8217;ve been using textile more and more these days. It&#8217;s quite convenient for writing. But what&#8217;s annoying is that there is no support for it in Vim. So, after a bit of messing around with the vim manual Your own &#8230; <a href="http://happygiraffe.net/blog/2006/01/25/vim-syntax-for-textile/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://textism.com/tools/textile/">textile</a> more and more these days.  It&#8217;s quite convenient for writing.</p>
<p>But what&#8217;s annoying is that there is no support for it in <a href="http://www.vim.org/">Vim</a>.</p>
<p>So, after a bit of messing around with the vim manual <a href="http://vimdoc.sourceforge.net/htmldoc/usr_44.html">Your own syntax highlighted</a>, I now have <a href="http://happygiraffe.net/svn/public/vim/trunk/textile.vim">textile.vim</a>.</p>
<p>It&#8217;s definitely a first attempt at such things.  There&#8217;s a lot that it doesn&#8217;t do.  But for an hours work, it&#8217;s started to highlight textile files well enough for me.</p>
<p><strong>Update:</strong> PlasticBoy has a similar <a href="http://plasticboy.com/markdown-vim-mode/">Vim syntax for Markdown</a>.  I should take a look and get some ideas from there&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2006/01/25/vim-syntax-for-textile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

