]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/plugins/write.mdwn
update with edited and somewhat improved source from linuxworld
[ikiwiki.git] / doc / plugins / write.mdwn
index 889057e699fc7436049324bc7c42eb8c8ab2c05e..71239ac82d3b1d41a2252179306e64e98102753e 100644 (file)
@@ -96,9 +96,11 @@ 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, while a "destpage" parameter gives the name of the page the
-content is going to (different for inlined pages). 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.
+content is going to (different for inlined pages), and a "preview"
+parameter is set to a true value if the page is being previewed. 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.
 
 Note that if the [[htmlscrubber]] is enabled, html in
 [[PreProcessorDirective]] output is sanitised, which may limit what your
@@ -412,6 +414,15 @@ Given a time, formats it for display.
 
 This is the standard gettext function, although slightly optimised.
 
+#### `urlto($$)`
+
+Construct a relative url to the first parameter from the second.
+
+#### `targetpage($$)`
+
+Passed a page and an extension, returns the filename that page will be
+rendered to.
+
 ## RCS plugins
 
 ikiwiki's support for revision control systems also uses pluggable perl
@@ -429,6 +440,7 @@ See [[about_RCS_backends]] for some more info.
 It's also possible to write plugins that add new functions to
 [[PageSpecs|PageSpec]]. Such a plugin should add a function to the
 IkiWiki::PageSpec package, that is named `match_foo`, where "foo()" is
-how it will be accessed in a [[PageSpec]]. The function will be passed two
-parameters: The name of the page being matched, and the thing to match
-against. It should return true if the page matches.
+how it will be accessed in a [[PageSpec]]. The function will be passed
+three parameters: The name of the page being matched, the thing to match
+against, and the page that the matching is occuring on. It should return
+true if the page matches.