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