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