X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/ffc99f5904934e6e7532bb8cfdebb44ad9ecd913..bc66a00b90e00971156f1aea5678ce88d006e84d:/IkiWiki/Plugin/googlecalendar.pm diff --git a/IkiWiki/Plugin/googlecalendar.pm b/IkiWiki/Plugin/googlecalendar.pm index 7efa1daa3..9e09d7dbb 100644 --- a/IkiWiki/Plugin/googlecalendar.pm +++ b/IkiWiki/Plugin/googlecalendar.pm @@ -5,14 +5,24 @@ use warnings; use strict; use IkiWiki 2.00; -sub import { #{{{ +sub import { + hook(type => "getsetup", id => "googlecalendar", + call => \&getsetup); hook(type => "preprocess", id => "googlecalendar", call => \&preprocess); hook(type => "format", id => "googlecalendar", call => \&format); -} # }}} +} -sub preprocess (@) { #{{{ +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => undef, + }, +} + +sub preprocess (@) { my %params=@_; # Parse the html, looking for the url to embed for the calendar. @@ -25,21 +35,21 @@ sub preprocess (@) { #{{{ my ($width)=$params{html}=~m#width="(\d+)"#; return "
"; -} # }}} +} -sub format (@) { #{{{ +sub format (@) { my %params=@_; $params{content}=~s/
<\/div>/gencal($1,$2,$3)/eg; return $params{content}; -} # }}} +} -sub gencal ($$$) { #{{{ +sub gencal ($$$) { my $url=shift; my $height=shift; my $width=shift; return qq{}; -} #}}} +} 1