[pmwiki-users] New ZAP powers...

The Editor editor at fast.st
Sun Apr 1 18:05:24 CDT 2007


Hi all!

Have been tinkering away today on some new powers for ZAP!

First, I've just added a really cool new edit command which combines
the best capabilities of ZAP's log command with the best features in
Fox, plus the ability to edit pages directly via ZAP, and/or even edit
sections.  A full description is cut and pasted below from the ZAPsite
documentation.

Second, I've gone ahead and deprecated the {# } markup in favor of the
{( )} markup, mostly because I've been adding bunches of new features
to the new markup, and I'm no longer developing the old markup.  Some
of these newer features include:

* automatic support for things like {(return)} {(browser)} {(secure)}
{(ip)} and {(host)} giving what you would expect.
* a new {(list)} markup which makes formatting CSV lists a snap
(making the listfmt command no longer necessary).
* a new {(source)} markup which shows code on a page (designed
especially for use in the edit command above), but also can be used
otherwise.

Finally, I've switched how ZAP processes field replacements, so they
work more intuitively (ie, as each field is processed, in order).

If anyone spots any bugs or problems, or has questions, please let me
know.  I'm still working on getting everything at ZAPsite upgraded...

Cheers,
Dan

PS.  Deprecated commands (log, listfmt) and markups are still
avialable in ZAParchives so forms can continue to work as they are
without problems with that script enabled.


THE NEW ZAP EDIT COMMAND

This command allows you to do some powerful things! The suggestions
below are only a few tips on it's main features, however, I have not
yet fully experiemented with all it's capabilities.  Think of it as
combining ZAP's former log function, PmWiki's edit form, the
SectionEdit recipe, and FOX on steroids--not to mention everything
else in ZAP!

1) Editing pages
If set to a page name, the contents of the page will be replaced by
the content of field editbody.  ie: a fully functional alternative to
PmWiki's edit form.  Normally this is set in a textarea as follows:

      (:textarea name=editbody:){(source Group.Name)}

Note:  the closing textarea command is supplied by the source markup.

2) Editing sections
If set to a page name with an anchor beginning with #ID, everything
between that anchor and the next #ID anchor can be edited or replaced.
 Use the same #ID in the source markup.  This is a nice substitute for
the SectionEdit recipe.

3) Top/Bottom
You can append the contents of editbody to the top or bottom of the
page by simply putting top or bottom as a flag in the edit command.
This allows you to create logs of various kinds. Basically--the
equivalent of FOX's insertion capability.

4) Append/Prepend
If you have the markup [=(:zap:)=] on the target page, you can add the
flags append or prepend and new posts will be appended or prepended in
relation to the zap marker.  This allows you to position logs in
various ways in various places. Again, much like FOX.

5) Self-deleting links
To create a self-deleting log entry you must first define an id field
in your form (normally set to timestamp, etc), and then in the
editbody field include something like the following

     editbody = "[[#ID{id}]] text {delete}"

You can override the default value by setting your own deletetext
field. Other configurations of course are possible.

6) Sort/Trim
Finally, you can sort either lines in a page, a section, or even whole
sections, and trim them to a predefined length.  Just put sort or
trim=# as flags (with # equal to the max number of entries).  If
another flag follows trim, put a comma after the number.

No--it's not an April fools joke.  It really works, and in less code
than before!



More information about the pmwiki-users mailing list