<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>bajada·net » live</title>
	
	<link>http://www.bajada.net</link>
	<description />
	<pubDate>Tue, 19 Aug 2008 00:10:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/bajada-net" type="application/rss+xml" /><item>
		<title>Textile lists without the rest</title>
		<link>http://feeds.feedburner.com/~r/bajada-net/~3/335508604/textile-lists-without-the-rest</link>
		<comments>http://www.bajada.net/2008/07/textile-lists-without-the-rest#comments</comments>
		<pubDate>Mon, 14 Jul 2008 22:49:33 +0000</pubDate>
		<dc:creator>J.M. Dodd</dc:creator>
		
		<category><![CDATA[code]]></category>

		<category><![CDATA[textile]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.bajada.net/?p=374</guid>
		<description><![CDATA[<p>I have a client who wanted a way of doing lists without all of the coding overhead, and without using the visual editor in WordPress. I immediately thought of Textile, and installed TextileWrapper. It worked great for lists. However, it munged in a spectacular way the rest of the site, riding roughshod over her existing [&#8230;]</p>]]></description>
			<content:encoded><![CDATA[<p>I have a client who wanted a way of doing lists without all of the coding overhead, and without using the visual editor in WordPress. I immediately thought of Textile, and installed <a href="http://huddledmasses.org/textilewrapper-20-and-geshiwrapper-14/">TextileWrapper</a>. It worked great for lists. However, it munged in a spectacular way the rest of the site, riding roughshod over her existing markup.</p>

<p>I tend to give each site that I make a custom WordPress plugin of bits and pieces that come in handy. Filters for text, little functions like <code>time_since()</code> and <code>has_tags()</code>, that sort of thing. To this, I added the following:</p>

<div class="code php" style="font-family: monospace;">
<span style="color: #b1b100;">require_once</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;classTextile.php&quot;</span> <span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> textile<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$s</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&nbsp; <br />
&nbsp; <span style="color: #0000ff;">$textile</span> = <span style="color: #000000; font-weight: bold;">new</span> Textile;<br />
&nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$textile</span>-&gt;<span style="color: #006600;">fList</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$s</span> <span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> textile_lists<span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$c</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <br />
&nbsp; <span style="color: #b1b100;">return</span> <a href="http://www.php.net/preg_replace_callback"><span style="color: #000066;">preg_replace_callback</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;/^[#*]+?.*.(^[^#*])/smU&quot;</span> , <span style="color: #ff0000;">&quot;textile&quot;</span> , <span style="color: #0000ff;">$c</span> <span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<br />
add_filter<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'the_content'</span> , <span style="color: #ff0000;">'textile_lists'</span> , <span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span>;<br />
add_filter<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'the_excerpt'</span> , <span style="color: #ff0000;">'textile_lists'</span> , <span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #808080; font-style: italic;">// add_filter( 'comment_text' , 'textile_lists' , 6);</span>
</div>

<p>I also uploaded <code>classTextile.php</code> to the <code>plugins</code> directory.</p>

<p>A caveat: it gets a teensy bit wonky when the list is the last thing in the entry and there is no linebreak after the last entry in the list. Just make sure there&#8217;s a linebreak after the last list item and everything will be fine.</p><img src="http://feeds.feedburner.com/~r/bajada-net/~4/335508604" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bajada.net/2008/07/textile-lists-without-the-rest/feed</wfw:commentRss>
		<feedburner:origLink>http://www.bajada.net/2008/07/textile-lists-without-the-rest</feedburner:origLink></item>
	</channel>
</rss>
