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