summaryrefslogtreecommitdiff
path: root/doc/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'doc/plugins')
-rw-r--r--doc/plugins/404.mdwn2
-rw-r--r--doc/plugins/aggregate.mdwn2
-rw-r--r--doc/plugins/autoindex.mdwn2
-rw-r--r--doc/plugins/calendar.mdwn4
-rw-r--r--doc/plugins/color.mdwn2
-rw-r--r--doc/plugins/comments.mdwn6
-rw-r--r--doc/plugins/conditional.mdwn2
-rw-r--r--doc/plugins/conditional/discussion.mdwn25
-rw-r--r--doc/plugins/contrib/field/discussion.mdwn326
-rw-r--r--doc/plugins/contrib/ftemplate/discussion.mdwn33
-rw-r--r--doc/plugins/contrib/highlightcode.mdwn2
-rw-r--r--doc/plugins/contrib/pod/discussion.mdwn14
-rw-r--r--doc/plugins/contrib/postal.mdwn2
-rw-r--r--doc/plugins/contrib/report.mdwn4
-rw-r--r--doc/plugins/contrib/report/discussion.mdwn75
-rw-r--r--doc/plugins/contrib/xslt/discussion.mdwn27
-rw-r--r--doc/plugins/contrib/ymlfront/discussion.mdwn11
-rw-r--r--doc/plugins/creole/discussion.mdwn7
-rw-r--r--doc/plugins/cutpaste.mdwn2
-rw-r--r--doc/plugins/date.mdwn2
-rw-r--r--doc/plugins/ddate.mdwn1
-rw-r--r--doc/plugins/editpage.mdwn1
-rw-r--r--doc/plugins/filecheck.mdwn2
-rw-r--r--doc/plugins/format.mdwn2
-rw-r--r--doc/plugins/fortune.mdwn1
-rw-r--r--doc/plugins/getsource.mdwn1
-rw-r--r--doc/plugins/getsource/discussion.mdwn1
-rw-r--r--doc/plugins/goto.mdwn2
-rw-r--r--doc/plugins/graphviz.mdwn2
-rw-r--r--doc/plugins/haiku.mdwn1
-rw-r--r--doc/plugins/httpauth.mdwn18
-rw-r--r--doc/plugins/img.mdwn2
-rw-r--r--doc/plugins/inline.mdwn1
-rw-r--r--doc/plugins/linkmap.mdwn1
-rw-r--r--doc/plugins/listdirectives.mdwn1
-rw-r--r--doc/plugins/lockedit.mdwn11
-rw-r--r--doc/plugins/map.mdwn2
-rw-r--r--doc/plugins/mirrorlist.mdwn2
-rw-r--r--doc/plugins/moderatedcomments.mdwn8
-rw-r--r--doc/plugins/more.mdwn2
-rw-r--r--doc/plugins/opendiscussion.mdwn5
-rw-r--r--doc/plugins/orphans.mdwn1
-rw-r--r--doc/plugins/pagecount.mdwn1
-rw-r--r--doc/plugins/pagestats.mdwn2
-rw-r--r--doc/plugins/parentlinks.mdwn2
-rw-r--r--doc/plugins/poll.mdwn2
-rw-r--r--doc/plugins/polygen.mdwn1
-rw-r--r--doc/plugins/postsparkline.mdwn2
-rw-r--r--doc/plugins/prettydate.mdwn1
-rw-r--r--doc/plugins/progress.mdwn2
-rw-r--r--doc/plugins/recentchanges.mdwn1
-rw-r--r--doc/plugins/recentchangesdiff.mdwn1
-rw-r--r--doc/plugins/relativedate.mdwn1
-rw-r--r--doc/plugins/rename.mdwn3
-rw-r--r--doc/plugins/repolist.mdwn2
-rw-r--r--doc/plugins/rsync.mdwn1
-rw-r--r--doc/plugins/shortcut.mdwn2
-rw-r--r--doc/plugins/sidebar.mdwn25
-rw-r--r--doc/plugins/sortnaturally.mdwn6
-rw-r--r--doc/plugins/sparkline.mdwn2
-rw-r--r--doc/plugins/table.mdwn2
-rw-r--r--doc/plugins/template.mdwn2
-rw-r--r--doc/plugins/testpagespec.mdwn2
-rw-r--r--doc/plugins/teximg.mdwn2
-rw-r--r--doc/plugins/toc.mdwn2
-rw-r--r--doc/plugins/toggle.mdwn2
-rw-r--r--doc/plugins/txt.mdwn5
-rw-r--r--doc/plugins/type/chrome.mdwn2
-rw-r--r--doc/plugins/type/useful.mdwn1
-rw-r--r--doc/plugins/type/widget.mdwn2
-rw-r--r--doc/plugins/typography.mdwn2
-rw-r--r--doc/plugins/underlay.mdwn18
-rw-r--r--doc/plugins/version.mdwn1
-rw-r--r--doc/plugins/websetup.mdwn3
-rw-r--r--doc/plugins/wmd.mdwn2
-rw-r--r--doc/plugins/write.mdwn312
76 files changed, 871 insertions, 164 deletions
diff --git a/doc/plugins/404.mdwn b/doc/plugins/404.mdwn
index ad332ee04..53dace3c9 100644
--- a/doc/plugins/404.mdwn
+++ b/doc/plugins/404.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=404 author="[[Simon_McVittie|smcv]]"]]
-[[!tag type/useful]]
+[[!tag type/web]]
This plugin lets you use the IkiWiki CGI script as an Apache 404 handler,
to give the behaviour of various other wiki engines where visiting a
diff --git a/doc/plugins/aggregate.mdwn b/doc/plugins/aggregate.mdwn
index e2efcd83f..bb828b05c 100644
--- a/doc/plugins/aggregate.mdwn
+++ b/doc/plugins/aggregate.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=aggregate author="[[Joey]]"]]
-[[!tag type/useful]]
+[[!tag type/special-purpose]]
This plugin allows content from other feeds to be aggregated into the
wiki. To specify feeds to aggregate, use the
diff --git a/doc/plugins/autoindex.mdwn b/doc/plugins/autoindex.mdwn
index 03e2d12f3..d1133e4f5 100644
--- a/doc/plugins/autoindex.mdwn
+++ b/doc/plugins/autoindex.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=autoindex core=0 author="[[Joey]]"]]
-[[!tag type/useful]]
+[[!tag type/special-purpose]]
This plugin searches for [[SubPages|ikiwiki/subpage]] with a missing parent
page, and generates the parent pages. The generated page content is
diff --git a/doc/plugins/calendar.mdwn b/doc/plugins/calendar.mdwn
index bc1bc6c71..76e718a3b 100644
--- a/doc/plugins/calendar.mdwn
+++ b/doc/plugins/calendar.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=calendar author="[[ManojSrivastava]]"]]
-[[!tag type/chrome]]
+[[!tag type/widget]]
This plugin provides a [[ikiwiki/directive/calendar]] [[ikiwiki/directive]].
The directive displays a calendar, similar to the typical calendars shown on
@@ -14,6 +14,7 @@ customization.
* `month-calendar` - The month calendar as a whole.
* `month-calendar-head` - The head of the month calendar (ie,"March").
+* `month-calendar-arrow` - Arrow pointing to previous/next month.
* `month-calendar-day-head` - A column head in the month calendar (ie, a
day-of-week abbreviation).
* `month-calendar-day-noday`, `month-calendar-day-link`,
@@ -27,6 +28,7 @@ customization.
weekends.
* `year-calendar` - The year calendar as a whole.
* `year-calendar-head` - The head of the year calendar (ie, "2007").
+* `year-calendar-arrow` - Arrow pointing to previous/next year.
* `year-calendar-subhead` - For example, "Months".
* `year-calendar-month-link`, `year-calendar-month-nolink`,
`year-calendar-month-future`, `year-calendar-this-month` - The month
diff --git a/doc/plugins/color.mdwn b/doc/plugins/color.mdwn
index dbb8b870c..d639bf563 100644
--- a/doc/plugins/color.mdwn
+++ b/doc/plugins/color.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=color core=0 author="[[ptecza]]"]]
-[[!tag type/chrome]]
+[[!tag type/widget]]
This plugin provides a [[ikiwiki/directive/color]] [[ikiwiki/directive]].
The directive can be used to color a piece of text on a page.
diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn
index b6d4d252b..775ef75a0 100644
--- a/doc/plugins/comments.mdwn
+++ b/doc/plugins/comments.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=comments author="[[Simon_McVittie|smcv]]"]]
-[[!tag type/useful]]
+[[!tag type/web]]
This plugin adds "blog-style" comments. Unlike the wiki-style freeform
Discussion pages, these comments are posted by a simple form, cannot later
@@ -14,8 +14,8 @@ authorship should hopefully be unforgeable by CGI users.
The intention is that on a non-wiki site (like a blog) you can lock all
pages for admin-only access, then allow otherwise unprivileged (or perhaps
even anonymous) users to comment on posts. See the documentation of the
-[[lockedit]] and [[anonok]] pages for details on locking down a wiki so
-users can only post comments.
+[[opendiscussion]], [[lockedit]] and [[anonok]] pages for details on locking
+down a wiki so readers can only post comments.
Individual comments are stored as internal-use pages named something like
`page/comment_1`, `page/comment_2`, etc. These pages internally use a
diff --git a/doc/plugins/conditional.mdwn b/doc/plugins/conditional.mdwn
index 95ffb2764..27a99bb7c 100644
--- a/doc/plugins/conditional.mdwn
+++ b/doc/plugins/conditional.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=conditional core=1 author="[[Joey]]"]]
-[[!tag type/format]]
+[[!tag type/special-purpose]]
This plugin provides the [[ikiwiki/directive/if]] [[ikiwiki/directive]].
With this directive, you can make text be conditionally displayed on a page.
diff --git a/doc/plugins/conditional/discussion.mdwn b/doc/plugins/conditional/discussion.mdwn
index 629d05940..6e84fdfc1 100644
--- a/doc/plugins/conditional/discussion.mdwn
+++ b/doc/plugins/conditional/discussion.mdwn
@@ -1,3 +1,28 @@
+## Conditional broken?
+
+Using \[\[!if test="tagged(plugin)" then="= Tagged as plugin =" else="*No plugins found*"]] on this wiki *should* present the 'Tagged as plugin' heading, instead it emits 'no plugins found'. Is the conditional plugin currently broken for tags or am I misusing it? Thanks.
+
+-- Thiana
+
+> This wiki has no page named "plugin", so nothing links to it; tags are a species of link
+> so tagging a large number of pages with a tag that doesn't exist (which change has
+> been reverted) doesn't make the pagespec match. It would if the tag's page existed. --[[Joey]]
+
+>> So if I understand this correctly... Assuming the tags Tag_A and Tag_B, the existence of
+>> @wiki-home@/tags/Tag_A.creole, and a number of files with a \[\[!tag Tag_A Tag_B]] the
+>> following is correct?
+>>
+>> * \[\[!if test="tagged(Tag_A)" then="OK" else="Fail"]] => OK
+>> * \[\[!if test="tagged(Tag_B)" then="OK" else="Fail"]] => Fail
+>> * \[\[!if test="tagged(Tag_A) and tagged(Tag_B)" then="OK" else="Fail"]] => Fail
+>>
+>> Is that the expected behaviour? If so, that's not what I'm seeing here since they all result
+>> in a Fail. If not, what exactly is wrong with those conditionals? Thanks.
+>>
+>> -- Thiana
+
+----
+
Would there be a way for this plugin to emit fewer blank lines (i.e. *none at all*)?
For example, having a look at [this page](http://www.bddebian.com/~wiki/Hurd/)'s sidebar.
diff --git a/doc/plugins/contrib/field/discussion.mdwn b/doc/plugins/contrib/field/discussion.mdwn
new file mode 100644
index 000000000..103e061e5
--- /dev/null
+++ b/doc/plugins/contrib/field/discussion.mdwn
@@ -0,0 +1,326 @@
+Having tried out `field`, some comments (from [[smcv]]):
+
+The general concept looks great.
+
+The `pagetemplate` hook seems quite namespace-polluting: on a site containing
+a list of books, I'd like to have an `author` field, but that would collide
+with IkiWiki's use of `<TMPL_VAR AUTHOR>` for the author of the *page*
+(i.e. me). Perhaps it'd be better if the pagetemplate hook was only active for
+`<TMPL_VAR FIELD_AUTHOR>` or something? (For those who want the current
+behaviour, an auxiliary plugin would be easy.)
+
+> No, please. The idea is to be *able* to override field names if one wishes to, and choose, for yourself, non-colliding field names if one wishes not to. I don't wish to lose the power of being able to, say, define a page title with YAML format if I want to, or to write a site-specific plugin which calculates a page title, or other nifty things.
+>It's not like one is going to lose the fields defined by the meta plugin; if "author" is defined by \[[!meta author=...]] then that's what will be found by "field" (provided the "meta" plugin is registered; that's what the "field_register" option is for).
+>--[[KathrynAndersen]]
+
+>> Hmm. I suppose if you put the title (or whatever) in the YAML, then
+>> "almost" all the places in IkiWiki that respect titles will do the
+>> right thing due to the pagetemplate hook, with the exception being
+>> anything that has special side-effects inside `meta` (like `date`),
+>> or anything that looks in `$pagestate{foo}{meta}` directly
+>> (like `map`). Is your plan that `meta` should register itself by
+>> default, and `map` and friends should be adapted to
+>> work based on `getfield()` instead of `$pagestate{foo}{meta}`, then?
+
+>>> Based on `field_get_value()`, yes. That would be my ideal. Do you think I should implement that as an ikiwiki branch? --[[KathrynAndersen]]
+
+>>>> This doesn't solve cases where certain fields are treated specially; for
+>>>> instance, putting a `\[[!meta permalink]]` on a page is not the same as
+>>>> putting it in `ymlfront` (in the latter case you won't get your
+>>>> `<link>` header), and putting `\[[!meta date]]` is not the same as putting
+>>>> `date` in `ymlfront` (in the latter case, `%pagectime` won't be changed).
+>>>>
+>>>> One way to resolve that would be to have `ymlfront`, or similar, be a
+>>>> front-end for `meta` rather than for `field`, and call
+>>>> `IkiWiki::Plugin::meta::preprocess` (or a refactored-out function that's
+>>>> similar).
+>>>>
+>>>> There are also some cross-site scripting issues (see below)... --[[smcv]]
+
+>> (On the site I mentioned, I'm using an unmodified version of `field`,
+>> and currently working around the collision by tagging books' pages
+>> with `bookauthor` instead of `author` in the YAML.) --s
+
+>> Revisiting this after more thought, the problem here is similar to the
+>> possibility that a wiki user adds a `meta` shortcut
+>> to [[shortcuts]], or conversely, that a plugin adds a `cpan` directive
+>> that conflicts with the `cpan` shortcut that pages already use. (In the
+>> case of shortcuts, this is resolved by having plugin-defined directives
+>> always win.) For plugin-defined meta keywords this is the plugin
+>> author's/wiki admin's problem - just don't enable conflicting plugins! -
+>> but it gets scary when you start introducing things like `ymlfront`, which
+>> allow arbitrary, wiki-user-defined fields, even ones that subvert
+>> other plugins' assumptions.
+>>
+>> The `pagetemplate` hook is particularly alarming because page templates are
+>> evaluated in many contexts, not all of which are subject to the
+>> htmlscrubber or escaping; because the output from `field` isn't filtered,
+>> prefixed or delimited, when combined with an arbitrary-key-setting plugin
+>> like `ymlfront` it can interfere with other plugins' expectations
+>> and potentially cause cross-site scripting exploits. For instance, `inline`
+>> has a `pagetemplate` hook which defines the `FEEDLINKS` template variable
+>> to be a blob of HTML to put in the `<head>` of the page. As a result, this
+>> YAML would be bad:
+>>
+>> ---
+>> FEEDLINKS: <script>alert('code injection detected')</script>
+>> ---
+>>
+>> (It might require a different case combination due to implementation
+>> details, I'm not sure.)
+>>
+>> It's difficult for `field` to do anything about this, because it doesn't
+>> know whether a field is meant to be plain text, HTML, a URL, or something
+>> else.
+>>
+>> If `field`'s `pagetemplate` hook did something more limiting - like
+>> only emitting template variables starting with `field_`, or from some
+>> finite set, or something - then this would cease to be a problem, I think?
+>>
+>> `ftemplate` and `getfield` don't have this problem, as far as I can see,
+>> because their output is in contexts where the user could equally well have
+>> written raw HTML directly; the user can cause themselves confusion, but
+>> can't cause harmful output. --[[smcv]]
+
+From a coding style point of view, the `$CamelCase` variable names aren't
+IkiWiki style, and the `match_foo` functions look as though they could benefit
+from being thin wrappers around a common `&IkiWiki::Plugin::field::match`
+function (see `meta` for a similar approach).
+
+I think the documentation would probably be clearer in a less manpage-like
+and more ikiwiki-like style?
+
+> I don't think ikiwiki *has* a "style" for docs, does it? So I followed the Perl Module style. And I'm rather baffled as to why having the docs laid out in clear sections... make them less clear. --[[KathrynAndersen]]
+
+>> I keep getting distracted by the big shouty headings :-)
+>> I suppose what I was really getting at was that when this plugin
+>> is merged, its docs will end up split between its plugin
+>> page, [[plugins/write]] and [[ikiwiki/PageSpec]]; on some of the
+>> contrib plugins I've added I've tried to separate the docs
+>> according to how they'll hopefully be laid out after merge. --s
+
+If one of my branches from [[todo/allow_plugins_to_add_sorting_methods]] is
+accepted, a `field()` cmp type would mean that [[plugins/contrib/report]] can
+stop reimplementing sorting. Here's the implementation I'm using, with
+your "sortspec" concept (a sort-hook would be very similar): if merged,
+I think it should just be part of `field` rather than a separate plugin.
+
+ # Copyright © 2010 Simon McVittie, released under GNU GPL >= 2
+ package IkiWiki::Plugin::fieldsort;
+ use warnings;
+ use strict;
+ use IkiWiki 3.00;
+ use IkiWiki::Plugin::field;
+
+ sub import {
+ hook(type => "getsetup", id => "fieldsort", call => \&getsetup);
+ }
+
+ sub getsetup () {
+ return
+ plugin => {
+ safe => 1,
+ rebuild => undef,
+ },
+ }
+
+ package IkiWiki::SortSpec;
+
+ sub cmp_field {
+ if (!length $_[0]) {
+ error("sort=field requires a parameter");
+ }
+
+ my $left = IkiWiki::Plugin::field::field_get_value($_[0], $a);
+ my $right = IkiWiki::Plugin::field::field_get_value($_[0], $b);
+
+ $left = "" unless defined $left;
+ $right = "" unless defined $right;
+ return $left cmp $right;
+ }
+
+ 1;
+
+----
+
+Disclaimer: I've only looked at this plugin and ymlfront, not other related
+stuff yet. (I quite like ymlfront, so I looked at this as its dependency. :)
+I also don't want to annoy you with a lot of design discussion
+if your main goal was to write a plugin that did exactly what you wanted.
+
+My first question is: Why we need another plugin storing metadata
+about the page, when we already have the meta plugin? Much of the
+complication around the field plugin has to do with it accessing info
+belonging to the meta plugin, and generalizing that to be able to access
+info stored by other plugins too. (But I don't see any other plugins that
+currently store such info). Then too, it raises points of confusion like
+smcv's discuission of field author vs meta author above. --[[Joey]]
+
+> The point is exactly in the generalization, to provide a uniform interface for accessing structured data, no matter what the source of it, whether that be the meta plugin or some other plugin.
+
+> There were a few reasons for this:
+
+>1. In converting my site over from PmWiki, I needed something that was equivalent to PmWiki's Page-Text-Variables (which is how PmWiki implements structured data).
+>2. I also wanted an equivalent of PmWiki's Page-Variables, which, rather than being simple variables, are the return-value of a function. This gives one a lot of power, because one can do calculations, derive one thing from another. Heck, just being able to have a "basename" variable is useful.
+>3. I noticed that in the discussion about structured data, it was mired down in disagreements about what form the structured data should take; I wanted to overcome that hurdle by decoupling the form from the content.
+>4. I actually use this to solve (1), because, while I do use ymlfront, initially my pages were in PmWiki format (I wrote (another) unreleased plugin which parses PmWiki format) including PmWiki's Page-Text-Variables for structured data. So I needed something that could deal with multiple formats.
+
+> So, yes, it does cater to mostly my personal needs, but I think it is more generally useful, also.
+> --[[KathrynAndersen]]
+
+>> Is it fair to say, then, that `field`'s purpose is to take other
+>> plugins' arbitrary per-page data, and present it as a single
+>> merged/flattened string => string map per page? From the plugins
+>> here, things you then use that merged map for include:
+>>
+>> * sorting - stolen by [[todo/allow_plugins_to_add_sorting_methods]]
+>> * substitution into pages with Perl-like syntax - `getfield`
+>> * substitution into wiki-defined templates - the `pagetemplate`
+>> hook
+>> * substitution into user-defined templates - `ftemplate`
+>>
+>> As I mentioned above, the flattening can cause collisions (and in the
+>> `pagetemplate` case, even security problems).
+>>
+>> I wonder whether conflating Page Text Variables with Page Variables
+>> causes `field` to be more general than it needs to be?
+>> To define a Page Variable (function-like field), you need to write
+>> a plugin containing that Perl function; if we assume that `field`
+>> or something resembling it gets merged into ikiwiki, then it's
+>> reasonable to expect third-party plugins to integrate with whatever
+>> scaffolding there is for these (either in an enabled-by-default
+>> plugin that most people are expected to leave enabled, like `meta`
+>> now, or in the core), and it doesn't seem onerous to expect each
+>> plugin that wants to participate in this mechanism to have code to
+>> do so. While it's still contrib, `field` could just have a special case
+>> for the meta plugin, rather than the converse?
+>>
+>> If Page Text Variables are limited to being simple strings as you
+>> suggest over in [[forum/an_alternative_approach_to_structured_data]],
+>> then they're functionally similar to `meta` fields, so one way to
+>> get their functionality would be to extend `meta` so that
+>>
+>> \[[!meta badger="mushroom"]]
+>>
+>> (for an unrecognised keyword `badger`) would store
+>> `$pagestate{$page}{meta}{badger} = "mushroom"`? Getting this to
+>> appear in templates might be problematic, because a naive
+>> `pagetemplate` hook would have the same problem that `field` combined
+>> with `ymlfront` currently does.
+>>
+>> One disadvantage that would appear if the function-like and
+>> meta-like fields weren't in the same namespace would be that it
+>> wouldn't be possible to switch a field from being meta-like to being
+>> function-like without changing any wiki content that referenced it.
+>>
+>> Perhaps meta-like fields should just *be* `meta` (with the above
+>> enhancement), as a trivial case of function-like fields? That would
+>> turn `ymlfront` into an alternative syntax for `meta`, I think?
+>> That, in turn, would hopefully solve the special-fields problem,
+>> by just delegating it to meta. I've been glad of the ability to define
+>> new ad-hoc fields with this plugin without having to write an extra plugin
+>> to do so (listing books with a `bookauthor` and sorting them by
+>> `"field(bookauthor) title"`), but that'd be just as easy if `meta`
+>> accepted ad-hoc fields?
+>>
+>> --[[smcv]]
+
+>>> Your point above about cross-site scripting is a valid one, and something I
+>>> hadn't thought of (oops).
+
+>>> I still want to be able to populate pagetemplate templates with field, because I
+>>> use it for a number of things, such as setting which CSS files to use for a
+>>> given page, and, as I said, for titles. But apart from the titles, I
+>>> realize I've been setting them in places other than the page data itself.
+>>> (Another unreleased plugin, `concon`, uses Config::Context to be able to
+>>> set variables on a per-site, per-directory and a per-page basis).
+
+>>> The first possible solution is what you suggested above: for field to only
+>>> set values in pagetemplate which are prefixed with *field_*. I don't think
+>>> this is quite satisfactory, since that would still mean that people could
+>>> put un-scrubbed values into a pagetemplate, albeit they would be values
+>>> named field_foo, etc. --[[KathrynAndersen]]
+
+>>>> They can already do similar; `PERMALINK` is pre-sanitized to
+>>>> ensure that it's a "safe" URL, but if an extremely confused wiki admin was
+>>>> to put `COPYRIGHT` in their RSS/Atom feed's `<link>`, a malicious user
+>>>> could put an unsafe (e.g. Javascript) URL in there (`COPYRIGHT` *is*
+>>>> HTML-scrubbed, but "javascript:alert('pwned!')" is just text as far as a
+>>>> HTML sanitizer is concerned, so it passes straight through). The solution
+>>>> is to not use variables in situations where that variable would be
+>>>> inappropriate. Because `field` is so generic, the definition of what's
+>>>> appropriate is difficult. --[[smcv]]
+
+>>> An alternative solution would be to classify field registration as "secure"
+>>> and "insecure". Sources such as ymlfront would be insecure, sources such
+>>> as concon (or the $config hash) would be secure, since they can't be edited
+>>> as pages. Then, when doing pagetemplate substitution (but not ftemplate
+>>> substitution) the insecure sources could be HTML-escaped.
+>>> --[[KathrynAndersen]]
+
+>>>> Whether you trust the supplier of data seems orthogonal to whether its value
+>>>> is (meant to be) interpreted as plain text, HTML, a URL or what?
+>>>>
+>>>> Even in cases where you trust the supplier, you need to escape things
+>>>> suitably for the context, not for security but for correctness. The
+>>>> definition of the value, and the context it's being used in, changes the
+>>>> processing you need to do. An incomplete list:
+>>>>
+>>>> * HTML used as HTML needs to be html-scrubbed if and only if untrusted
+>>>> * URLs used as URLs need to be put through `safeurl()` if and only if
+>>>> untrusted
+>>>> * HTML used as plain text needs tags removed regardless
+>>>> * URLs used as plain text are safe
+>>>> * URLs or plain text used in HTML need HTML-escaping (and URLs also need
+>>>> `safeurl()` if untrusted)
+>>>> * HTML or plain text used in URLs need URL-escaping (and the resulting
+>>>> URL might need sanitizing too?)
+>>>>
+>>>> I can't immediately think of other data types we'd be interested in beyond
+>>>> text, HTML and URL, but I'm sure there are plenty.
+
+>>>>> But isn't this a problem with anything that uses pagetemplates? Or is
+>>>>> the point that, with plugins other than `field`, they all know,
+>>>>> beforehand, the names of all the fields that they are dealing with, and
+>>>>> thus the writer of the plugin knows which treatment each particular field
+>>>>> needs? For example, that `meta` knows that `title` needs to be
+>>>>> HTML-escaped, and that `baseurl` doesn't. In that case, yes, I see the problem.
+>>>>> It's a tricky one. It isn't as if there's only ever going to be a fixed set of fields that need different treatment, either. Because the site admin is free to add whatever fields they like to the page template (if they aren't using the default one, that is. I'm not using the default one myself).
+>>>>> Mind you, for trusted sources, since the person writing the page template and the person providing the variable are the same, they themselves would know whether the value will be treated as HTML, plain text, or a URL, and thus could do the needed escaping themselves when writing down the value.
+
+>>>>> Looking at the content of the default `page.tmpl` let's see what variables fall into which categories:
+
+>>>>> * **Used as URL:** BASEURL, EDITURL, PARENTLINKS->URL, RECENTCHANGESURL, HISTORYURL, GETSOURCEURL, PREFSURL, OTHERLANGUAGES->URL, ADDCOMMENTURL, BACKLINKS->URL, MORE_BACKLINKS->URL
+>>>>> * **Used as part of a URL:** FAVICON, LOCAL_CSS
+>>>>> * **Needs to be HTML-escaped:** TITLE
+>>>>> * **Used as-is (as HTML):** FEEDLINKS, RELVCS, META, PERCENTTRANSLATED, SEARCHFORM, COMMENTSLINK, DISCUSSIONLINK, OTHERLANGUAGES->PERCENT, SIDEBAR, CONTENT, COMMENTS, TAGS->LINK, COPYRIGHT, LICENSE, MTIME, EXTRAFOOTER
+
+>>>>> This looks as if only TITLE needs HTML-escaping all the time, and that the URLS all end with "URL" in their name. Unfortunately the FAVICON and LOCAL_CSS which are part of URLS don't have "URL" in their name, though that's fair enough, since they aren't full URLs.
+
+>>>>> --K.A.
+
+>>>> One reasonable option would be to declare that `field` takes text-valued
+>>>> fields, in which case either consumers need to escape
+>>>> it with `<TMPL_VAR FIELD_FOO ESCAPE=HTML>`, and not interpret it as a URL
+>>>> without first checking `safeurl`), or the pagetemplate hook needs to
+>>>> pre-escape.
+
+>>>>> Since HTML::Template does have the ability to do ESCAPE=HTML/URL/JS, why not take advantage of that? Some things, like TITLE, probably should have ESCAPE=HTML all the time; that would solve the "to escape or not to escape" problem that `meta` has with titles. After all, when one *sorts* by title, one doesn't really want HTML-escaping in it; only when one uses it in a template. -- K.A.
+
+>>>> Another reasonable option would be to declare that `field` takes raw HTML,
+>>>> in which case consumers need to only use it in contexts that will be
+>>>> HTML-scrubbed (but it becomes unsuitable for using as text - problematic
+>>>> for text-based things like sorting or URLs, and not ideal for searching).
+>>>>
+>>>> You could even let each consumer choose how it's going to use the field,
+>>>> by having the `foo` field generate `TEXT_FOO` and `HTML_FOO` variables?
+>>>> --[[smcv]]
+
+>>>>> Something similar is already done in `template` and `ftemplate` with the `raw_` prefix, which determines whether the variable should have `htmlize` run over it first before the value is applied to the template. Of course, that isn't scrubbing or escaping, because with those templates, the scrubbing is done afterwards as part of the normal processing.
+
+>>> Another problem, as you point out, is special-case fields, such as a number of
+>>> those defined by `meta`, which have side-effects associated with them, more
+>>> than just providing a value to pagetemplate. Perhaps `meta` should deal with
+>>> the side-effects, but use `field` as an interface to get the values of those special fields.
+
+>>> --[[KathrynAndersen]]
diff --git a/doc/plugins/contrib/ftemplate/discussion.mdwn b/doc/plugins/contrib/ftemplate/discussion.mdwn
new file mode 100644
index 000000000..1e0bca5d8
--- /dev/null
+++ b/doc/plugins/contrib/ftemplate/discussion.mdwn
@@ -0,0 +1,33 @@
+I initially thought this wasn't actually necessary - the combination
+of [[plugins/template]] with [[plugins/contrib/field]]'s `pagetemplate`
+hook ought to provide the same functionality. However, `template`
+doesn't run `pagetemplate` hooks; a more general version of this
+plugin would be to have a variant of `template` that runs `pagetemplate`
+hooks (probably easiest to just patch `template` to implement a
+second directive, or have a special parameter `run_hooks="yes"`,
+or something).
+
+> I got the impression that `pagetemplate` hooks are intended to be completely independent of `template` variables; page-template is for the actual `page.tmpl` template, while `template` is for other templates which are used inside the page content. So I don't understand why one would need a run_hooks option. --[[KathrynAndersen]]
+
+>> `Render`, `inline`, `comments` and `recentchanges` run `pagetemplate`
+>> hooks, as does anything that uses `IkiWiki::misctemplate`. From that
+>> quick survey, it seems as though `template` is the only thing that
+>> uses `HTML::Template` but *doesn't* run `pagetemplate` hooks?
+>>
+>> It just seems strange to me that `field` needs to have its own
+>> variant of `template` (this), its own variant of `inline` (`report`),
+>> and so on - I'd tend to lean more towards having `field`
+>> enhance the existing plugins. I'm not an ikiwiki committer,
+>> mind... Joey, your opinion would be appreciated! --[[smcv]]
+
+>>> I did it that way basically because I needed the functionality ASAP, and I didn't want to step on anyone's toes, so I made them as separate plugins. If Joey wants to integrate the functionality into IkiWiki proper, I would be very happy, but I don't want to put pressure on him. --[[KathrynAndersen]]
+
+Another missing thing is that `ftemplate` looks in
+the "system" templates directories, not just in the wiki, but that
+seems orthogonal (and might be a good enhancement to `template` anyway).
+--[[smcv]]
+
+> Yes, I added that because I wanted the option of not having to make all my templates work as wiki pages also. --[[KathrynAndersen]]
+
+>> Joey has added support for
+>> [[todo/user-defined_templates_outside_the_wiki]] now. --s
diff --git a/doc/plugins/contrib/highlightcode.mdwn b/doc/plugins/contrib/highlightcode.mdwn
index 8abb76583..f1df204bb 100644
--- a/doc/plugins/contrib/highlightcode.mdwn
+++ b/doc/plugins/contrib/highlightcode.mdwn
@@ -1,6 +1,8 @@
[[!template id=plugin name=highlightcode author="[[sabr]]"]]
[[!tag type/format]]
+(An alternative to this plugin, [[plugins/highlight]], is now provided with IkiWiki. --[[smcv]])
+
A small plugin to allow Ikiwiki to display source files complete with syntax highlighting. Files with recognized extensions (i.e. my-file.cpp) are be rendered just like any other Ikiwiki page. You can even edit your source files with Ikiwiki's editor.
It uses the Syntax::Highlight::Engine::Kate Perl module to do the highlighting.
diff --git a/doc/plugins/contrib/pod/discussion.mdwn b/doc/plugins/contrib/pod/discussion.mdwn
new file mode 100644
index 000000000..9187b1350
--- /dev/null
+++ b/doc/plugins/contrib/pod/discussion.mdwn
@@ -0,0 +1,14 @@
+My one concern about this plugin is the `=for` markup in POD.
+
+> Some format names that formatters currently are known to
+> accept include "roff", "man", "latex", "tex", "text", and "html".
+
+I don't know which of these [[!cpan Pod::Xhtml]] supports. If it currently
+supports, or later support latex, that could be problimatic since that
+could maybe be used to include files or run code. --[[Joey]]
+
+> I don't know, either; the documentation for [[!cpan Pod:Xhtml]] is silent on this subject. --[[KathrynAndersen]]
+
+>> I'm afraid the only approach is to audit the existing code in the perl
+>> module(s), and then hope nothing is added to them later that opens a
+>> security hole. --[[Joey]]
diff --git a/doc/plugins/contrib/postal.mdwn b/doc/plugins/contrib/postal.mdwn
index b2f875393..c522f8bcb 100644
--- a/doc/plugins/contrib/postal.mdwn
+++ b/doc/plugins/contrib/postal.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=postal author="[[DavidBremner]]"]]
-[[!tag type/useful]]
+[[!tag type/special-purpose]]
The `postal` plugin allows users to send mail to
a special address to comment on a page. It uses the [[mailbox]]
diff --git a/doc/plugins/contrib/report.mdwn b/doc/plugins/contrib/report.mdwn
index 7130bcb5f..c364d4a3a 100644
--- a/doc/plugins/contrib/report.mdwn
+++ b/doc/plugins/contrib/report.mdwn
@@ -18,7 +18,7 @@ IkiWiki::Plugin::report - Produce templated reports from page field data.
This plugin provides the **report** directive. This enables one to report on
the structured data ("field" values) of multiple pages; the output is formatted
-via a template. This depends on the "field" plugin.
+via a template. This depends on the [[plugins/contrib/field]] plugin.
The pages to report on are selected by a PageSpec given by the "pages"
parameter. The template is given by the "template" parameter.
@@ -89,7 +89,7 @@ The "mood_summary" template might be like this:
## <TMPL_VAR NAME="HEADER1">
</TMPL_IF>
### <TMPL_VAR NAME="TITLE">
- (<TMPL_VAR NAME="DATE">) \[[<TMPL_VAR NAME="PAGE"]]
+ (<TMPL_VAR NAME="DATE">) \[[<TMPL_VAR NAME="PAGE">]]
<TMPL_VAR NAME="DESCRIPTION">
### Advanced Options
diff --git a/doc/plugins/contrib/report/discussion.mdwn b/doc/plugins/contrib/report/discussion.mdwn
new file mode 100644
index 000000000..e23a4ced4
--- /dev/null
+++ b/doc/plugins/contrib/report/discussion.mdwn
@@ -0,0 +1,75 @@
+Wow, this plugin does a lot... it seems to be `inline` (but without the feeds
+or the ability to not have `archive="yes"`), plus part of
+[[plugins/contrib/trail]], plus some sorting, plus an ingenious workaround
+for template evaluation being relatively stateless.
+
+A large part of this plugin would just fall off if one of the versions of
+"[[todo/allow_plugins_to_add_sorting_methods]]" was merged, which was a
+large part of the idea of that feature request :-) To make use of that
+you'd have to use `pagespec_match_list` in the trail case too, but that's
+easy enough - just add `list => [@the_trail_pages]` to the arguments.
+
+Another large part would fall off if this plugin required, and internally
+invoked, `inline` (like my `comments` plugin does) - `inline` runs
+`pagetemplate` hooks, and in particular, it'll run the `field` hook.
+Alternatively, this plugin could invoke `pagetemplate` hooks itself,
+removing the special case for `field`.
+
+Perhaps the `headers` thing could migrate into inline somehow? That might
+lead to making inline too big, though.
+
+> I think inline is *already* too big, honestly. --[[KathrynAndersen]]
+
+>> A fair point; perhaps my complaint should be that *inline* does
+>> too many orthogonal things. I suppose the headers feature wouldn't
+>> really make sense in an inline that didn't have `archive="yes"`,
+>> so it'd make sense to recommend this plugin as a replacement
+>> for inlining with archive=yes (for which I now realise "inline"
+>> is the wrong verb anyway :-) ) --s
+
+>>> I think *inline* would be a bit less unwieldy if there was some way of factoring out the feed stuff into a separate plugin, but I don't know if that's possible. --K.A.
+
+Is the intention that the `trail` part is a performance hack, or a way
+to select pages? How does it relate to [[todo/wikitrails]] or
+[[plugins/contrib/trail]]? --[[smcv]]
+
+> The `trail` part is *both* a performance hack, and a way to select pages. I have over 5000 pages on my site, I need all the performance hacks I can get.
+> For the performance hack, it is a way of reducing the need to iterate through every single page in the wiki in order to find matching pages.
+> For the way-to-select-pages, yes, it is intended to be similar to [[todo/wikitrails]] and [[plugins/contrib/trail]] (and will be more similar with the new release which will be happening soon; it will add prev_* and next_* variables).
+> The idea is that, rather than having to add special "trail" links on PageA to indicate that a page is part of the trail,
+> it takes advantage of the `%links` hash, which already contains, for each page, an array of the links from that page to other pages. No need for special markup, just use what's there; a trail is defined as "all the pages linked to from page X", and since it's an array, it has an order already.
+> But to avoid that being too limiting, one can use a `pages=...` pagespec to filter that list to a subset; only the pages one is interested in.
+> And one can also sort it, if one so desires.
+> --[[KathrynAndersen]]
+
+>> That's an interesting approach to trails; I'd missed the fact that
+>> links are already ordered.
+>>
+>> This does have the same problems as tags, though: see
+>> [[bugs/tagged()_matching_wikilinks]] and
+>> [[todo/matching_different_kinds_of_links]]. I suppose the question
+>> now is whether new code should be consistent with `tag` (and
+>> potentially be fixed at the same time as tag itself), or try to
+>> avoid those problems?
+>>
+>> The combination of `trail` with another pagespec in this plugin
+>> does provide a neat way for it to work around having unwanted
+>> pages in the report, by limiting by a suitable tag or subdirectory
+>> or something. --s
+
+>>> Either that, or somehow combine tagging with fields, such that one could declare a tag, and it would create both a link and a field with a given value. (I've been working on something like that, but it still has bugs).
+>>> That way, the test for whether something is tagged would be something like "link(tag/foo) and field(tag foo)".
+>>> --K.A.
+
+>>>> I can see that this'd work well for 1:1 relationships like next
+>>>> and previous, but I don't think that'd work for pages with more than
+>>>> one tag - as far as I can see, `field`'s data model is that each
+>>>> page has no more than one value for each field?
+>>>> [[todo/Matching_different_kinds_of_links]] has some thoughts about
+>>>> how it could be implemented, though. --s
+
+>>>>> You have a point there. I'm not sure what would be better: to add the concept of arrays/sets to `field`, or to think of tags as a special case. Problem is, I find tags as they currently exist to be too limiting. I prefer something that can be used for Faceted Tagging <http://en.wikipedia.org/wiki/Faceted_classification>; that is, things like Author:Fred Nurk, Genre:Historical, Rating:Good, and so on. Of course, that doesn't mean that each tag is limited to only one value, either; just to take the above examples, something might have more than one author, or have multiple genres (such as Historical + Romance).
+
+>>>>> It might be that adding arrays to the `field` plugin is a good way to go: after all, even though field=value is the most common, with the flexibility of things like YAML, one could define all sorts of things. What I'm not so sure about is how to return the values when queried, since some things would be expecting scalars all the time. Ah, perhaps I could use wantarray?
+>>>>> Is there a way of checking a HTML::Template template to see if it expecting an array for a particular value?
+>>>>> --[[KathrynAndersen]]
diff --git a/doc/plugins/contrib/xslt/discussion.mdwn b/doc/plugins/contrib/xslt/discussion.mdwn
index 9cda02f88..72cce083c 100644
--- a/doc/plugins/contrib/xslt/discussion.mdwn
+++ b/doc/plugins/contrib/xslt/discussion.mdwn
@@ -20,3 +20,30 @@ possible. Can it also read other arbitrary files, run other programs, etc?
> For the second point, I think the main concern would be resource usage. XSLT is a pretty limited language; it can read other XML files, but it can't run other programs so far as I know.
> -- [[KathrynAndersen]]
+
+>> XSLT is, indeed, a Turing-complete programming language.
+ However, [XML::LibXSLT][] provides a set of functions to help
+ to minimize the damage that may be caused by running a random
+ program.
+
+>> In particular, `max_depth ()` allows for the maximum
+ recursion depth to be set, while
+ `read_file ()`, `write_file ()`, `create_dir ()`,
+ `read_net ()` and `write_net ()`
+ are the callbacks that allow any of the possible file
+ operations to be denied.
+
+>> To be honest, I'd prefer for the `read_file ()` callback to
+ only grant access to the files below the Ikiwiki source
+ directory, and for all the `write_`&hellip; and
+ &hellip;`_net` callbacks to deny the access unconditionally.
+
+>> One more wishlist item: allow the set of locations to take
+ `.xsl` files from to be preconfigured, so that, e.&nbsp;g.,
+ one could allow (preasumably trusted) system stylesheets,
+ while disallowing any stylesheets that are placed on the Wiki
+ itself.
+
+>> &mdash;&nbsp;Ivan Shmakov, 2010-03-28Z.
+
+[XML::LibXSLT]: http://search.cpan.org/~PAJAS/XML-LibXSLT/LibXSLT.pm
diff --git a/doc/plugins/contrib/ymlfront/discussion.mdwn b/doc/plugins/contrib/ymlfront/discussion.mdwn
new file mode 100644
index 000000000..3ad02af29
--- /dev/null
+++ b/doc/plugins/contrib/ymlfront/discussion.mdwn
@@ -0,0 +1,11 @@
+My field-etc branch in git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git (gitweb:
+<http://git.pseudorandom.co.uk/smcv/ikiwiki.git?a=shortlog;h=refs/heads/field-etc>)
+has some fixes for compatibility with old YAML modules, mostly done by imitating
+Joey's code in IkiWiki::Setup::Yaml. Please consider merging :-) --[[smcv]]
+
+> I would if I could *find* it. I checked out the "field-etc" branch, but I can't find the plugins in question under IkiWiki/Plugin; am I looking in the wrong place, or what?
+> --[[KathrynAndersen]]
+
+>> Sorry, I accidentally removed `field-etc` by pushing with `--mirror` from a
+>> different checkout. I've put it back; it's a branch from your `ikiplugins.git`,
+>> so yes, the code should be in `IkiWiki/Plugin`. --[[smcv]]
diff --git a/doc/plugins/creole/discussion.mdwn b/doc/plugins/creole/discussion.mdwn
index 38ee2bd78..7f47c2c97 100644
--- a/doc/plugins/creole/discussion.mdwn
+++ b/doc/plugins/creole/discussion.mdwn
@@ -12,4 +12,11 @@ I've installed Text::WikiCreole 0.05 and enabled the plugin, but I get an error
>>> forgot, done now --[[Joey]]
+---
+## External Links
+
I'm moving over a really stinkingly old UseMod and creole seems the nearest match. I've worked out that Bare /Subpage links need to become \[\[Subpage\]\], and Top/Sub links need to be \[\[Top/Sub\]\] (or \[\[Top/Sub|Top/Sub\]\], to display in exactly the same way), but I'm stuck on generic hyperlinks. The creole cheat sheet says I should be able to do \[\[http://url.path/foo|LinkText\]\], but that comes out as a link to create the "linktext" page, and Markdown-style \[Link Text\](http://url.path/foo) just gets rendered as is. Any suggestions? --[[schmonz]]
+
+> Was this problem ever solved? -- Thiana
+
+>> Not by me. If I were looking at the problem now, with fresh eyes, I'd probably bite the bullet and just convert everything to Markdown. --[[schmonz]]
diff --git a/doc/plugins/cutpaste.mdwn b/doc/plugins/cutpaste.mdwn
index f74f8a269..ea3665c44 100644
--- a/doc/plugins/cutpaste.mdwn
+++ b/doc/plugins/cutpaste.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=cutpaste author="[[Enrico]]"]]
-[[!tag type/chrome]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/cut]],
[[ikiwiki/directive/copy]] and [[ikiwiki/directive/paste]]
diff --git a/doc/plugins/date.mdwn b/doc/plugins/date.mdwn
index b8dbdfee5..2a33f014c 100644
--- a/doc/plugins/date.mdwn
+++ b/doc/plugins/date.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=date author="[[Joey]]"]]
-[[!tag type/meta]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/date]]
[[ikiwiki/directive]], which provides a way to display an arbitrary date
diff --git a/doc/plugins/ddate.mdwn b/doc/plugins/ddate.mdwn
index 741606a6e..17bb16cff 100644
--- a/doc/plugins/ddate.mdwn
+++ b/doc/plugins/ddate.mdwn
@@ -1,6 +1,7 @@
[[!template id=plugin name=ddate author="[[Joey]]"]]
[[!tag type/fun]]
[[!tag type/date]]
+[[!tag type/chrome]]
Enables use of Discordian dates. `--timeformat` can be used to change
the date format; see `ddate(1)`.
diff --git a/doc/plugins/editpage.mdwn b/doc/plugins/editpage.mdwn
index b830e51aa..346ee7c78 100644
--- a/doc/plugins/editpage.mdwn
+++ b/doc/plugins/editpage.mdwn
@@ -1,4 +1,5 @@
[[!template id=plugin name=editpage core=1 author="[[Joey]]"]]
+[[!tag type/web]]
This plugin allows editing wiki pages in the web interface. It's enabled by
default if [[cgi]] is enabled; disable it if you want cgi for other things
diff --git a/doc/plugins/filecheck.mdwn b/doc/plugins/filecheck.mdwn
index f4563d58e..e5f68b29c 100644
--- a/doc/plugins/filecheck.mdwn
+++ b/doc/plugins/filecheck.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=filecheck core=0 author="[[Joey]]"]]
-[[!tag type/useful]]
+[[!tag type/special-purpose]]
This plugin enhances the regular [[ikiwiki/PageSpec]] syntax with
some additional tests, for things like file size, mime type, and virus
diff --git a/doc/plugins/format.mdwn b/doc/plugins/format.mdwn
index 91e707fcf..b41d365aa 100644
--- a/doc/plugins/format.mdwn
+++ b/doc/plugins/format.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=format core=0 author="[[Joey]]"]]
-[[!tag type/format]]
+[[!tag type/widget]]
This plugin allows mixing different page formats together, by embedding
text formatted one way inside a page formatted another way. This is done
diff --git a/doc/plugins/fortune.mdwn b/doc/plugins/fortune.mdwn
index 9966f456d..3cb125ac1 100644
--- a/doc/plugins/fortune.mdwn
+++ b/doc/plugins/fortune.mdwn
@@ -1,5 +1,6 @@
[[!template id=plugin name=fortune author="[[Joey]]"]]
[[!tag type/fun]]
+[[!tag type/widget]]
This plugin implements the [[ikiwiki/directive/fortune]] [[ikiwiki/directive]].
This directive uses the `fortune` program to insert a fortune into the page.
diff --git a/doc/plugins/getsource.mdwn b/doc/plugins/getsource.mdwn
index 20040ccee..d5404a628 100644
--- a/doc/plugins/getsource.mdwn
+++ b/doc/plugins/getsource.mdwn
@@ -1,4 +1,5 @@
[[!template id=plugin name=getsource author="[[Will_Uther|Will]]"]]
+[[!tag type/web]]
This plugin adds a "Source" link to the top of each page that uses
the CGI to display the page's source.
diff --git a/doc/plugins/getsource/discussion.mdwn b/doc/plugins/getsource/discussion.mdwn
new file mode 100644
index 000000000..45a1d62b5
--- /dev/null
+++ b/doc/plugins/getsource/discussion.mdwn
@@ -0,0 +1 @@
+It would be very cool if this plugin was enabled by default. One of the best ways to learn how to do various advanced things is to be able to "view source" on other wiki's which do things you like. -- [[AdamShand]]
diff --git a/doc/plugins/goto.mdwn b/doc/plugins/goto.mdwn
index 9c401c5d2..8e1de7a10 100644
--- a/doc/plugins/goto.mdwn
+++ b/doc/plugins/goto.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=goto author="[[Simon_McVittie|smcv]]"]]
-[[!tag type/useful]]
+[[!tag type/web]]
This plugin adds a `do=goto` mode for the IkiWiki CGI script. It's mainly
for internal use by the [[404]], [[comments]] and [[recentchanges]]
diff --git a/doc/plugins/graphviz.mdwn b/doc/plugins/graphviz.mdwn
index b89f16b59..65130ae8c 100644
--- a/doc/plugins/graphviz.mdwn
+++ b/doc/plugins/graphviz.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=graphviz author="[[JoshTriplett]]"]]
-[[!tag type/chrome type/format]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/graph]] [[ikiwiki/directive]].
This directive allows embedding [graphviz](http://www.graphviz.org/) graphs in a
diff --git a/doc/plugins/haiku.mdwn b/doc/plugins/haiku.mdwn
index 74eac1c29..448733d95 100644
--- a/doc/plugins/haiku.mdwn
+++ b/doc/plugins/haiku.mdwn
@@ -1,5 +1,6 @@
[[!template id=plugin name=haiku author="[[Joey]]"]]
[[!tag type/fun]]
+[[!tag type/widget]]
This plugin provides a [[ikiwiki/directive/haiku]] [[ikiwiki/directive]].
The directive allows inserting a randomly generated haiku into a wiki page.
diff --git a/doc/plugins/httpauth.mdwn b/doc/plugins/httpauth.mdwn
index 77796a3d7..0eda5554f 100644
--- a/doc/plugins/httpauth.mdwn
+++ b/doc/plugins/httpauth.mdwn
@@ -14,12 +14,22 @@ signed into the wiki. This method is suitable only for private wikis.
## separate cgiauthurl
To use httpauth for a wiki where the content is public, and where
-the `ikiwiki.cgi` needs to be usable without authentication (for searching
-and so on), you can configure a separate url that is used for
-authentication, via the `cgiauthurl` option in the setup file. This
-url will then be redirected to whenever authentication is needed.
+the `ikiwiki.cgi` needs to be usable without authentication (for searching,
+or logging in using other methods, and so on), you can configure a separate
+url that is used for authentication, via the `cgiauthurl` option in the setup
+file. This url will then be redirected to when a user chooses to log in using
+httpauth.
A typical setup is to make an `auth` subdirectory, and symlink `ikiwiki.cgi`
into it. Then configure the web server to require authentication only for
access to the `auth` subdirectory. Then `cgiauthurl` is pointed at this
symlink.
+
+## using only httpauth for some pages
+
+If you want to only use httpauth for editing some pages, while allowing
+other authentication methods to be used for other pages, you can
+configure `httpauth_pagespec` in the setup file. This makes Edit
+links on pages that match the [[ikiwiki/PageSpec]] automatically use
+the `cgiauthurl`, and prevents matching pages from being edited by
+users authentication via other methods.
diff --git a/doc/plugins/img.mdwn b/doc/plugins/img.mdwn
index 114438765..a6cd90f28 100644
--- a/doc/plugins/img.mdwn
+++ b/doc/plugins/img.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=img author="Christian Mock"]]
-[[!tag type/chrome]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/img]] [[ikiwiki/directive]].
While ikiwiki supports inlining full-size images by making a
diff --git a/doc/plugins/inline.mdwn b/doc/plugins/inline.mdwn
index 6c3282576..3eb849fdb 100644
--- a/doc/plugins/inline.mdwn
+++ b/doc/plugins/inline.mdwn
@@ -1,4 +1,5 @@
[[!template id=plugin name=inline core=1 author="[[Joey]]"]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/inline]]
[[ikiwiki/directive]], which allows including one wiki page
diff --git a/doc/plugins/linkmap.mdwn b/doc/plugins/linkmap.mdwn
index 89cb9d8ae..7e51cd935 100644
--- a/doc/plugins/linkmap.mdwn
+++ b/doc/plugins/linkmap.mdwn
@@ -1,5 +1,6 @@
[[!template id=plugin name=linkmap author="[[Joey]]"]]
[[!tag type/meta]]
+[[!tag type/widget]]
[[!tag type/slow]]
This plugin provides the [[ikiwiki/directive/linkmap]] [[ikiwiki/directive]].
diff --git a/doc/plugins/listdirectives.mdwn b/doc/plugins/listdirectives.mdwn
index 2d9bce01d..df854de52 100644
--- a/doc/plugins/listdirectives.mdwn
+++ b/doc/plugins/listdirectives.mdwn
@@ -1,5 +1,6 @@
[[!template id=plugin name=listdirectives author="Will"]]
[[!tag type/meta]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/listdirectives]]
[[ikiwiki/directive]], which inserts a list of currently available
diff --git a/doc/plugins/lockedit.mdwn b/doc/plugins/lockedit.mdwn
index c8f64ea47..681163203 100644
--- a/doc/plugins/lockedit.mdwn
+++ b/doc/plugins/lockedit.mdwn
@@ -12,14 +12,9 @@ to lock. For example, you could choose to lock all pages created before
2006, or all pages that are linked to from the page named "locked". More
usually though, you'll just list some names of pages to lock.
-One handy thing to do if you're using ikiwiki for your blog is to lock
-"* and !*/Discussion". This prevents others from adding to or modifying
-posts in your blog, while still letting them comment via the Discussion
-pages.
-
-Alternatively, if you're using the [[comments]] plugin, you can lock
-"!postcomment(*)" to allow users to comment on pages, but not edit anything
-else.
+If you want to lock down a blog so only you can post to it, you can just
+lock "*", and enable the [[opendiscussion]] plugin, so readers can still post
+[[comments]].
Wiki administrators can always edit locked pages. The [[ikiwiki/PageSpec]]
can specify that some pages are not locked for some users. For example,
diff --git a/doc/plugins/map.mdwn b/doc/plugins/map.mdwn
index 8f5a9f15e..b164d5ca8 100644
--- a/doc/plugins/map.mdwn
+++ b/doc/plugins/map.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=map author="Alessandro Dotti Contra"]]
-[[!tag type/meta]]
+[[!tag type/meta type/widget]]
This plugin provides the [[ikiwiki/directive/map]] [[ikiwiki/directive]],
which generates a hierarchical page map for the wiki.
diff --git a/doc/plugins/mirrorlist.mdwn b/doc/plugins/mirrorlist.mdwn
index b371e8eb7..aedc1f4a0 100644
--- a/doc/plugins/mirrorlist.mdwn
+++ b/doc/plugins/mirrorlist.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=mirror author="[[Joey]]"]]
-[[!tag type/special-purpose]]
+[[!tag type/web]]
This plugin allows adding links a list of mirrors to each page in the
wiki. For each mirror, a name and an url should be specified. Pages are
diff --git a/doc/plugins/moderatedcomments.mdwn b/doc/plugins/moderatedcomments.mdwn
index 97924d742..f9466e833 100644
--- a/doc/plugins/moderatedcomments.mdwn
+++ b/doc/plugins/moderatedcomments.mdwn
@@ -5,6 +5,8 @@ This plugin causes [[comments]] to be held for manual moderation.
Admins can access the comment moderation queue via their preferences page.
By default, all comments made by anyone who is not an admin will be held
-for moderation. The `moderate_users` setting can be set to false to avoid
-moderating comments of logged-in users, while still moderating anonymous
-comments.
+for moderation. The `moderate_pagespec` setting can be used to specify a
+[[ikiwiki/PageSpec]] to match comments and users who should be moderated.
+For example, to avoid moderating comments from logged-in users, set
+`moderate_pagespec` to "`!user(*)`". Or to moderate everyone except for
+admins, set it to "`!admin(*)`".
diff --git a/doc/plugins/more.mdwn b/doc/plugins/more.mdwn
index e9a971289..a0664e843 100644
--- a/doc/plugins/more.mdwn
+++ b/doc/plugins/more.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=more author="Ben"]]
-[[!tag type/format]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/more]] [[ikiwiki/directive]],
which is a way to have a "more" link on a post in a blog, that leads to the
diff --git a/doc/plugins/opendiscussion.mdwn b/doc/plugins/opendiscussion.mdwn
index b2ba68bf7..3b5ab4858 100644
--- a/doc/plugins/opendiscussion.mdwn
+++ b/doc/plugins/opendiscussion.mdwn
@@ -1,5 +1,6 @@
[[!template id=plugin name=opendiscussion author="[[Joey]]"]]
[[!tag type/auth]]
-This plugin allows editing of Discussion pages by anonymous users who have
-not logged into the wiki.
+This plugin allows editing of Discussion pages, and posting of comments,
+even when the [[lockedit]] plugin has been configured to otherwise prevent
+editing.
diff --git a/doc/plugins/orphans.mdwn b/doc/plugins/orphans.mdwn
index e403c2d18..09ad0a51d 100644
--- a/doc/plugins/orphans.mdwn
+++ b/doc/plugins/orphans.mdwn
@@ -1,5 +1,6 @@
[[!template id=plugin name=orphans author="[[Joey]]"]]
[[!tag type/meta]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/orphans]]
[[ikiwiki/directive]], which generates a list of possibly orphaned pages --
diff --git a/doc/plugins/pagecount.mdwn b/doc/plugins/pagecount.mdwn
index a56027e60..71872fae8 100644
--- a/doc/plugins/pagecount.mdwn
+++ b/doc/plugins/pagecount.mdwn
@@ -1,5 +1,6 @@
[[!template id=plugin name=pagecount author="[[Joey]]"]]
[[!tag type/meta]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/pagecount]]
[[ikiwiki/directive]], which displays the number of pages
diff --git a/doc/plugins/pagestats.mdwn b/doc/plugins/pagestats.mdwn
index c3eba6363..347e39a89 100644
--- a/doc/plugins/pagestats.mdwn
+++ b/doc/plugins/pagestats.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=pagestats author="Enrico Zini"]]
-[[!tag type/meta type/tags]]
+[[!tag type/meta type/tags type/widget]]
This plugin provides the [[ikiwiki/directive/pagestats]]
[[ikiwiki/directive]], which can generate stats about how pages link to
diff --git a/doc/plugins/parentlinks.mdwn b/doc/plugins/parentlinks.mdwn
index ef262a30c..c2d364bef 100644
--- a/doc/plugins/parentlinks.mdwn
+++ b/doc/plugins/parentlinks.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=parentlinks core=1 author="[[intrigeri]]"]]
-[[!tag type/link]]
+[[!tag type/link type/chrome]]
This plugin generates the links to a page's parents that typically appear
at the top of a wiki page.
diff --git a/doc/plugins/poll.mdwn b/doc/plugins/poll.mdwn
index 510f67798..099cb399c 100644
--- a/doc/plugins/poll.mdwn
+++ b/doc/plugins/poll.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=poll author="[[Joey]]"]]
-[[!tag type/web]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/poll]] [[ikiwiki/directive]],
which allows inserting an online poll into a page.
diff --git a/doc/plugins/polygen.mdwn b/doc/plugins/polygen.mdwn
index 6045c1ec9..f9cea1f4d 100644
--- a/doc/plugins/polygen.mdwn
+++ b/doc/plugins/polygen.mdwn
@@ -1,5 +1,6 @@
[[!template id=plugin name=polygen author="Enrico Zini"]]
[[!tag type/fun]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/polygen]] [[ikiwiki/directive]],
which allows inserting text generated by polygen into a wiki page.
diff --git a/doc/plugins/postsparkline.mdwn b/doc/plugins/postsparkline.mdwn
index c81f91bdc..b0733e343 100644
--- a/doc/plugins/postsparkline.mdwn
+++ b/doc/plugins/postsparkline.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=postsparkline author="[[Joey]]"]]
-[[!tag type/chrome]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/postsparkline]] [[ikiwiki/directive]].
It uses the [[sparkline]] plugin to create a sparkline of
diff --git a/doc/plugins/prettydate.mdwn b/doc/plugins/prettydate.mdwn
index 11ad4252f..149b7c29c 100644
--- a/doc/plugins/prettydate.mdwn
+++ b/doc/plugins/prettydate.mdwn
@@ -1,5 +1,6 @@
[[!template id=plugin name=prettydate author="[[Joey]]"]]
[[!tag type/date]]
+[[!tag type/chrome]]
Enabling this plugin changes the dates displayed on pages in the wiki to
a format that is nice and easy to read. Examples: "late Wednesday evening,
diff --git a/doc/plugins/progress.mdwn b/doc/plugins/progress.mdwn
index e1b560cc8..20736d18c 100644
--- a/doc/plugins/progress.mdwn
+++ b/doc/plugins/progress.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=progress author="[[Will]]"]]
-[[!tag type/meta]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/progress]]
[[ikiwiki/directive]], which generates a progress bar.
diff --git a/doc/plugins/recentchanges.mdwn b/doc/plugins/recentchanges.mdwn
index 9375296a4..823f68502 100644
--- a/doc/plugins/recentchanges.mdwn
+++ b/doc/plugins/recentchanges.mdwn
@@ -1,4 +1,5 @@
[[!template id=plugin name=recentchanges core=1 author="[[Joey]]"]]
+[[!tag type/meta]]
This plugin examines the [[revision_control_system|rcs]] history and
generates a page describing each recent change made to the wiki. These
diff --git a/doc/plugins/recentchangesdiff.mdwn b/doc/plugins/recentchangesdiff.mdwn
index a7b113ade..57299f92d 100644
--- a/doc/plugins/recentchangesdiff.mdwn
+++ b/doc/plugins/recentchangesdiff.mdwn
@@ -1,4 +1,5 @@
[[!template id=plugin name=recentchangesdiff core=0 author="[[Joey]]"]]
+[[!tag type/meta]]
This plugin extends the [[recentchanges]] plugin, adding a diff for each
change. The diffs are by default hidden from display on the recentchanges
diff --git a/doc/plugins/relativedate.mdwn b/doc/plugins/relativedate.mdwn
index 50c96c5d7..d6e8eb08b 100644
--- a/doc/plugins/relativedate.mdwn
+++ b/doc/plugins/relativedate.mdwn
@@ -1,5 +1,6 @@
[[!template id=plugin name=relativedate author="[[Joey]]"]]
[[!tag type/date]]
+[[!tag type/chrome]]
This plugin lets dates be displayed in relative form. Examples: "2 days ago",
"1 month and 3 days ago", "30 minutes ago". Hovering over the date will
diff --git a/doc/plugins/rename.mdwn b/doc/plugins/rename.mdwn
index ddaede8b0..abb361329 100644
--- a/doc/plugins/rename.mdwn
+++ b/doc/plugins/rename.mdwn
@@ -2,7 +2,8 @@
[[!tag type/web]]
This plugin allows pages or other files to be renamed using the web
-interface.
+interface. Following Unix tradition, renaming also allows moving to a
+different directory.
Users can only rename things that they are allowed to edit or upload.
diff --git a/doc/plugins/repolist.mdwn b/doc/plugins/repolist.mdwn
index 9b3a7575e..efd9c9352 100644
--- a/doc/plugins/repolist.mdwn
+++ b/doc/plugins/repolist.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=repolist author="[[Joey]]"]]
-[[!tag type/useful]]
+[[!tag type/web]]
This plugin allows you to configure ikiwiki with the location of
[[rcs]] repositories for your wiki's source. This is done via the
diff --git a/doc/plugins/rsync.mdwn b/doc/plugins/rsync.mdwn
index 315b663c0..e48886168 100644
--- a/doc/plugins/rsync.mdwn
+++ b/doc/plugins/rsync.mdwn
@@ -1,4 +1,5 @@
[[!template id=plugin name=rsync author="[[schmonz]]"]]
+[[!tag type/special-purpose]]
This plugin allows ikiwiki to push generated pages to another host
by running a command such as `rsync`.
diff --git a/doc/plugins/shortcut.mdwn b/doc/plugins/shortcut.mdwn
index cca1f4bdd..1e8e85ed8 100644
--- a/doc/plugins/shortcut.mdwn
+++ b/doc/plugins/shortcut.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=shortcut author="[[Joey]]"]]
-[[!tag type/format]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/shortcut]] [[ikiwiki/directive]].
It allows external links to commonly linked to sites to be made
diff --git a/doc/plugins/sidebar.mdwn b/doc/plugins/sidebar.mdwn
index 4e356d65a..012733456 100644
--- a/doc/plugins/sidebar.mdwn
+++ b/doc/plugins/sidebar.mdwn
@@ -1,24 +1,27 @@
[[!template id=plugin name=sidebar author="Tuomo Valkonen"]]
[[!tag type/chrome]]
-If this plugin is enabled, then a sidebar is added to pages in the wiki.
-The content of the sidebar is simply the content of a page named
-"sidebar" (ie, create a "sidebar.mdwn").
+This plugin allows adding a sidebar to pages in the wiki.
+
+By default, and unless the `global_sidebars` setting is turned off,
+a sidebar is added to all pages in the wiki. The content of the sidebar
+is simply the content of a page named "sidebar" (ie, create a "sidebar.mdwn").
Typically this will be a page in the root of the wiki, but it can also be a
[[ikiwiki/SubPage]]. In fact, this page,
[[plugins/sidebar|plugins/sidebar]], will be treated as a sidebar for the
[[plugins]] page, and of all of its SubPages, if the plugin is enabled.
-Note that to disable a sidebar for a [[ikiwiki/SubPage]] of a page that has
-a sidebar, you can create a sidebar page that is completely empty. This
-will turn off the sidebar altogether.
+There is also a [[ikiwiki/directive/sidebar]] directive that can be used
+to provide a custom sidebar content for a page.
+
+----
-Warning: Any change to the sidebar will cause a rebuild of the whole wiki,
-since every page includes a copy that has to be updated. This can
-especially be a problem if the sidebar includes an [[ikiwiki/directive/inline]]
-directive, since any changes to pages inlined into the sidebar
-will change the sidebar and cause a full wiki rebuild.
+Warning: Any change to the sidebar page will cause a rebuild of the whole
+wiki, since every page includes a copy that has to be updated. This can
+especially be a problem if the sidebar includes an
+[[ikiwiki/directive/inline]] directive, since any changes to pages inlined
+into the sidebar will change the sidebar and cause a full wiki rebuild.
Instead, if you include a [[ikiwiki/directive/map]] directive on the sidebar,
and it does not use the `show` parameter, only adding or removing pages
diff --git a/doc/plugins/sortnaturally.mdwn b/doc/plugins/sortnaturally.mdwn
new file mode 100644
index 000000000..a16381946
--- /dev/null
+++ b/doc/plugins/sortnaturally.mdwn
@@ -0,0 +1,6 @@
+[[!template id=plugin name=sortnaturally core=1 author="[[chrysn]], [[smcv]]"]]
+[[!tag type/meta]]
+
+This plugin provides the `title_natural` [[ikiwiki/pagespec/sorting]]
+order, which uses [[!cpan Sort::Naturally]] to sort numbered pages in a
+more natural order.
diff --git a/doc/plugins/sparkline.mdwn b/doc/plugins/sparkline.mdwn
index bcc5daec6..ee3928d7e 100644
--- a/doc/plugins/sparkline.mdwn
+++ b/doc/plugins/sparkline.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=sparkline author="[[Joey]]"]]
-[[!tag type/chrome]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/sparkline]]
[[ikiwiki/directive]], which allows for easily embedding sparklines into
diff --git a/doc/plugins/table.mdwn b/doc/plugins/table.mdwn
index 10a85bb2c..fe66f90a8 100644
--- a/doc/plugins/table.mdwn
+++ b/doc/plugins/table.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=table author="[[VictorMoral]]"]]
-[[!tag type/format]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/table]] [[ikiwiki/directive]].
It can build HTML tables from data in CSV (comma-separated values)
diff --git a/doc/plugins/template.mdwn b/doc/plugins/template.mdwn
index 3485fe64c..da775f232 100644
--- a/doc/plugins/template.mdwn
+++ b/doc/plugins/template.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=template author="[[Joey]]"]]
-[[!tag type/format]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/template]] [[ikiwiki/directive]].
With this plugin, you can set up templates, and cause them to be filled out
diff --git a/doc/plugins/testpagespec.mdwn b/doc/plugins/testpagespec.mdwn
index dabcb0bec..8180d5d4b 100644
--- a/doc/plugins/testpagespec.mdwn
+++ b/doc/plugins/testpagespec.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=testpagespec author="[[Joey]]"]]
-[[!tag type/useful]]
+[[!tag type/special-purpose]]
This plugin provides a [[ikiwiki/directive/testpagespec]] [[ikiwiki/directive]].
The directive allows testing a [[ikiwiki/PageSpec]] to see if it matches a
diff --git a/doc/plugins/teximg.mdwn b/doc/plugins/teximg.mdwn
index ae052837f..f3cade85f 100644
--- a/doc/plugins/teximg.mdwn
+++ b/doc/plugins/teximg.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=teximg author="[[PatrickWinnertz]]"]]
-[[!tag type/chrome type/slow]]
+[[!tag type/widget type/slow]]
This plugin provides a [[ikiwiki/directive/teximg]] [[ikiwiki/directive]],
that renders LaTeX formulas into images.
diff --git a/doc/plugins/toc.mdwn b/doc/plugins/toc.mdwn
index 2b7686681..a0ad3a5d0 100644
--- a/doc/plugins/toc.mdwn
+++ b/doc/plugins/toc.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=toc author="[[Joey]]"]]
-[[!tag type/chrome]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/toc]] [[ikiwiki/directive]],
which adds a table of contents to a page.
diff --git a/doc/plugins/toggle.mdwn b/doc/plugins/toggle.mdwn
index 69ac613e0..d1500eba0 100644
--- a/doc/plugins/toggle.mdwn
+++ b/doc/plugins/toggle.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=toggle author="[[Joey]]"]]
-[[!tag type/chrome]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/toggle]] and
[[ikiwiki/directive/toggleable]] [[directives|ikiwiki/directive]].
diff --git a/doc/plugins/txt.mdwn b/doc/plugins/txt.mdwn
index 420898d09..a3087c9e0 100644
--- a/doc/plugins/txt.mdwn
+++ b/doc/plugins/txt.mdwn
@@ -12,3 +12,8 @@ The only exceptions are that [[WikiLinks|ikiwiki/WikiLink]] and
[[directives|ikiwiki/directive]] are still expanded by
ikiwiki, and that, if the [[!cpan URI::Find]] perl module is installed, URLs
in the txt file are converted to hyperlinks.
+
+----
+
+As a special case, a file `robots.txt` will be copied intact into the
+`destdir`, as well as creating a wiki page named "robots".
diff --git a/doc/plugins/type/chrome.mdwn b/doc/plugins/type/chrome.mdwn
index d3f0eb3d3..a1c6d0728 100644
--- a/doc/plugins/type/chrome.mdwn
+++ b/doc/plugins/type/chrome.mdwn
@@ -1 +1 @@
-These plugins affect the look and feel of the wiki.
+These plugins affect the look and feel of the overall wiki.
diff --git a/doc/plugins/type/useful.mdwn b/doc/plugins/type/useful.mdwn
deleted file mode 100644
index 92fcf5af1..000000000
--- a/doc/plugins/type/useful.mdwn
+++ /dev/null
@@ -1 +0,0 @@
-These plugins perform various miscellaneous useful functions.
diff --git a/doc/plugins/type/widget.mdwn b/doc/plugins/type/widget.mdwn
new file mode 100644
index 000000000..875829d0b
--- /dev/null
+++ b/doc/plugins/type/widget.mdwn
@@ -0,0 +1,2 @@
+These plugins allow inserting various things into pages via a
+[[ikiwiki/directive]].
diff --git a/doc/plugins/typography.mdwn b/doc/plugins/typography.mdwn
index 030ef8052..9ff6c4ffd 100644
--- a/doc/plugins/typography.mdwn
+++ b/doc/plugins/typography.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=typography author="[[Roktas]]"]]
-[[!tag type/format]]
+[[!tag type/chrome]]
This plugin, also known as
[SmartyPants](http://daringfireball.net/projects/smartypants/), translates
diff --git a/doc/plugins/underlay.mdwn b/doc/plugins/underlay.mdwn
index f7eafee7c..8836a394c 100644
--- a/doc/plugins/underlay.mdwn
+++ b/doc/plugins/underlay.mdwn
@@ -1,17 +1,17 @@
[[!template id=plugin name=underlay author="[[Simon_McVittie|smcv]]"]]
-[[!tag type/useful]]
+[[!tag type/special-purpose]]
-This plugin adds an `add_underlays` option to the setup file.
-Its value is a list of underlay directories whose content is added to the wiki.
+This plugin adds an `add_underlays` option to the setup file. Its value is
+a list of underlay directories whose content is added to the wiki.
Multiple underlays are normally set up automatically by other plugins (for
-instance, the images used by the [[plugins/smiley]] plugin), but they can also be
-used as a way to pull in external files that you don't want in revision control,
-like photos or software releases.
+instance, the images used by the [[plugins/smiley]] plugin), but they can
+also be used as a way to pull in external files that you don't want in
+revision control, like photos or software releases.
-Directories in `add_underlays` should usually be absolute. If relative, they're
-interpreted as relative to the parent directory of the basewiki underlay, which
-is probably not particularly useful in this context.
+Directories in `add_underlays` should usually be absolute. If relative,
+they're interpreted as relative to the parent directory of the basewiki
+underlay, which is probably not particularly useful in this context.
--
diff --git a/doc/plugins/version.mdwn b/doc/plugins/version.mdwn
index 43027bdd7..326a2e7ce 100644
--- a/doc/plugins/version.mdwn
+++ b/doc/plugins/version.mdwn
@@ -1,5 +1,6 @@
[[!template id=plugin name=version author="[[Joey]]"]]
[[!tag type/meta]]
+[[!tag type/widget]]
This plugin provides the [[ikiwiki/directive/version]]
[[ikiwiki/directive]], which inserts the current version
diff --git a/doc/plugins/websetup.mdwn b/doc/plugins/websetup.mdwn
index f1756ba8f..b4d23ba9c 100644
--- a/doc/plugins/websetup.mdwn
+++ b/doc/plugins/websetup.mdwn
@@ -16,7 +16,8 @@ enabled and disabled using it too. Some settings are not considered safe
enough to be manipulated over the web; these are still shown, by default,
but cannot be modified. To hide them, set `websetup_show_unsafe` to false
in the setup file. A few settings have too complex a data type to be
-configured via the web.
+configured via the web. To mark additional settings as unsafe, you can
+list them in `websetup_unsafe`.
Plugins that should not be enabled/disabled via the web interface can be
listed in `websetup_force_plugins` in the setup file.
diff --git a/doc/plugins/wmd.mdwn b/doc/plugins/wmd.mdwn
index dc9a30703..96c6e2e6c 100644
--- a/doc/plugins/wmd.mdwn
+++ b/doc/plugins/wmd.mdwn
@@ -1,5 +1,5 @@
[[!template id=plugin name=wmd author="[[Will]]"]]
-[[!tag type/chrome]]
+[[!tag type/web]]
[WMD](http://wmd-editor.com/) is a What You See Is What You Mean editor for
[[mdwn]]. This plugin makes WMD be used for editing pages in the wiki.
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn
index 082f0e38f..0bf6fcf48 100644
--- a/doc/plugins/write.mdwn
+++ b/doc/plugins/write.mdwn
@@ -3,8 +3,84 @@ written to extend ikiwiki in many ways. Despite the length of this page,
it's not really hard. This page is a complete reference to everything a
plugin might want to do. There is also a quick [[tutorial]].
+[[!template id="note" text="""
+Ikiwiki is a compiler
+
+One thing to keep in mind when writing a plugin is that ikiwiki is a wiki
+*compiler*. So plugins influence pages when they are built, not when they
+are loaded. A plugin that inserts the current time into a page, for
+example, will insert the build time.
+
+Also, as a compiler, ikiwiki avoids rebuilding pages unless they have
+changed, so a plugin that prints some random or changing thing on a page
+will generate a static page that won't change until ikiwiki rebuilds the
+page for some other reason, like the page being edited.
+
+The [[tutorial]] has some other examples of ways that ikiwiki being a
+compiler may trip up the unwary.
+"""]]
+
[[!toc levels=2]]
+## Highlevel view of ikiwiki
+
+Ikiwiki mostly has two modes of operation. It can either be running
+as a compiler, building or updating a wiki; or as a cgi program, providing
+user interface for editing pages, etc. Almost everything ikiwiki does
+is accomplished by calling various hooks provided by plugins.
+
+### compiler
+
+As a compiler, ikiwiki starts by calling the `refresh` hook. Then it checks
+the wiki's source to find new or changed pages. The `needsbuild` hook is
+then called to allow manipulation of the list of pages that need to be
+built.
+
+Now that it knows what pages it needs to build, ikiwiki runs two
+compile passes. First, it runs `scan` hooks, which collect metadata about
+the pages. Then it runs a page rendering pipeline, by calling in turn these
+hooks: `filter`, `preprocess`, `linkify`, `htmlize`, `postscan`,
+`pagetemplate`, `sanitize`, `format`.
+
+After all necessary pages are built, it calls the `change` hook. Finally,
+if a page is was deleted, the `delete` hook is called, and the files that
+page had previously produced are removed.
+
+### cgi
+
+The flow between hooks when ikiwiki is run as a cgi is best illustrated by
+an example.
+
+Alice browses to a page and clicks Edit.
+
+* Ikiwiki is run as a cgi. It assigns Alice a session cookie, and,
+ by calling the `auth` hooks, sees that she is not yet logged in.
+* The `sessioncgi` hooks are then called, and one of them,
+ from the [[editpage]] plugin, notices that the cgi has been told "do=edit".
+* The [[editpage]] plugin calls the `canedit` hook to check if this
+ page edit is allowed. The [[signinedit]] plugin has a hook that says not:
+ Alice is not signed in.
+* The [[signinedit]] plugin then launches the signin process. A signin
+ page is built by calling the `formbuilder_setup` hook.
+
+Alice signs in with her openid.
+
+* The [[openid]] plugin's `formbuilder` hook sees that an openid was
+ entered in the signin form, and redirects to Alice's openid provider.
+* Alice's openid provider calls back to ikiwiki. The [[openid]] plugin
+ has an `auth` hook that finishes the openid signin process.
+* Signin complete, ikiwiki returns to what Alice was doing before; editing
+ a page.
+* Now all the `canedit` hooks are happy. The [[editpage]] plugin calls
+ `formbuilder_setup` to display the page editing form.
+
+Alice saves her change to the page.
+
+* The [[editpage]] plugin's `formbuilder` hook sees that the Save button
+ was pressed, and calls the `checkcontent` and `editcontent` hooks.
+ Then it saves the page to disk, and branches into the compiler part
+ of ikiwiki to refresh the wiki.
+
## Types of plugins
Most ikiwiki [[plugins]] are written in perl, like ikiwiki. This gives the
@@ -31,16 +107,20 @@ they're the same as far as how they hook into ikiwiki. This document will
explain how to write both sorts of plugins, albeit with an emphasis on perl
plugins.
-## Considerations
+## Plugin interface
-One thing to keep in mind when writing a plugin is that ikiwiki is a wiki
-*compiler*. So plugins influence pages when they are built, not when they
-are loaded. A plugin that inserts the current time into a page, for
-example, will insert the build time. Also, as a compiler, ikiwiki avoids
-rebuilding pages unless they have changed, so a plugin that prints some
-random or changing thing on a page will generate a static page that won't
-change until ikiwiki rebuilds the page for some other reason, like the page
-being edited.
+To import the ikiwiki plugin interface:
+
+ use IkiWiki '3.00';
+
+This will import several variables and functions into your plugin's
+namespace. These variables and functions are the ones most plugins need,
+and a special effort will be made to avoid changing them in incompatible
+ways, and to document any changes that have to be made in the future.
+
+Note that IkiWiki also provides other variables and functions that are not
+exported by default. No guarantee is made about these in the future, so if
+it's not exported, the wise choice is to not use it.
## Registering plugins
@@ -456,7 +536,13 @@ The data returned is a list of `%config` options, followed by a hash
describing the option. There can also be an item named "plugin", which
describes the plugin as a whole. For example:
- return
+ return
+ plugin => {
+ description => "description of this plugin",
+ safe => 1,
+ rebuild => 1,
+ section => "misc",
+ },
option_foo => {
type => "boolean",
description => "enable foo?",
@@ -471,11 +557,6 @@ describes the plugin as a whole. For example:
safe => 1,
rebuild => 0,
},
- plugin => {
- description => "description of this plugin",
- safe => 1,
- rebuild => 1,
- },
* `type` can be "boolean", "string", "integer", "pagespec",
or "internal" (used for values that are not user-visible). The type is
@@ -496,6 +577,9 @@ describes the plugin as a whole. For example:
the plugin) will require a wiki rebuild, false if no rebuild is needed,
and undef if a rebuild could be needed in some circumstances, but is not
strictly required.
+* `section` can optionally specify which section in the config file
+ the plugin fits in. The convention is to name the sections the
+ same as the tags used for [[plugins|plugin]] on this wiki.
### genwrapper
@@ -504,28 +588,17 @@ describes the plugin as a whole. For example:
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:
-
- use IkiWiki '3.00';
-
-This will import several variables and functions into your plugin's
-namespace. These variables and functions are the ones most plugins need,
-and a special effort will be made to avoid changing them in incompatible
-ways, and to document any changes that have to be made in the future.
+## Exported variables
-Note that IkiWiki also provides other variables and functions that are not
-exported by default. No guarantee is made about these in the future, so if
-it's not exported, the wise choice is to not use it.
+Several variables are exported to your plugin when you `use IkiWiki;`
-### %config
+### `%config`
A plugin can access the wiki's configuration via the `%config`
hash. The best way to understand the contents of the hash is to look at
your ikiwiki setup file, which sets the hash content to configure the wiki.
-### %pagestate
+### `%pagestate`
The `%pagestate` hash can be used by plugins to save state that they will need
next time ikiwiki is run. The hash holds per-page state, so to set a value,
@@ -543,7 +616,7 @@ When pages are deleted, ikiwiki automatically deletes their pagestate too.
Note that page state does not persist across wiki rebuilds, only across
wiki updates.
-### %wikistate
+### `%wikistate`
The `%wikistate` hash can be used by a plugin to store persistant state
that is not bound to any one page. To set a value, use
@@ -552,23 +625,53 @@ serialize, `$key` is any string you like, and `$id` must be the same as the
"id" parameter passed to `hook()` when registering the plugin, so that the
state can be dropped if the plugin is no longer used.
-### Other variables
+### `%links`
+
+The `%links` hash can be used to look up the names of each page that
+a page links to. The name of the page is the key; the value is an array
+reference. Do not modify this hash directly; call `add_link()`.
+
+ $links{"foo"} = ["bar", "baz"];
+
+### `%typedlinks`
+
+The `%typedlinks` hash records links of specific types. Do not modify this
+hash directly; call `add_link()`. The keys are page names, and the values
+are hash references. In each page's hash reference, the keys are link types
+defined by plugins, and the values are hash references with link targets
+as keys, and 1 as a dummy value, something like this:
+
+ $typedlinks{"foo"} = {
+ tag => { short_word => 1, metasyntactic_variable => 1 },
+ next_page => { bar => 1 },
+ };
-If your plugin needs to access data about other pages in the wiki. It can
-use the following hashes, using a page name as the key:
+Ordinary [[WikiLinks|ikiwiki/WikiLink]] appear in `%links`, but not in
+`%typedlinks`.
-* `%links` lists the names of each page that a page links to, in an array
- reference.
-* `%destsources` contains the name of the source file used to create each
- destination file.
-* `%pagesources` contains the name of the source file for each page.
+### `%pagesources`
-Also, the `%IkiWiki::version` variable contains the version number for the
-ikiwiki program.
+The `%pagesources` has can be used to look up the source filename
+of a page. So the key is the page name, and the value is the source
+filename. Do not modify this hash.
-### Library functions
+ $pagesources{"foo"} = "foo.mdwn";
-#### `hook(@)`
+### `%destsources`
+
+The `%destsources` hash records the name of the source file used to
+create each destination file. The key is the output filename (ie,
+"foo/index.html"), and the value is the source filename that it was built
+from (eg, "foo.mdwn"). Note that a single source file may create multiple
+destination files. Do not modify this hash directly; call `will_render()`.
+
+ $destsources{"foo/index.html"} = "foo.mdwn";
+
+## Library functions
+
+Several functions are exported to your plugin when you `use IkiWiki;`
+
+### `hook(@)`
Hook into ikiwiki's processing. See the discussion of hooks above.
@@ -577,12 +680,12 @@ named `no_override` is supported, If it's set to a true value, then this hook
will not override any existing hook with the same id. This is useful if
the id can be controled by the user.
-#### `debug($)`
+### `debug($)`
Logs a debugging message. These are supressed unless verbose mode is turned
on.
-#### `error($;$)`
+### `error($;$)`
Aborts with an error message. If the second parameter is passed, it is a
function that is called after the error message is printed, to do any final
@@ -596,13 +699,13 @@ In other hooks, error() is a fatal error, so use with care. Try to avoid
dying on bad input when building a page, as that will halt
the entire wiki build and make the wiki unusable.
-#### `template($;@)`
+### `template($;@)`
Creates and returns a [[!cpan HTML::Template]] object. The first parameter
is the name of the file in the template directory. The optional remaining
parameters are passed to `HTML::Template->new`.
-#### `htmlpage($)`
+### `htmlpage($)`
Passed a page name, returns the base name that will be used for a the html
page created from it. (Ie, it appends ".html".)
@@ -610,23 +713,7 @@ 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.
-### `deptype(@)`
-
-Use this function to generate ikiwiki's internal representation of a
-dependency type from one or more of these keywords:
-
-* `content` is the default. Any change to the content
- of a page triggers the dependency.
-* `presence` is only triggered by a change to the presence
- of a page.
-* `links` is only triggered by a change to the links of a page.
- 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.
-
-If multiple types are specified, they are combined.
-
-#### `pagespec_match_list($$;@)`
+### `pagespec_match_list($$;@)`
Passed a page name, and [[ikiwiki/PageSpec]], returns a list of pages
in the wiki that match the [[ikiwiki/PageSpec]].
@@ -647,7 +734,10 @@ Additional named parameters can be specified:
* `filter` is a reference to a function, that is called and passed a page,
and returns true if the page should be filtered out of the list.
* `sort` specifies a sort order for the list. See
- [[ikiwiki/PageSpec/sorting]] for the avilable sort methods.
+ [[ikiwiki/PageSpec/sorting]] for the avilable sort methods. Note that
+ if a sort method is specified that depends on the
+ page content (such as 'meta(foo)'), the deptype needs to be set to
+ a content dependency.
* `reverse` if true, sorts in reverse.
* `num` if nonzero, specifies the maximum number of matching pages that
will be returned.
@@ -657,7 +747,7 @@ Additional named parameters can be specified:
Any other named parameters are passed on to `pagespec_match`, to further
limit the match.
-#### `add_depends($$;$)`
+### `add_depends($$;$)`
Makes the specified page depend on the specified [[ikiwiki/PageSpec]].
@@ -665,7 +755,7 @@ By default, dependencies are full content dependencies, meaning that the
page will be updated whenever anything matching the PageSpec is modified.
This can be overridden by passing a `deptype` value as the third parameter.
-#### `pagespec_match($$;@)`
+### `pagespec_match($$;@)`
Passed a page name, and [[ikiwiki/PageSpec]], returns a true value if the
[[ikiwiki/PageSpec]] matches the page.
@@ -679,7 +769,23 @@ 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.
-#### `bestlink($$)`
+### `deptype(@)`
+
+Use this function to generate ikiwiki's internal representation of a
+dependency type from one or more of these keywords:
+
+* `content` is the default. Any change to the content
+ of a page triggers the dependency.
+* `presence` is only triggered by a change to the presence
+ of a page.
+* `links` is only triggered by a change to the links of a page.
+ 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.
+
+If multiple types are specified, they are combined.
+
+### `bestlink($$)`
Given a page and the text of a link on the page, determine which
existing page that link best points to. Prefers pages under a
@@ -687,7 +793,7 @@ subdirectory with the same name as the source page, failing that
goes down the directory tree to the base looking for matching
pages, as described in [[ikiwiki/SubPage/LinkingRules]].
-#### `htmllink($$$;@)`
+### `htmllink($$$;@)`
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
@@ -715,7 +821,7 @@ control some options. These are:
* class - set to add a css class to the link
* title - set to add a title attribute to the link
-#### `readfile($;$)`
+### `readfile($;$)`
Given a filename, reads and returns the entire file.
@@ -724,7 +830,7 @@ in binary mode.
A failure to read the file will result in it dying with an error.
-#### `writefile($$$;$$)`
+### `writefile($$$;$$)`
Given a filename, a directory to put it in, and the file's content,
writes a file.
@@ -752,7 +858,7 @@ generally the directory parameter is a trusted toplevel directory like
the srcdir or destdir, and any subdirectories of this are included in the
filename parameter.
-#### `will_render($$)`
+### `will_render($$)`
Given a page name and a destination file name (not including the base
destination directory), register that the page will result in that file
@@ -768,34 +874,34 @@ Ikiwiki uses this information to automatically clean up rendered files when
the page that rendered them goes away or is changed to no longer render
them. will_render also does a few important security checks.
-#### `pagetype($)`
+### `pagetype($)`
Given the name of a source file, returns the type of page it is, if it's
a type that ikiwiki knowns how to htmlize. Otherwise, returns undef.
-#### `pagename($)`
+### `pagename($)`
Given the name of a source file, returns the name of the wiki page
that corresponds to that file.
-#### `pagetitle($)`
+### `pagetitle($)`
Give the name of a wiki page, returns a version suitable to be displayed as
the page's title. This is accomplished by de-escaping escaped characters in
the page name. "_" is replaced with a space, and '__NN__' is replaced by
the UTF character with code NN.
-#### `titlepage($)`
+### `titlepage($)`
This performs the inverse of `pagetitle`, ie, it converts a page title into
a wiki page name.
-#### `linkpage($)`
+### `linkpage($)`
This converts text that could have been entered by the user as a
[[ikiwiki/WikiLink]] into a wiki page name.
-#### `srcfile($;$)`
+### `srcfile($;$)`
Given the name of a source file in the wiki, searches for the file in
the source directory and the underlay directories (most recently added
@@ -805,7 +911,7 @@ Normally srcfile will fail with an error message if the source file cannot
be found. The second parameter can be set to a true value to make it return
undef instead.
-#### `add_underlay($)`
+### `add_underlay($)`
Adds a directory to the set of underlay directories that ikiwiki will
search for files.
@@ -813,18 +919,22 @@ search for files.
If the directory name is not absolute, ikiwiki will assume it is in
the parent directory of the configured underlaydir.
-#### `displaytime($;$)`
+### `displaytime($;$)`
Given a time, formats it for display.
The optional second parameter is a strftime format to use to format the
time.
-#### `gettext`
+### `gettext`
This is the standard gettext function, although slightly optimised.
-#### `urlto($$;$)`
+### `ngettext`
+
+This is the standard ngettext function, although slightly optimised.
+
+### `urlto($$;$)`
Construct a relative url to the first parameter from the page named by the
second. The first parameter can be either a page name, or some other
@@ -833,13 +943,13 @@ destination file, as registered by `will_render`.
If the third parameter is passed and is true, an absolute url will be
constructed instead of the default relative url.
-#### `newpagefile($$)`
+### `newpagefile($$)`
This can be called when creating a new page, to determine what filename
to save the page to. It's passed a page name, and its type, and returns
the name of the file to create, relative to the srcdir.
-#### `targetpage($$;$)`
+### `targetpage($$;$)`
Passed a page and an extension, returns the filename that page will be
rendered to.
@@ -848,11 +958,14 @@ Optionally, a third parameter can be passed, to specify the preferred
filename of the page. For example, `targetpage("foo", "rss", "feed")`
will yield something like `foo/feed.rss`.
-#### `add_link($$)`
+### `add_link($$;$)`
This adds a link to `%links`, ensuring that duplicate links are not
added. Pass it the page that contains the link, and the link text.
+An optional third parameter sets the link type. If not specified,
+it is an ordinary [[ikiwiki/WikiLink]].
+
## Miscellaneous
### Internal use pages
@@ -972,6 +1085,17 @@ it up in the history.
It's ok if this is not implemented, and throws an error.
+If the RCS cannot determine a ctime for the file, return 0.
+
+#### `rcs_getmtime($)`
+
+This is used to get the page modification time for a file from the RCS, by
+looking it up in the history.
+
+It's ok if this is not implemented, and throws an error.
+
+If the RCS cannot determine a mtime for the file, return 0.
+
#### `rcs_receive()`
This is called when ikiwiki is running as a pre-receive hook (or
@@ -1019,6 +1143,24 @@ For example, "backlink(foo)" is influenced by the contents of page foo;
they match; "created_before(foo)" is influenced by the metadata of foo;
while "glob(*)" is not influenced by the contents of any page.
+### Sorting plugins
+
+Similarly, it's possible to write plugins that add new functions as
+[[ikiwiki/pagespec/sorting]] methods. To achieve this, add a function to
+the IkiWiki::SortSpec package named `cmp_foo`, which will be used when sorting
+by `foo` or `foo(...)` is requested.
+
+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
The ikiwiki setup file is loaded using a pluggable mechanism. If you look