summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/html.pm
blob: 4dbae081bd9476c154728d32efe4c054e1e954f9 (plain)
  1. #!/usr/bin/perl
  2. # Raw html as a wiki page type.
  3. package IkiWiki::Plugin::html;
  4. use warnings;
  5. use strict;
  6. use IkiWiki 3.00;
  7. sub import {
  8. hook(type => "getsetup", id => "html", call => \&getsetup);
  9. hook(type => "htmlize", id => "html", call => \&htmlize);
  10. hook(type => "htmlize", id => "htm", call => \&htmlize);
  11. # ikiwiki defaults to skipping .html files as a security measure;
  12. # make it process them so this plugin can take effect
  13. $config{wiki_file_prune_regexps} = [ grep { !m/\\\.x\?html\?\$/ } @{$config{wiki_file_prune_regexps}} ];
  14. }
  15. sub getsetup () {
  16. return
  17. plugin => {
  18. safe => 1,
  19. rebuild => 1, # format plugin
  20. section => "format",
  21. },
  22. }
  23. sub htmlize (@) {
  24. my %params=@_;
  25. return $params{content};
  26. }
  27. 1