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