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