+preprocessor time. Text output by a preprocessor directive will be
+linkified and passed through markdown (or whatever engine is used to htmlize
+the page) along with the rest of the page.
+
+### htmlize
+
+ IkiWiki::hook(type => "htmlize", id => "ext", call => \&htmlize);
+
+Runs on the raw source of a page and turns it into html. The id parameter
+specifies the filename extension that a file must have to be htmlized using
+this plugin. This is how you can add support for new and exciting markup
+languages to ikiwiki.
+
+The function is passed named parameters: "page" and "content" and should
+return the htmlized content.
+
+### pagetemplate
+
+ IkiWiki::hook(type => "pagetemplate", id => "foo", call => \&pagetemplate);
+
+Each time a page (or part of a blog page, or an rss feed) is rendered, a
+[[template|templates]] is filled out. This hook allows modifying that
+template. The function is passed named parameters. The "page" and
+"destpage" parameters are the same as for a preprocess hook. The "template"
+parameter is a `HTML::Template` object that is the template that will be
+used to generate the page. The function can manipulate that template
+object.
+
+The most common thing to do is probably to call $template->param() to add
+a new custom parameter to the template.
+
+### sanitize
+
+ IkiWiki::hook(type => "sanitize", id => "foo", call => \&sanitize);
+
+Use this to implement html sanitization or anything else that needs to
+modify the body of a page after it has been fully converted to html.
+
+The function is passed named parameters: "page" and "content", and
+should return the sanitized content.
+
+### format
+
+ IkiWiki::hook(type => "format", id => "foo", call => \&format);
+
+The difference between format and sanitize is that sanitize only acts on
+the page body, while format can modify the entire html page including the
+header and footer inserted by ikiwiki, the html document type, etc.
+
+The function is passed named parameters: "page" and "content", and
+should return the formatted content.
+
+### delete
+
+ IkiWiki::hook(type => "delete", id => "foo", call => \&delete);
+
+Each time a page or pages is removed from the wiki, the referenced function
+is called, and passed the names of the source files that were removed.
+
+### change
+
+ IkiWiki::hook(type => "change", id => "foo", call => \&render);
+
+Each time ikiwiki renders a change or addition (but not deletion) to the
+wiki, the referenced function is called, and passed the names of the
+source files that were rendered.
+
+### cgi
+
+ IkiWiki::hook(type => "cgi", id => "foo", call => \&cgi);
+
+Use this to hook into ikiwiki's cgi script. Each registered cgi hook is
+called in turn, and passed a CGI object. The hook should examine the
+parameters, and if it will handle this CGI request, output a page and
+terminate the program.
+
+### savestate
+
+ IkiWiki::hook(type => "savestate", id => "foo", call => \&savestate);
+
+This hook is called wheneven ikiwiki normally saves its state, just before
+the state is saved. The function can save other state, modify values before
+they're saved, etc.
+
+## Error handing
+
+While a plugin can call ikiwiki's `error` routine for a fatal error, for
+errors that aren't intended to halt the entire wiki build, including bad
+parameters passed to a [[PreProcessorDirective]], etc, it's better to just
+return the error message as the output of the plugin.