]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/plugins/write.mdwn
add readtemplate hook
[ikiwiki.git] / doc / plugins / write.mdwn
index d6e6d8d1e61aec99163b5afdcdef6bcee56e811e..f4620b62328b4c0f7f611bc2ba21d21914855565 100644 (file)
@@ -211,6 +211,26 @@ them to `%links`. Present in IkiWiki 2.40 and later.
 The function is passed named parameters "page" and "content". Its return
 value is ignored.
 
+### <a name="readtemplate">readtemplate</a>
+
+       hook(type => "readtemplate", id => "foo", call => \&readtemplate);
+
+Runs on the raw source of a page or `*.tmpl` file that is being
+used as a template, before it is parsed by [[!cpan HTML::Template]].
+
+The function is passed named parameters:
+
+* `id`: the name under which the template was looked up,
+  such as `page.tmpl` or `note`
+* `page`: the name of the template as a page or attachment in the wiki,
+  such as `templates/note`, or `undef` if it's outside the wiki (e.g. in
+  `/usr/share/ikiwiki/templates`)
+* `content`: the content of the corresponding file
+* `untrusted`: true if the template was loaded from the wiki or an underlay,
+  false if it was loaded from a trusted location
+
+It should return the replacement content.
+
 ### <a name="filter">filter</a>
 
        hook(type => "filter", id => "foo", call => \&filter);
@@ -1259,6 +1279,20 @@ and an error message on failure.
 This hook and `rcs_preprevert` are optional, if not implemented, no revert
 web interface will be available.
 
+### `rcs_find_changes($)`
+
+Finds changes committed since the passed RCS-specific rev. Returns
+a hash of the files changed, a hash of the files deleted, and the
+current rev.
+
+This hook is optional.
+
+### `rcs_get_current_rev()`
+
+Gets a RCS-specific rev, which can later be passed to `rcs_find_changes`.
+
+This hook is optional.
+
 ### PageSpec plugins
 
 It's also possible to write plugins that add new functions to