aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/html.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-07-03 22:31:20 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-07-03 22:31:20 +0000
commit8d4c474f3b92ed2d0e8f968e34a5c6d9d30921fe (patch)
tree58129fd2cda3ab6a61e2f0536f4b6ec9c59c6ad7 /IkiWiki/Plugin/html.pm
parentaf029154d6b145302f8ece0286711f61ea606877 (diff)
downloadikiwiki-8d4c474f3b92ed2d0e8f968e34a5c6d9d30921fe.tar
ikiwiki-8d4c474f3b92ed2d0e8f968e34a5c6d9d30921fe.tar.gz
* Add a html plugin, which can be used to write wikis in raw html,
if you'd ever want to do such a thing. Slightly tricky, since ikiwiki defaults to not processing .html files, since w/o this plugin they would be copied unsanitised. With this plugin, it will process, and html sanitise, them like any other page type.
Diffstat (limited to 'IkiWiki/Plugin/html.pm')
-rw-r--r--IkiWiki/Plugin/html.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/html.pm b/IkiWiki/Plugin/html.pm
new file mode 100644
index 000000000..6bf813292
--- /dev/null
+++ b/IkiWiki/Plugin/html.pm
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+# Raw html as a wiki page type.
+package IkiWiki::Plugin::html;
+
+use warnings;
+use strict;
+use IkiWiki;
+
+sub import { #{{{
+ IkiWiki::hook(type => "htmlize", id => "html", call => sub { shift });
+ IkiWiki::hook(type => "htmlize", id => "htm", call => sub { shift });
+
+ # ikiwiki defaults to skipping .html files as a security measure;
+ # make it process them so this plugin can take effect
+ $IkiWiki::config{wiki_file_prune_regexp} =~ s/\|\\\.html\?\$//;
+} # }}}
+
+1