X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/6f9c18f7cbbdc8305c6d4373a9d8a00d0c47af5f..aa306957bac11477b914ac19b93890184ffe4062:/doc/plugins/write.mdwn diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index acf9a2cdd..0b358b215 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -90,11 +90,6 @@ function is passed no values. It's ok for the function to call This hook is called just before ikiwiki scans the wiki for changed files. It's useful for plugins that need to create or modify a source page. The - - - - - function is passed no values. ### needsbuild @@ -103,7 +98,7 @@ function is passed no values. This allows a plugin to manipulate the list of files that need to be built when the wiki is refreshed. The function is passed a reference to an -array of pages that will be rebuilt, and can modify the array, either +array of files that will be rebuilt, and can modify the array, either adding or removing files from it. ### scan @@ -194,9 +189,14 @@ The function is passed named parameters: "page" and "content" and should return the htmlized content. If `hook` is passed an optional "keepextension" parameter, set to a true -value, then this extension will not be stripped from the source filename when +value, then the extension will not be stripped from the source filename when generating the page. +If `hook` is passed an optional "noextension" parameter, set to a true +value, then the id parameter specifies not a filename extension, but +a whole filename that can be htmlized. This is useful for files +like `Makefile` that have no extension. + ### pagetemplate hook(type => "pagetemplate", id => "foo", call => \&pagetemplate); @@ -572,6 +572,19 @@ The most often used is "location", which specifies the location the PageSpec should match against. If not passed, relative PageSpecs will match relative to the top of the wiki. +#### `pagespec_match_list($$;@)` + +Passed a reference to a list of page names, and [[ikiwiki/PageSpec]], +returns the set of pages that match the [[ikiwiki/PageSpec]]. + +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 +relative to the top of the wiki. + +Unlike pagespec_match, this may throw an error if there is an error in +the pagespec. + #### `bestlink($$)` Given a page and the text of a link on the page, determine which @@ -890,9 +903,12 @@ It's also possible to write plugins that add new functions to IkiWiki::PageSpec package, that is named `match_foo`, where "foo()" is how it will be accessed in a [[ikiwiki/PageSpec]]. The function will be passed two parameters: The name of the page being matched, and the thing to match -against. It may also be passed additional, named parameters. It should return -a IkiWiki::SuccessReason object if the match succeeds, or an -IkiWiki::FailReason object if the match fails. +against. It may also be passed additional, named parameters. + +It should return a IkiWiki::SuccessReason object if the match succeeds, or +an IkiWiki::FailReason object if the match fails. If the match cannot be +attempted at all, for any page, it can instead return an +IkiWiki::ErrorReason object explaining why. ### Setup plugins