]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - IkiWiki/Plugin/textile.pm
standardising and documenting getsetup
[git.ikiwiki.info.git] / IkiWiki / Plugin / textile.pm
1 #!/usr/bin/perl
2 # By mazirian; GPL license
3 # Textile markup
5 package IkiWiki::Plugin::textile;
7 use warnings;
8 use strict;
9 use IkiWiki 2.00;
10 use Encode;
12 sub import { #{{{
13         hook(type => "htmlize", id => "txtl", call => \&htmlize);
14 } # }}}
16 sub htmlize (@) { #{{{
17         my %params=@_;
18         my $content = decode_utf8(encode_utf8($params{content}));
20         eval q{use Text::Textile};
21         return $content if $@;
22         return Text::Textile::textile($content);
23 } # }}}
25 1