[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mason
Subject:    [Mason] Textile filter for Mason components
From:       Giovanni Pensa <menozero () gmail ! com>
Date:       2005-04-14 10:37:08
Message-ID: dad1c03205041403372f652b34 () mail ! gmail ! com
[Download RAW message or body]

Hi.  I just wanted to say how easy is to use *Textile* in a Mason component.

"Textile":http://www.textism.com/tools/textile/ by "Dean
Allen":http://www.textism.com/about/ is "A Humane Web Text Generator",
that is a filter (originally in PHP) that transforms plain text with
simple markup in HTML.

Using the "Perl version":http://bradchoate.com/mt-plugins/textile/ by
Brad Choate is possible to write Mason components in Textile and let
Mason transform them in HTML.  This is especially useful for long
blocks of text.

Textile transforms blocks of text into <p>aragraphs, manages lists and
tables, and *bold* and _italic_ text.  (Automatic "curly quotation
marks" are disabled in the Perl version.)  Et cetera.

Just putting three lines at the end of the file seems to work:

    <%init> return if $m->cache_self; </%init>
    <%once> use Text::Textile qw(textile); </%once>
    <%filter> $_ = textile($_); </%filter>

Another option could be
"Markdown":http://daringfireball.net/projects/markdown/ and
"SmartyPants":http://daringfireball.net/projects/smartypants/ by John
Gruber.  These are Perl scripts, Movable Type and Blosxom plugins, all
in one file.  I haven't tried them.


Thanks for Mason,

g.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&opĚk
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic