* IkiWiki/Plugin/monotone.pm: monotone v0.48 has a small error that
[ikiwiki] / IkiWiki / Plugin / creole.pm
1 #!/usr/bin/perl
2 # WikiCreole markup
3 # based on the WikiText plugin.
4 package IkiWiki::Plugin::creole;
5
6 use warnings;
7 use strict;
8 use IkiWiki 3.00;
9
10 sub import {
11         hook(type => "getsetup", id => "creole", call => \&getsetup);
12         hook(type => "htmlize", id => "creole", call => \&htmlize);
13 }
14
15 sub getsetup {
16         return
17                 plugin => {
18                         safe => 1,
19                         rebuild => 1, # format plugin
20                         section => "format",
21                 },
22 }
23
24 sub htmlize (@) {
25         my %params=@_;
26         my $content = $params{content};
27
28         eval q{use Text::WikiCreole};
29         return $content if $@;
30
31         # don't parse WikiLinks, ikiwiki already does
32         creole_customlinks();
33         creole_custombarelinks();
34
35         return creole_parse($content);
36 }
37
38 1