summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/textile.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/textile.pm')
-rw-r--r--IkiWiki/Plugin/textile.pm24
1 files changed, 24 insertions, 0 deletions
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