summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/skeleton.pm.example
blob: 10c7002e478919ca5b84a74549350ecc815a5377 (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 => "refresh", id => "skeleton", call => \&refresh);
  13. hook(type => "needsbuild", id => "skeleton", call => \&needsbuild);
  14. hook(type => "preprocess", id => "skeleton", call => \&preprocess);
  15. hook(type => "filter", id => "skeleton", call => \&filter);
  16. hook(type => "linkify", id => "skeleton", call => \&linkify);
  17. hook(type => "scan", id => "skeleton", call => \&scan);
  18. hook(type => "htmlize", id => "skeleton", call => \&htmlize);
  19. hook(type => "sanitize", id => "skeleton", call => \&sanitize);
  20. hook(type => "postscan", id => "skeleton", call => \&postscan);
  21. hook(type => "format", id => "skeleton", call => \&format);
  22. hook(type => "pagetemplate", id => "skeleton", call => \&pagetemplate);
  23. hook(type => "templatefile", id => "skeleton", call => \&templatefile);
  24. hook(type => "delete", id => "skeleton", call => \&delete);
  25. hook(type => "change", id => "skeleton", call => \&change);
  26. hook(type => "cgi", id => "skeleton", call => \&cgi);
  27. hook(type => "auth", id => "skeleton", call => \&auth);
  28. hook(type => "sessioncgi", id => "skeleton", call => \&sessioncgi);
  29. hook(type => "canedit", id => "skeleton", call => \&canedit);
  30. hook(type => "editcontent", id => "skeleton", call => \&editcontent);
  31. hook(type => "formbuilder_setup", id => "skeleton", call => \&formbuilder_setup);
  32. hook(type => "formbuilder", id => "skeleton", call => \&formbuilder);
  33. hook(type => "savestate", id => "skeleton", call => \&savestate);
  34. } # }}}
  35. sub getopt () { #{{{
  36. debug("skeleton plugin getopt");
  37. } #}}}
  38. sub checkconfig () { #{{{
  39. debug("skeleton plugin checkconfig");
  40. } #}}}
  41. sub refresh () { #{{{
  42. debug("skeleton plugin refresh");
  43. } #}}}
  44. sub needsbuild () { #{{{
  45. debug("skeleton plugin needsbuild");
  46. } #}}}
  47. sub preprocess (@) { #{{{
  48. my %params=@_;
  49. return "skeleton plugin result";
  50. } # }}}
  51. sub filter (@) { #{{{
  52. my %params=@_;
  53. debug("skeleton plugin running as filter");
  54. return $params{content};
  55. } # }}}
  56. sub linkify (@) { #{{{
  57. my %params=@_;
  58. debug("skeleton plugin running as linkify");
  59. return $params{content};
  60. } # }}}
  61. sub scan (@) { #{{{a
  62. my %params=@_;
  63. debug("skeleton plugin running as scan");
  64. } # }}}
  65. sub htmlize (@) { #{{{
  66. my %params=@_;
  67. debug("skeleton plugin running as htmlize");
  68. return $params{content};
  69. } # }}}
  70. sub sanitize (@) { #{{{
  71. my %params=@_;
  72. debug("skeleton plugin running as a sanitizer");
  73. return $params{content};
  74. } # }}}
  75. sub postscan (@) { #{{{
  76. my %params=@_;
  77. debug("skeleton plugin running as postscan");
  78. } # }}}
  79. sub format (@) { #{{{
  80. my %params=@_;
  81. debug("skeleton plugin running as a formatter");
  82. return $params{content};
  83. } # }}}
  84. sub pagetemplate (@) { #{{{
  85. my %params=@_;
  86. my $page=$params{page};
  87. my $template=$params{template};
  88. debug("skeleton plugin running as a pagetemplate hook");
  89. } # }}}
  90. sub templatefile (@) { #{{{
  91. my %params=@_;
  92. my $page=$params{page};
  93. debug("skeleton plugin running as a templatefile hook");
  94. } # }}}
  95. sub delete (@) { #{{{
  96. my @files=@_;
  97. debug("skeleton plugin told that files were deleted: @files");
  98. } #}}}
  99. sub change (@) { #{{{
  100. my @files=@_;
  101. debug("skeleton plugin told that changed files were rendered: @files");
  102. } #}}}
  103. sub cgi ($) { #{{{
  104. my $cgi=shift;
  105. debug("skeleton plugin running in cgi");
  106. } #}}}
  107. sub auth ($$) { #{{{
  108. my $cgi=shift;
  109. my $session=shift;
  110. debug("skeleton plugin running in auth");
  111. } #}}}
  112. sub sessionncgi ($$) { #{{{
  113. my $cgi=shift;
  114. my $session=shift;
  115. debug("skeleton plugin running in sessioncgi");
  116. } #}}}
  117. sub canedit ($$$) { #{{{
  118. my $page=shift;
  119. my $cgi=shift;
  120. my $session=shift;
  121. debug("skeleton plugin running in canedit");
  122. } #}}}
  123. sub editcontent ($$$) { #{{{
  124. my %params=@_;
  125. debug("skeleton plugin running in editcontent");
  126. return $params{content};
  127. } #}}}
  128. sub formbuilder_setup (@) { #{{{
  129. my %params=@_;
  130. debug("skeleton plugin running in formbuilder_setup");
  131. } # }}}
  132. sub formbuilder (@) { #{{{
  133. my %params=@_;
  134. debug("skeleton plugin running in formbuilder");
  135. } # }}}
  136. sub savestate () { #{{{
  137. debug("skeleton plugin running in savestate");
  138. } #}}}
  139. 1