"be consistent" | |
PerlMonks |
Use Filters with Text::Textileby Brutha (Friar) |
on Mar 27, 2006 at 09:03 UTC ( [id://539399]=CUFP: print w/replies, xml ) | Need Help?? |
Textile is a a simple syntax for nudging plain text into structurally sound and stylistically rich web content. The functionality is provided via CPAN module Text::Textile.
Now I want to include a shortcut for a link to a page to view an item to which I have the key. As documentation is rather thin I provide the snippet to demonstrate the use of a filter.
Example source text: See ==|item|12== for details This shall be replaced with: See <a href="http://localhost:3000/item/view/12">Item 12</a> for details Filters are stored in a hash with their name as key and a coderef to be called when the text is to be processed. Special parameters can be passed with the filter_param method, e.g. a base URL in my case. I hope the example is self-explaining enough. Edit: sorry, preview is missing
Back to
Cool Uses for Perl
|
|