]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/plugins/write.mdwn
don't render internal-use pages, and document them
[ikiwiki.git] / doc / plugins / write.mdwn
index 1cb26a076045ee7b99ac45a16327f4f12143b141..76fa3f0d7e028be4a0272749528d08dbd77e79ad 100644 (file)
@@ -123,7 +123,9 @@ An optional "scan" parameter, if set to a true value, makes the hook be
 called during the preliminary scan that ikiwiki makes of updated pages,
 before begining to render pages. This parameter should be set to true if
 the hook modifies data in `%links`. Note that doing so will make the hook
-be run twice per page build, so avoid doing it for expensive hooks.
+be run twice per page build, so avoid doing it for expensive hooks. (As an
+optimisation, if your preprocessor hook is called in a void contets, you
+can assume it's being run in scan mode.)
 
 Note that if the [[htmlscrubber]] is enabled, html in
 [[ikiwiki/PreProcessorDirective]] output is sanitised, which may limit what
@@ -141,6 +143,11 @@ specifies the filename extension that a file must have to be htmlized using
 this plugin. This is how you can add support for new and exciting markup
 languages to ikiwiki.
 
+Note that if you choose a filename extension that starts with "_",
+ikiwiki will not render the page, or allow the page to be edited with the
+web interface. This is useful for certian types of internal-use pages, but
+should generally be avoided.
+
 The function is passed named parameters: "page" and "content" and should
 return the htmlized content.
 
@@ -246,10 +253,16 @@ a page can be edited using the web interface (commits from revision control
 bypass it). When a page is edited, each registered canedit hook is called
 in turn, and passed the page name, a CGI object, and a session object.
 
-If edit can proceed, the hook should return "". If the edit is not allowed
-by this hook, the hook should return an error message for the user to see.
 If the hook has no opinion about whether the edit can proceed, return
-`undef`, and the next plugin will be asked to decide.
+`undef`, and the next plugin will be asked to decide. If edit can proceed,
+the hook should return "". If the edit is not allowed by this hook, the
+hook should return an error message for the user to see, or a function 
+that can be run to log the user in or perform other action necessary for
+them to be able to edit the page.
+
+This hook should avoid directly redirecting the user to a signin page,
+since it's sometimes used to test to see which pages in a set of pages a
+user can edit.
 
 ### editcontent
 
@@ -279,10 +292,8 @@ it's a form that it needs to modify, will call various methods to
 add/remove/change fields, tweak the validation code for the fields, etc. It
 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.
+Just before a form is displayed to the user, the `formbuilder` hook is
+called. It can be used to validate the form, but should not display it.
 
 ### savestate
 
@@ -327,6 +338,9 @@ used.
 
 When pages are deleted, ikiwiki automatically deletes their pagestate too.
 
+Note that page state does not persist across wiki rebuilds, only across
+wiki updates.
+
 ### Other variables
 
 If your plugin needs to access data about other pages in the wiki. It can