summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/skeleton.pm
blob: 346dfa5ffb1210897dd3283a51d30b4c083aa9db (plain)
  1. #!/usr/bin/perl
  2. # Ikiwiki skeleton plugin. Replace "skeleton" with the name of your plugin
  3. # in the lines below, remove hooks you don't use, and flesh out the code to
  4. # make it do something.
  5. package IkiWiki::Plugin::skeleton;
  6. use warnings;
  7. use strict;
  8. use IkiWiki;
  9. sub import { #{{{
  10. IkiWiki::hook(type => "checkconfig", id => "skeleton",
  11. call => \&checkconfig);
  12. IkiWiki::hook(type => "preprocess", id => "skeleton",
  13. call => \&preprocess);
  14. IkiWiki::hook(type => "filter", id => "skeleton",
  15. call => \&filter);
  16. IkiWiki::hook(type => "sanitize", id => "skeleton",
  17. call => \&sanitize);
  18. IkiWiki::hook(type => "delete", id => "skeleton",
  19. call => \&delete);
  20. IkiWiki::hook(type => "change", id => "skeleton",
  21. call => \&change);
  22. IkiWiki::hook(type => "cgi", id => "skeleton",
  23. call => \&cgi);
  24. } # }}}
  25. sub checkconfig () { #{{{
  26. IkiWiki::debug("skeleton plugin checkconfig");
  27. } #}}}
  28. sub preprocess (@) { #{{{
  29. my %params=@_;
  30. return "skeleton plugin result";
  31. } # }}}
  32. sub filter (@) { #{{{
  33. my %params=@_;
  34. IkiWiki::debug("skeleton plugin running as filter");
  35. return $params{content};
  36. } # }}}
  37. sub sanitize ($) { #{{{
  38. my $content=shift;
  39. IkiWiki::debug("skeleton plugin running as a sanitizer");
  40. return $content;
  41. } # }}}
  42. sub delete (@) { #{{{
  43. my @files=@_;
  44. IkiWiki::debug("skeleton plugin told that files were deleted: @files");
  45. } #}}}
  46. sub change (@) { #{{{
  47. my @files=@_;
  48. IkiWiki::debug("skeleton plugin told that changed files were rendered: @files");
  49. } #}}}
  50. sub cgi ($) { #{{{
  51. my $cgi=shift;
  52. IkiWiki::debug("skeleton plugin running in cgi");
  53. } #}}}
  54. 1