]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - IkiWiki/Plugin/creole.pm
po/todo: take note of the commit that will need to be reverted later
[git.ikiwiki.info.git] / IkiWiki / Plugin / creole.pm
1 #!/usr/bin/perl
2 # WikiCreole markup
3 # based on the WikiText plugin.
4 package IkiWiki::Plugin::creole;
6 use warnings;
7 use strict;
8 use IkiWiki 3.00;
10 sub import {
11         hook(type => "getsetup", id => "creole", call => \&getsetup);
12         hook(type => "htmlize", id => "creole", call => \&htmlize);
13 }
15 sub getsetup {
16         return
17                 plugin => {
18                         safe => 1,
19                         rebuild => 1, # format plugin
20                 },
21 }
23 sub htmlize (@) {
24         my %params=@_;
25         my $content = $params{content};
27         eval q{use Text::WikiCreole};
28         return $content if $@;
30         # don't parse WikiLinks, ikiwiki already does
31         creole_customlinks();
32         creole_custombarelinks();
34         return creole_parse($content);
35 }
37 1