2006-07-04 00:31:20 +02:00
|
|
|
#!/usr/bin/perl
|
|
|
|
# Raw html as a wiki page type.
|
|
|
|
package IkiWiki::Plugin::html;
|
|
|
|
|
|
|
|
use warnings;
|
|
|
|
use strict;
|
2007-04-27 04:55:52 +02:00
|
|
|
use IkiWiki 2.00;
|
2006-07-04 00:31:20 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub import {
|
2008-08-03 22:40:12 +02:00
|
|
|
hook(type => "getsetup", id => "html", call => \&getsetup);
|
2006-09-10 00:50:27 +02:00
|
|
|
hook(type => "htmlize", id => "html", call => \&htmlize);
|
|
|
|
hook(type => "htmlize", id => "htm", call => \&htmlize);
|
2006-07-04 00:31:20 +02:00
|
|
|
|
|
|
|
# ikiwiki defaults to skipping .html files as a security measure;
|
|
|
|
# make it process them so this plugin can take effect
|
2006-12-21 20:36:15 +01:00
|
|
|
$config{wiki_file_prune_regexps} = [ grep { !m/\\\.x\?html\?\$/ } @{$config{wiki_file_prune_regexps}} ];
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-07-04 00:31:20 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub getsetup () {
|
2008-08-03 22:40:12 +02:00
|
|
|
return
|
|
|
|
plugin => {
|
|
|
|
safe => 1,
|
|
|
|
rebuild => 1, # format plugin
|
|
|
|
},
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2008-08-03 22:40:12 +02:00
|
|
|
|
2008-12-17 21:22:16 +01:00
|
|
|
sub htmlize (@) {
|
2006-08-28 20:17:59 +02:00
|
|
|
my %params=@_;
|
|
|
|
return $params{content};
|
2008-12-17 21:22:16 +01:00
|
|
|
}
|
2006-08-28 20:17:59 +02:00
|
|
|
|
2006-07-04 00:31:20 +02:00
|
|
|
1
|