]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - doc/plugins/write.mdwn
move from my inbox..
[git.ikiwiki.info.git] / doc / plugins / write.mdwn
index 016746abb41ce5befff20b79433dc1bee45344ea..bbe047d33995af287e299fe5d68af85bf2c35e4f 100644 (file)
@@ -1,3 +1,12 @@
+Ikiwiki's plugin interface allows all kinds of useful [[plugins]] to be
+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]].
+
+[[toc levels=2]]
+
+## Types of plugins
+
 Most ikiwiki [[plugins]] are written in perl, like ikiwiki. This gives the
 plugin full access to ikiwiki's internals, and is the most efficient.
 However, plugins can actually be written in any language that supports XML
@@ -22,8 +31,6 @@ 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.
 
-[[toc levels=2]]
-
 ## Considerations
 
 One thing to keep in mind when writing a plugin is that ikiwiki is a wiki
@@ -251,8 +258,9 @@ If the hook has no opinion about whether the edit can proceed, return
 
 These hooks allow tapping into the parts of ikiwiki that use [[cpan
 CGI::FormBuilder]] to generate web forms. These hooks are passed named
-parameters: `cgi`, `session`, and `form`. These are, respectively, the
-`CGI` object, the user's `CGI::Session`, and a `CGI::FormBuilder`.
+parameters: `cgi`, `session`, `form`, and `buttons`. These are, respectively,
+the `CGI` object, the user's `CGI::Session`, a `CGI::FormBuilder`, and a
+reference to an array of names of buttons to go on the form.
 
 Each time a form is set up, the `formbuilder_setup` hook is called.
 Typically the `formbuilder_setup` hook will check the form's title, and if
@@ -263,8 +271,7 @@ will not validate or display the form.
 Form validation and display can be overridden by the formbuilder hook.
 By default, ikiwiki will do a basic validation and display of the form,
 but if this hook is registered, it will stop that and let the hook take
-over. This hook is passed an additional named parameter: `buttons` is an
-array of the submit buttons for the form.
+over.
 
 ### savestate