add websetup hook

master
Joey Hess 2011-06-21 15:13:49 -04:00
parent 886890b82d
commit b5a669f34b
1 changed files with 11 additions and 1 deletions

View File

@ -4,12 +4,22 @@ package IkiWiki::Plugin::headinganchors;
use warnings;
use strict;
use IkiWiki 2.00;
use IkiWiki 3.00;
sub import {
hook(type => "getsetup", id => "headinganchors", call => \&getsetup);
hook(type => "sanitize", id => "headinganchors", call => \&headinganchors);
}
sub getsetup () {
return
plugin => {
safe => 1,
rebuild => undef,
section => "widget",
},
}
sub text_to_anchor {
my $str = shift;
$str =~ s/^\s+//;