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