diff options
author | Simon McVittie <smcv@debian.org> | 2010-04-05 22:50:51 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2010-04-05 22:50:51 +0100 |
commit | cb8b2f80b2f8c91eba3f3a6a5b9913ab80326df8 (patch) | |
tree | 9e009b2f7ca8c34c59a1f5ecda786063227f0964 /doc | |
parent | 490f95616a8a49f2120655d07c282eefd067e640 (diff) | |
download | ikiwiki-cb8b2f80b2f8c91eba3f3a6a5b9913ab80326df8.tar ikiwiki-cb8b2f80b2f8c91eba3f3a6a5b9913ab80326df8.tar.gz |
Use $a and $b for SortSpec cmp callbacks
Diffstat (limited to 'doc')
-rw-r--r-- | doc/plugins/write.mdwn | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index b67142230..f42cc86ae 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1117,16 +1117,16 @@ Similarly, it's possible to write plugins that add new functions as the IkiWiki::SortSpec package named `cmp_foo`, which will be used when sorting by `foo` or `foo(...)` is requested. -The function will be passed three or more parameters. The first two are -page names, and the third is `undef` if invoked as `foo`, or the parameter -`"bar"` if invoked as `foo(bar)`. It may also be passed additional, named -parameters. - -It should return the same thing as Perl's `cmp` and `<=>` operators: negative -if the first argument is less than the second, positive if the first argument -is greater, or zero if they are considered equal. It may also raise an -error using `error`, for instance if it needs a parameter but one isn't -provided. +The names of pages to be compared are in the global variables `$a` and `$b` +in the IkiWiki::SortSpec package. The function should return the same thing +as Perl's `cmp` and `<=>` operators: negative if `$a` is less than `$b`, +positive if `$a` is greater, or zero if they are considered equal. It may +also raise an error using `error`, for instance if it needs a parameter but +one isn't provided. + +The function will also be passed one or more parameters. The first is +`undef` if invoked as `foo`, or the parameter `"bar"` if invoked as `foo(bar)`; +it may also be passed additional, named parameters. ### Setup plugins |