X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ef003f48f4a3fe8fb67fda62c70a299b07d75976..f7601954a862afd4c5a5b9ba83480af0472e1cf9:/doc/plugins/write.mdwn diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index ac0935773..8e8c3311e 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -496,6 +496,13 @@ describes the plugin as a whole. For example: and undef if a rebuild could be needed in some circumstances, but is not strictly required. +### genwrapper + + hook(type => "genwrapper", id => "foo", call => \&genwrapper); + +This hook is used to inject C code (which it returns) into the `main` +function of the ikiwiki wrapper when it is being generated. + ## Plugin interface To import the ikiwiki plugin interface: @@ -602,15 +609,31 @@ page created from it. (Ie, it appends ".html".) Use this when constructing the filename of a html file. Use `urlto` when generating a link to a page. -#### `add_depends($$)` +#### `add_depends($$;@)` Makes the specified page depend on the specified [[ikiwiki/PageSpec]]. +By default, dependencies are full content dependencies, meaning that the +page will be updated whenever anything matching the PageSpec is modified. +This default can be overridden by additional named parameters, which can be +used to indicate weaker types of dependencies: + +* `presence` if set to true, only the presence of a matching page triggers + the dependency. +* `links` if set to true, any change to links on a matching page + triggers the dependency. This includes when a link is added, removed, + or changes what it points to due to other changes. It does not include + the addition or removal of a duplicate link. + #### `pagespec_match($$;@)` -Passed a page name, and [[ikiwiki/PageSpec]], returns true if the +Passed a page name, and [[ikiwiki/PageSpec]], returns a true value if the [[ikiwiki/PageSpec]] matches the page. +Note that the return value is overloaded. If stringified, it will be a +message indicating why the PageSpec succeeded, or failed, to match the +page. + Additional named parameters can be passed, to further limit the match. The most often used is "location", which specifies the location the PageSpec should match against. If not passed, relative PageSpecs will match @@ -641,7 +664,7 @@ pages, as described in [[ikiwiki/SubPage/LinkingRules]]. Many plugins need to generate html links and add them to a page. This is done by using the `htmllink` function. The usual way to call -`htmlllink` is: +`htmllink` is: htmllink($page, $page, $link) @@ -850,7 +873,7 @@ of the page with the rcs's conflict markers on failure. Passed a message, user, and ip address. Should commit all staged changes. Returns undef on success, and an error message on failure. -Changes can be staged by calls to `rcs_add, `rcs_remove`, and +Changes can be staged by calls to `rcs_add`, `rcs_remove`, and `rcs_rename`. #### `rcs_add($)`