summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-12-29 05:18:39 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-12-29 05:18:39 +0000
commit7819f34a503bbe00c35c384119d0935735689dbc (patch)
tree4b6387ea3665eb9688103ebf2fc5c286b9d16acf /IkiWiki
parent5659e9881eb75347da136bfd3128748e5ba6974a (diff)
* Add a textile format plugin contributed by mazirian.
Diffstat (limited to 'IkiWiki')
-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