summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/more.pm
blob: 6a34682ba61c9043ffff65343acd035e018cce25 (plain)
  1. #!/usr/bin/perl
  2. package IkiWiki::Plugin::more;
  3. use warnings;
  4. use strict;
  5. use IkiWiki 2.00;
  6. my $linktext = gettext("more");
  7. sub import { #{{{
  8. hook(type => "preprocess", id => "more", call => \&preprocess);
  9. } # }}}
  10. sub preprocess (@) { #{{{
  11. my %params=@_;
  12. $params{linktext} = $linktext unless defined $params{linktext};
  13. if ($params{page} ne $params{destpage}) {
  14. return "\n".
  15. htmllink($params{page}, $params{destpage}, $params{page},
  16. linktext => $params{linktext},
  17. anchor => "more");
  18. }
  19. else {
  20. $params{text}=IkiWiki::preprocess($params{page}, $params{destpage},
  21. IkiWiki::filter($params{page}, $params{text}));
  22. return "<a name=\"more\"></a>\n\n".$params{text};
  23. }
  24. }
  25. 1