An Unofficial Enhanced Version of Textile 2.0 beta

Colin Brown, June 2004 (Last Updated: 18th October 2006)

Update: Official Version of Textile 2.0 Released

As of October 2006, this patched version is no longer required; I recommend you download and use the official release of Textile 2.0, which includes all of the fixes and enhancements my patch does. It also has the benefit of being actively maintained!

Introduction

I've recently become a heavy user of the php version of textile. I really wanted some of the features I had seen documented in Brad Choate’s perl version, and being the impatient soul that I am, I rolled up my sleeves and dived in to the code. If you are as impatient as me, you can skip straight to the download: zipped / gzipped (or as a WordPress plugin zipped / gzipped). If you're not sure what to do with the files read the installation instructions.

Let me make it clear that this is not an official release of Textile. It has not been approved by Dean Allen, the original author. Use it at your peril. I can say, however, that it doesn't eat babies or kill kittens. Post feedback here. I hope by using the name Textile on this page I am not breaking Dean's licence, but since he is releasing his great software under the GPL now I don't think I am. Here's a detailed breakdown of the changes I made to the code.

Here's what I've added:

  1. Implemented extended block syntax (BC’s Documentation)
  2. Improved handling of preformatted text (paragraph tags are no longer inserted into blocks of preformatted text)
  3. Implemented a new block modifier, bc (BC’s Documentation). Lines prefixed with bc. or blocks prefixed with bc.. are not formatted by Textile (although html entities such as < and > are converted to &lt; and &gt;) and are wrapped in <pre><code></pre></code>
  4. Implemented block escaping (BC’s Documentation). Blocks preceded by == and ending with == are not processed by Textile. Note that the escaped block must be preceeded by a blank line, e.g.
    	
    		paragraph 1	
    		
    		==
    		escaped stuff
    		==
    		
    		paragaph 2
    		

    will work, but

    		paragraph 1	
    		==
    		escaped stuff
    		==
    		
    		paragaph 2
    		

    will not.

Installation Instructions

Textpattern Users

  1. Make a backup copy of your original version of classTextile.php, which you will find in <your textpattern home directory>/textpattern/lib/
  2. Download a copy of classTextile.php zipped or gzipped
  3. Unzip the file
  4. Copy the version you unzipped into <your textpattern home directory>/textpattern/lib

That should do it. I haven't tested this so please let me know if it doesn't work

WordPress Users

  1. Download a copy of textile2cb.php zipped or gzipped
  2. Unzip the file
  3. Copy the file to <your wordpress home directory>/wp-content/plugins/
  4. Go to the "Plugins" menu option in WordPress, disable all other versions of Textile and enable "Textile 2cb"