summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/creole.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/creole.pm b/IkiWiki/Plugin/creole.pm
new file mode 100644
index 000000000..f7f7a61e3
--- /dev/null
+++ b/IkiWiki/Plugin/creole.pm
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+# WikiCreole markup
+# based on the WikiText plugin.
+package IkiWiki::Plugin::creole;
+
+use warnings;
+use strict;
+use IkiWiki 2.00;
+
+sub import { #{{{
+ hook(type => "htmlize", id => "creole", call => \&htmlize);
+} # }}}
+
+sub htmlize (@) { #{{{
+ my %params=@_;
+ my $content = $params{content};
+
+ eval q{use Text::WikiCreole};
+ return $content if $@;
+ return Text::WikiCreole::creole_parse($content);
+} # }}}
+
+1