]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - doc/plugins/write.mdwn
web commit by tschwinge: *Preview* when creating new pages.
[git.ikiwiki.info.git] / doc / plugins / write.mdwn
index d09367f1b1be5784d136ca9b130de4de39431cfd..0e1839c6ca31157ddf0b5edcfd4d78529fbb2327 100644 (file)
@@ -251,6 +251,17 @@ 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.
 
 If the hook has no opinion about whether the edit can proceed, return
 `undef`, and the next plugin will be asked to decide.
 
+### editcontent
+
+       hook(type => "editcontent", id => "foo", call => \&editcontent);
+
+This hook is called when a page is saved (or previewed) using the web
+interface. It is passed named parameters: `content`, `page`, `cgi`, and
+`session`. These are, respectively, the new page content as entered by the
+user, the page name, a `CGI` object, and the user's `CGI::Session`. 
+
+It can modify the content as desired, and should return the content.
+
 ### formbuilder
 
        hook(type => "formbuilder_setup", id => "foo", call => \&formbuilder_setup);
 ### formbuilder
 
        hook(type => "formbuilder_setup", id => "foo", call => \&formbuilder_setup);
@@ -401,7 +412,8 @@ control some options. These are:
 * forcesubpage  - set to force a link to a subpage
 * linktext - set to force the link text to something
 * anchor - set to make the link include an anchor
 * forcesubpage  - set to force a link to a subpage
 * linktext - set to force the link text to something
 * anchor - set to make the link include an anchor
-* rel - set to add a rel attribute to the link.
+* rel - set to add a rel attribute to the link
+* class - set to add a css class to the link
 
 #### `readfile($;$)`
 
 
 #### `readfile($;$)`
 
@@ -437,6 +449,10 @@ destination directory), register that the page will result in that file
 being rendered. It's important to call this before writing to any file in
 the destination directory.
 
 being rendered. It's important to call this before writing to any file in
 the destination directory.
 
+Ikiwiki uses this information to automatically clean up rendered files when
+the page that rendered them goes away or is changes to no longer render
+them. will_render also does a few important security checks.
+
 #### `pagetype($)`
 
 Given the name of a source file, returns the type of page it is, if it's
 #### `pagetype($)`
 
 Given the name of a source file, returns the type of page it is, if it's
@@ -450,8 +466,16 @@ that corresponds to that file.
 #### `srcfile($)`
 
 Given the name of a source file in the wiki, searches for the file in
 #### `srcfile($)`
 
 Given the name of a source file in the wiki, searches for the file in
-the source directory and the underlay directory, and returns the full
-path to the first file found.
+the source directory and the underlay directories (most recently added
+underlays first), and returns the full path to the first file found.
+
+#### `add_underlay($)`
+
+Adds a directory to the set of underlay directories that ikiwiki will
+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($)`