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