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