### 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`, `indexhtml`,
-`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.
+As a compiler, ikiwiki starts by calling the
+[[`refresh`|plugins/write#refresh]] hook. Then it checks the wiki's source to
+find new or changed pages. The [[`needsbuild`|plugins/write#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`|plugins/write#scan]] hooks, which collect
+metadata about the pages. Then it runs a page rendering pipeline, by calling
+in turn these hooks: [[`filter`|plugins/write#filter]],
+[[`preprocess`|plugins/write#preprocess]],
+[[`linkify`|plugins/write#linkify]], [[`htmlize`|plugins/write#htmlize]],
+[[`indexhtml`|plugins/write#indexhtml]],
+[[`pagetemplate`|plugins/write#pagetemplate]],
+[[`sanitize`|plugins/write#sanitize]], [[`format`|plugins/write#format]].
+
+After all necessary pages are built, it calls the
+[[`changes`|plugins/write#changes]] hook. Finally, if a page was deleted, the
+[[`delete`|plugins/write#delete]] hook is called, and the files that page had
+previously produced are removed.
### cgi
The function is passed no values. It's ok for the function to call
`error()` if something isn't configured right.
-### refresh
+### <a name="refresh">refresh</a>
hook(type => "refresh", id => "foo", call => \&refresh);
It's useful for plugins that need to create or modify a source page. The
function is passed no values.
-### needsbuild
+### <a name="needsbuild">needsbuild</a>
hook(type => "needsbuild", id => "foo", call => \&needsbuild);
The second parameter passed to the function is a reference to an array of
files that have been deleted.
-### scan
+### <a name="scan">scan</a>
hook(type => "scan", id => "foo", call => \&scan);
The function is passed named parameters "page" and "content". Its return
value is ignored.
-### filter
+### <a name="filter">filter</a>
hook(type => "filter", id => "foo", call => \&filter);
can make arbitrary changes. The function is passed named parameters "page",
"destpage", and "content". It should return the filtered content.
-### preprocess
+### <a name="preprocess">preprocess</a>
Adding a preprocessor [[ikiwiki/directive]] is probably the most common use
of a plugin.
be linkified and passed through markdown (or whatever engine is used to
htmlize the page) along with the rest of the page.
-### linkify
+### <a name="linkify">linkify</a>
hook(type => "linkify", id => "foo", call => \&linkify);
for the links on the page and adds them to `%links` (typically by calling
`add_link`).
-### htmlize
+### <a name="htmlize">htmlize</a>
hook(type => "htmlize", id => "ext", call => \&htmlize);
If `hook` is passed an optional "longname" parameter, this value is used
when prompting a user to choose a page type on the edit page form.
-### indexhtml
+### <a name="indexhtml">indexhtml</a>
hook(type => "indexhtml", id => "foo", call => \&indexhtml);
The function is passed named parameters "page", "destpage", and "content".
Its return value is ignored.
-### pagetemplate
+### <a name="pagetemplate">pagetemplate</a>
hook(type => "pagetemplate", id => "foo", call => \&pagetemplate);
parameter, and can return a list of html fragments to add to the action
bar.
-### sanitize
+### <a name="sanitize">sanitize</a>
hook(type => "sanitize", id => "foo", call => \&sanitize);
The function is passed named parameters: "page", "destpage", and "content",
and should return the sanitized content.
-### format
+### <a name="format">format</a>
hook(type => "format", id => "foo", call => \&format);
the second is a log message resembling
`building plugins/write because the phase of the moon has changed`.
-### delete
+### <a name="delete">delete</a>
hook(type => "delete", id => "foo", call => \&delete);
(This hook used to be called "change", but that was not accurate.
For now, plugins using the old hook name will still work.)
-### changes
+### <a name="changes">changes</a>
hook(type => "changes", id => "foo", call => \&changes);