<?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>Matt Stine&#039;s Blog &#187; textile</title>
	<atom:link href="http://mattstine.com/category/textile/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattstine.com</link>
	<description>Thoughts on Java, Groovy, Grails, Agile Development, etc. etc. etc.</description>
	<lastBuildDate>Tue, 17 May 2011 17:02:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mattstine.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Matt Stine&#039;s Blog &#187; textile</title>
		<link>http://mattstine.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mattstine.com/osd.xml" title="Matt Stine&#039;s Blog" />
	<atom:link rel='hub' href='http://mattstine.com/?pushpress=hub'/>
		<item>
		<title>Need a Textile engine? Look no further than Plextile!</title>
		<link>http://mattstine.com/2009/03/26/need-a-textile-engine-look-no-further-than-plextile/</link>
		<comments>http://mattstine.com/2009/03/26/need-a-textile-engine-look-no-further-than-plextile/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 21:23:46 +0000</pubDate>
		<dc:creator>mattstine</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[textile]]></category>

		<guid isPermaLink="false">http://www.mattstine.com/?p=81</guid>
		<description><![CDATA[In finishing up the first release of JUG Nexus, the open source engine (http://github.com/mstine/jug-nexus/tree/master) behind the new Memphis JUG website, I needed to put a good Textile engine in place. I really don&#8217;t care for writing actual HTML in a content management system, and JUG Nexus being a lightweight CMS, I wanted a lightweight markup [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=81&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In finishing up the first release of JUG Nexus, the open source engine (<a href="http://github.com/mstine/jug-nexus/tree/master">http://github.com/mstine/jug-nexus/tree/master</a>) behind the new Memphis JUG website, I needed to put a good <a href="http://www.textism.com/tools/textile/">Textile</a> engine in place. I really don&#8217;t care for writing actual HTML in a content management system, and JUG Nexus being a lightweight CMS, I wanted a lightweight markup syntax for entering the details of upcoming JUG meetings. Textile is exactly that, and is also used for entering content into the very useful <a href="http://jugevents.org">JUGEvents</a> system produced by <a href="http://www.jugpadova.it/">JUG Padova</a> for the Java User Group community at large. I tried out several different engines, and none of them seemed to be very robust when it came to edge cases in the markup. For example, if I want to produce a hyperlink to a website, the textile format is the following:</p>
<p><code><br />
"Linked Text":http://www.site.com<br />
</code></p>
<p>This syntax will result in the following HTML:</p>
<pre class="brush: xml">
&lt;a href="http://www.site.com"&gt;Linked Text&lt;/a&gt;
</pre>
<p>Unfortunately, if you have a bang (!) in your &#8220;Linked Text,&#8221; most of the Textile engines that I used would not recognize it as an HTML link. Plextile does!</p>
<p>The only drawback, however minimal, to using Plextile is that it does not come with a pre-packaged JAR file. You have to take the compiled code and JAR it yourself. Now, for free, I&#8217;ll include how I integrated Plextile with Grails. Grails has a very nice codec feature that provides a facility to register encoders and decoders of textual data as methods on any object. Grails searches for classes following the convention <code>XCodec</code> and dynamically registers <code>encodeAsX</code> and <code>decodeX</code> methods on <code>java.lang.Object</code> so that any data can be encoded and decoded. Enter the <code>TextileCodec</code>:</p>
<pre class="brush: groovy">
import com.plink.plextile.TextParser

class TextileCodec {

   static encode = {str -&gt;
      new TextParser().parseTextile(str, true)
   }

}
</pre>
<p>Believe it or not, that&#8217;s it! Here&#8217;s the GSP template for rendering a JUG meeting:</p>
<pre class="brush: xml">
&lt;div class="post"&gt;
  &lt;h2&gt;${event.title}&lt;br/&gt;&lt;br/&gt;&lt;g:formatDate format="EEEE, MMMM dd, yyyy" date="${event.startTime}"/&gt;&lt;br/&gt;&lt;g:formatDate format="h:mm" date="${event.startTime}"/&gt;-&lt;g:formatDate format="h:mm a" date="${event.endTime}"/&gt;&lt;br/&gt;&lt;g:if test="${!event.archived}"&gt;&lt;a href="http://jugevents.org/jugevents/event/${event.jugEventsId}"&gt;Click HERE to register!&lt;/a&gt;&lt;/g:if&gt;&lt;/h2&gt;
  &lt;div class="entry"&gt;
    &lt;h2 class="title"&gt;Speaker/Topic:&lt;/h2&gt;
    &lt;p&gt;${event.description.encodeAsTextile()}&lt;/p&gt;
    &lt;h2 class="title"&gt;Location/Directions:&lt;/h2&gt;
    &lt;p&gt;${event.location}&lt;/p&gt;
    &lt;p&gt;${event.directions.encodeAsTextile()}&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattstine.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattstine.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattstine.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattstine.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattstine.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattstine.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattstine.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattstine.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattstine.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattstine.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattstine.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattstine.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattstine.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattstine.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mattstine.com&amp;blog=58954&amp;post=81&amp;subd=mattstine&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mattstine.com/2009/03/26/need-a-textile-engine-look-no-further-than-plextile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1eaa45fee6a2b0c4b479b2982a4274f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattstine</media:title>
		</media:content>
	</item>
	</channel>
</rss>
