summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/skeleton.pm
blob: d1a50c03bd14fefe093e5064ec9f51848fb7bd04 (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 2.00;
  9. sub import { #{{{
  10. hook(type => "getopt", id => "skeleton", call => \&getopt);
  11. hook(type => "checkconfig", id => "skeleton", call => \&checkconfig);
  12. hook(type => "needsbuild", id => "skeleton", call => \&needsbuild);
  13. hook(type => "preprocess", id => "skeleton", call => \&preprocess);
  14. hook(type => "filter", id => "skeleton", call => \&filter);
  15. hook(type => "htmlize", id => "skeleton", call => \&htmlize);
  16. hook(type => "sanitize", id => "skeleton", call => \&sanitize);
  17. hook(type => "format", id => "skeleton", call => \&format);
  18. hook(type => "pagetemplate", id => "skeleton", call => \&pagetemplate);
  19. hook(type => "templatefile", id => "skeleton", call => \&templatefile);
  20. hook(type => "delete", id => "skeleton", call => \&delete);
  21. hook(type => "change", id => "skeleton", call => \&change);
  22. hook(type => "cgi", id => "skeleton", call => \&cgi);
  23. hook(type => "auth", id => "skeleton", call => \&auth);
  24. hook(type => "canedit", id => "skeleton", call => \&canedit);
  25. hook(type => "formbuilder_setup", id => "skeleton", call => \&formbuilder_setup);
  26. hook(type => "formbuilder", id => "skeleton", call => \&formbuilder);
  27. hook(type => "savestate", id => "savestate", call => \&savestate);
  28. } # }}}
  29. sub getopt () { #{{{
  30. debug("skeleton plugin getopt");
  31. } #}}}
  32. sub checkconfig () { #{{{
  33. debug("skeleton plugin checkconfig");
  34. } #}}}
  35. sub needsbuild () { #{{{
  36. debug("skeleton plugin needsbuild");
  37. } #}}}
  38. sub preprocess (@) { #{{{
  39. my %params=@_;
  40. return "skeleton plugin result";
  41. } # }}}
  42. sub filter (@) { #{{{
  43. my %params=@_;
  44. debug("skeleton plugin running as filter");
  45. return $params{content};
  46. } # }}}
  47. sub htmlize (@) { #{{{
  48. my %params=@_;
  49. debug("skeleton plugin running as htmlize");
  50. return $params{content};
  51. } # }}}
  52. sub sanitize (@) { #{{{
  53. my %params=@_;
  54. debug("skeleton plugin running as a sanitizer");
  55. return $params{content};
  56. } # }}}
  57. sub format (@) { #{{{
  58. my %params=@_;
  59. debug("skeleton plugin running as a formatter");
  60. return $params{content};
  61. } # }}}
  62. sub pagetemplate (@) { #{{{
  63. my %params=@_;
  64. my $page=$params{page};
  65. my $template=$params{template};
  66. debug("skeleton plugin running as a pagetemplate hook");
  67. } # }}}
  68. sub templatefile (@) { #{{{
  69. my %params=@_;
  70. my $page=$params{page};
  71. debug("skeleton plugin running as a templatefile hook");
  72. } # }}}
  73. sub delete (@) { #{{{
  74. my @files=@_;
  75. debug("skeleton plugin told that files were deleted: @files");
  76. } #}}}
  77. sub change (@) { #{{{
  78. my @files=@_;
  79. debug("skeleton plugin told that changed files were rendered: @files");
  80. } #}}}
  81. sub cgi ($) { #{{{
  82. my $cgi=shift;
  83. debug("skeleton plugin running in cgi");
  84. } #}}}
  85. sub auth ($$) { #{{{
  86. my $cgi=shift;
  87. my $session=shift;
  88. debug("skeleton plugin running in auth");
  89. } #}}}
  90. sub canedit ($$$) { #{{{
  91. my $page=shift;
  92. my $cgi=shift;
  93. my $session=shift;
  94. debug("skeleton plugin running in canedit");
  95. } #}}}
  96. sub formbuilder_setup (@) { #{{{
  97. my %params=@_;
  98. debug("skeleton plugin running in formbuilder_setup");
  99. } # }}}
  100. sub formbuilder (@) { #{{{
  101. my %params=@_;
  102. debug("skeleton plugin running in formbuilder");
  103. } # }}}
  104. sub savestate () { #{{{
  105. debug("skeleton plugin running in savestate");
  106. } #}}}
  107. 1