From 7819f34a503bbe00c35c384119d0935735689dbc Mon Sep 17 00:00:00 2001 From: joey Date: Fri, 29 Dec 2006 05:18:39 +0000 Subject: * Add a textile format plugin contributed by mazirian. --- IkiWiki/Plugin/textile.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 IkiWiki/Plugin/textile.pm (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/textile.pm b/IkiWiki/Plugin/textile.pm new file mode 100644 index 000000000..ee8e88ed2 --- /dev/null +++ b/IkiWiki/Plugin/textile.pm @@ -0,0 +1,24 @@ +#!/usr/bin/perl +# By mazirian; GPL license +# Textile markup + +package IkiWiki::Plugin::textile; + +use warnings; +use strict; +use IkiWiki; + +sub import { #{{{ + hook(type => "htmlize", id => "txtl", call => \&htmlize); +} # }}} + +sub htmlize (@) { #{{{ + my %params=@_; + my $content = $params{content}; + + eval q{use Text::Textile}; + return $content if $@; + return Text::Textile::textile($content); +} # }}} + +1 -- cgit v1.2.3