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