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