X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ee1ad53c4c2710aa7ded61bdc56f3a8cce514f22..4bdeec4961b8df9df449b027e37a8b17898f2c86:/IkiWiki/Plugin/linkmap.pm?ds=inline diff --git a/IkiWiki/Plugin/linkmap.pm b/IkiWiki/Plugin/linkmap.pm index 62984d9b8..cb9f3ef41 100644 --- a/IkiWiki/Plugin/linkmap.pm +++ b/IkiWiki/Plugin/linkmap.pm @@ -6,15 +6,24 @@ use strict; use IkiWiki 2.00; use IPC::Open2; -sub import { #{{{ +sub import { + hook(type => "getsetup", id => "linkmap", call => \&getsetup); hook(type => "preprocess", id => "linkmap", call => \&preprocess); hook(type => "format", id => "linkmap", call => \&format); -} # }}} +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => undef, + }, +} my $mapnum=0; my %maps; -sub preprocess (@) { #{{{ +sub preprocess (@) { my %params=@_; $params{pages}="*" unless defined $params{pages}; @@ -30,17 +39,17 @@ sub preprocess (@) { #{{{ $mapnum++; $maps{$mapnum}=\%params; return "
"; -} # }}} +} -sub format (@) { #{{{ +sub format (@) { my %params=@_; $params{content}=~s/