]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/plugins/write.mdwn
web commit by EroSennin
[ikiwiki.git] / doc / plugins / write.mdwn
index 245f7c9ee8dad10063c050bb90d416d1927bcc3c..515c4d90d6091766a90b01a498507bd47bf99f4a 100644 (file)
@@ -35,10 +35,12 @@ This is probably the most common use of a plugin.
 Replace "foo" with the command name that will be used inside brackers for
 the preprocessor directive.
 
-Each time the directive is processed, the referenced function (`preprocess` in the example above) is called, and is passed named parameters. A
-"page" parameter gives the name of the page that embedded the preprocessor directive. All parameters included in the directive are included
-as named parameters as well. Whatever the function returns goes onto the
-page in place of the directive.
+Each time the directive is processed, the referenced function (`preprocess`
+in the example above) is called, and is passed named parameters. A "page"
+parameter gives the name of the page that embedded the preprocessor
+directive. All parameters included in the directive are included as named
+parameters as well. Whatever the function returns goes onto the page in
+place of the directive.
 
 ## Error handing
 
@@ -77,15 +79,6 @@ Runs on the raw source of a page, before anything else touches it, and can
 make arbitrary changes. The function is passed named parameters `page` and
 `content` and should return the filtered content.
 
-## sanitize
-
-       IkiWiki::hook(type => "filter", id => "foo", call => \&sanitize);
-
-Use this to implement html sanitization or anything else that needs to
-modify the content of a page after it has been fully converted to html.
-The function is passed the page content and should return the sanitized
-content.
-
 ## pagetemplate
 
        IkiWiki::hook(type => "pagetemplate", id => "foo", call => \&pagetemplate);
@@ -97,6 +90,15 @@ be used to generate the page. It can manipulate that template, 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 content of a page after it has been fully converted to html.
+The function is passed the page content and should return the sanitized
+content.
+
 ## delete
 
        IkiWiki::hook(type => "delete", id => "foo", call => \&dele);