]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - IkiWiki/Plugin/more.pm
really add
[git.ikiwiki.info.git] / IkiWiki / Plugin / more.pm
1 #!/usr/bin/perl
2 package IkiWiki::Plugin::more;
4 use warnings;
5 use strict;
6 use IkiWiki 2.00;
8 my $linktext = gettext("more");
10 sub import { #{{{
11         hook(type => "preprocess",  id => "more", call => \&preprocess);
12 } # }}}
14 sub preprocess (@) { #{{{
15         my %params=@_;
17         $params{linktext} = $linktext unless defined $params{linktext};
19         if ($params{page} ne $params{destpage}) {
20                 return "\n".
21                         htmllink($params{page}, $params{destpage}, $params{page},
22                                 linktext => $params{linktext},
23                                 anchor => "more");
24         }
25         else {
26                 $params{text}=IkiWiki::preprocess($params{page}, $params{destpage},
27                         IkiWiki::filter($params{page}, $params{destpage}, $params{text}));
28                 return "<a name=\"more\"></a>\n\n".$params{text};
29         }
30 }
32 1