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