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