Power Tools

Summary: markup expressions for multi page processing
Version: 2008-06-22
Prerequisites: PmWiki 2.2.beta
Status: new
Maintainer: HansB?

Questions answered by this recipe

This section is optional; use it to indicate the types of questions (if any) this recipe is intended to answer.

Description

Various markup expression for multi page processing. Attach:powertools.php Δ contains a number of markup expressions which can be used on multiple or single page operations.

The initial release contains:

plist

returns a comma-separated list of full page names from page names given as parameters. Pagenames can contain wiki wildcards * and ? and names with negative prefix. Wildcards will be expanded into a list. Negative prefixed names will be excluded from the list.
General syntax:

returns list separated by line feeds. sep=LF or sep=CRLF can also be used, plus any string sep='STRING'.
fmt=groups
output only list of group names.
groups=GROUPPATTERN
as group=GROUPPATTERN but with fmt=groups output:
groups=*
will give a list of all group names.
sep=SEPARATOR
character or string inserted between each full pagename. Default is a comma. CR or \n makes new line separations.
pre=PREFIX
PREFIX string is put in front of every name.
suf=SUFFIX
SUFFIX string is put behind every name.

Syntax examples:

plist can be used to feed pagelists to other markup expressions (see pagecount and wordcount below), or as input in form processing, for instance in Fox forms to provide a list of target pages, to add wiki wildcard target capabilities.

pagelist

returns a comma separated list of pagenames. Parameters are the same as for the (:pagelist:) markup, except that the default output format is fmt=csv, a comma-separated list of pagenames. Note that this expression processes pages significantly slower (3 to 4 times) than plist above.

Syntax examples:

rename

With input from plist or pagelist returns new pagelist with new Group.PageNames GROUP.PREFIX.PageName.SUFFIX if parameters are specified. Use for page backup forms.

pagecount

returns count of pages from input of comma-separated pagelist (delivered by expression plist).

Syntax examples:

wordcount

returns count of words from either a string provided, or a PageName or comma-separated page list.

Syntax examples:

trail

returns either previous or next link for wiki trail. If no trailpage is given, all page in current group are used. Syntax: {(trail [next|prev] linktext TrailPageName)}

Notes

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

See Also

Contributors

Comments