[ic] Textile filter tip

Stefan Hornburg racke at linuxia.de
Sun Jun 27 05:41:22 EDT 2004


On Fri, 25 Jun 2004 12:50:55 -0500
Joshua Lavin <joshua at kingdomdesign.com> wrote:

> Textile allows shorthand for common HTML formatting. I am using it to 
> allow easy entry of item details.
> 
> Example:
> Entered into item's comment field >>>
> 
> The most _wonderful_ book ever written.
> 
> * 186 pages
> * paperback
> 
> <<< becomes this when called with [filter textile][item-field 
> comment][/filter]: >>>
> 
> The most <em>wonderful</em> book ever written.
> 
> <ul>
>   <li>186 pages</li>
>   <li>paperback</li>
> </ul>
> 
> <<<
> 
> There are more shorthand tricks (see the Perl module's documentation). 
> To add a Textile filter, follow these steps:
> 
> 1. Install the Text::Textile CPAN module.
>     ( http://search.cpan.org/~tomi/Text-Textile-0.6/ )
> 
> 2. Add the following GlobalSub at the end of interchange.cfg:
> 
> # Textile filter:
> 
> GlobalSub <<EOR
> sub textile {
>      BEGIN {
>          package Vend::Interpolate;
>          use Text::Textile;
>          $Filter{textile} = sub {
>                                  my $textile = new Text::Textile;
>                                  my $val = $textile->process(shift);
>                                  return $val;
>                                 };
>      }
> }
> EOR
> 
> 3. Restart Interchange.
> 
> This is my first try at a new filter; comments welcome.

Please note that this hack to add a filter is no longer required with
Interchange 5.x, check $ICDIR/code/Filter for examples.

Bye
	Racke


-- 
Upcoming Talks and Presentations:
Linuxtag 2004, 25. Juni: Courier Mail Server (http://www.linuxtag.org/)
Perlworkshop 2004, 30. Juni: Entwicklung großer Perlanwendungen 
am Beispiel von Interchange (http://www.perlworkshop.de/)



More information about the interchange-users mailing list