X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7b28deb171455a207e536b8abebbca67242a4588..ea753782b222bf4ba2fb4683b6363afdd9055b64:/IkiWiki/Plugin/listdirectives.pm diff --git a/IkiWiki/Plugin/listdirectives.pm b/IkiWiki/Plugin/listdirectives.pm index 2ab3e4665..d2cebca34 100644 --- a/IkiWiki/Plugin/listdirectives.pm +++ b/IkiWiki/Plugin/listdirectives.pm @@ -4,17 +4,17 @@ package IkiWiki::Plugin::listdirectives; use warnings; use strict; -use IkiWiki 2.00; +use IkiWiki 3.00; -sub import { #{{{ +sub import { add_underlay("directives"); hook(type => "getsetup", id => "listdirectives", call => \&getsetup); hook(type => "checkconfig", id => "listdirectives", call => \&checkconfig); hook(type => "needsbuild", id => "listdirectives", call => \&needsbuild); hook(type => "preprocess", id => "listdirectives", call => \&preprocess); -} # }}} +} -sub getsetup () { #{{{ +sub getsetup () { return plugin => { safe => 1, @@ -27,22 +27,22 @@ sub getsetup () { #{{{ safe => 1, rebuild => 1, }, -} #}}} +} my @fulllist; my @shortlist; my $pluginstring; -sub checkconfig () { #{{{ +sub checkconfig () { if (! defined $config{directive_description_dir}) { $config{directive_description_dir} = "ikiwiki/directive"; } else { $config{directive_description_dir} =~ s/\/+$//; } -} #}}} +} -sub needsbuild (@) { #{{{ +sub needsbuild (@) { my $needsbuild=shift; @fulllist = sort keys %{$IkiWiki::hooks{preprocess}}; @@ -63,9 +63,9 @@ sub needsbuild (@) { #{{{ } } } -} # }}} +} -sub preprocess (@) { #{{{ +sub preprocess (@) { my %params=@_; $pagestate{$params{destpage}}{listdirectives}{shown}=$pluginstring; @@ -92,6 +92,6 @@ sub preprocess (@) { #{{{ $result .= ""; return $result; -} # }}} +} 1