[ic] Textile filter tip

Mark Walther waltron at earthlink.net
Fri Jun 25 14:47:53 EDT 2004


Joshua,
    Is you code version Text-Textile-0.6 based on their current version 
of MT-Textile 2.02?
Mark
Joshua Lavin 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.
>
> -- 
> Josh Lavin
> Kingdom Design   http://www.kdw.us/
>
> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>



More information about the interchange-users mailing list