summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/skeleton.pm
blob: 226270c38fdaed70d83689f1ca0617bc6deccca6 (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 => "pagetemplate", id => "skeleton",
  19. call => \&pagetemplate);
  20. IkiWiki::hook(type => "delete", id => "skeleton",
  21. call => \&delete);
  22. IkiWiki::hook(type => "change", id => "skeleton",
  23. call => \&change);
  24. IkiWiki::hook(type => "cgi", id => "skeleton",
  25. call => \&cgi);
  26. } # }}}
  27. sub checkconfig () { #{{{
  28. IkiWiki::debug("skeleton plugin checkconfig");
  29. } #}}}
  30. sub preprocess (@) { #{{{
  31. my %params=@_;
  32. return "skeleton plugin result";
  33. } # }}}
  34. sub filter (@) { #{{{
  35. my %params=@_;
  36. IkiWiki::debug("skeleton plugin running as filter");
  37. return $params{content};
  38. } # }}}
  39. sub sanitize ($) { #{{{
  40. my $content=shift;
  41. IkiWiki::debug("skeleton plugin running as a sanitizer");
  42. return $content;
  43. } # }}}
  44. sub pagetemplate ($$) { #{{{
  45. my $page=shift;
  46. my $template=shift;
  47. IkiWiki::debug("skeleton plugin running as a pagetemplate hook");
  48. } # }}}
  49. sub delete (@) { #{{{
  50. my @files=@_;
  51. IkiWiki::debug("skeleton plugin told that files were deleted: @files");
  52. } #}}}
  53. sub change (@) { #{{{
  54. my @files=@_;
  55. IkiWiki::debug("skeleton plugin told that changed files were rendered: @files");
  56. } #}}}
  57. sub cgi ($) { #{{{
  58. my $cgi=shift;
  59. IkiWiki::debug("skeleton plugin running in cgi");
  60. } #}}}
  61. 1