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