Processors in Vars.pm
Vars
Webber processor, version 1.0
This program must run inside Webber.
This module implements different proccessor to manipulate Webber Vars.
the Vars that are affected by this proccesor usually are defined
in a webber vars.
Vars processors must be used as (one of) the first processor(s).
Vars implement the following proccesors:
Vars::LazyEval
Evaluates/Substitutes the occurrences in webber Vars of %var(name) with
the content of the name webber Vars.
Example: You want to "evalauate" a webber var after the load vars phase
of webber , currently webber only implements immediately (on the momment)
var substituion with this proccesor you can evaleate a var after all the
vars has been read.
Vars::LazyEval use the webber var #vars.lazyeval to define a while separated
list of webber vars to be Lazy Evaluates
Vars::CopyVars
Copy the content of a webber Vars onto another one
Exmaple: You have an old Var definitin in which one variable is used for
example for the "content" of the page, now you use another template with
another name, this processor allow to copy the old var and create a new
one. Use the #vars.CopyVars, a white list of var_src:vars_dst pairs to define
which vars to copy.
The separator has different meanings:
: Means straight Copy src:dst copy src always to dst
:? means conditional copiy src:?dst copy src to dst if dst is not defined
:+ means addition after src:+dst . dst will have the value of dst concatenated
with the value of src (same value if dst wasn't defined
Vars::PathVars
Implements the following "special Vars":
#vars.dep = Dep from wbbSourceRoot to the actual file (in number)
#vars.pathtoroot = "Creates a Path" (concatation of "../.." to the wbbTargetRoot
#vars.pathfromoot = "Path from the wbbTargetRoot to the file"
Note: All this variables requires that file being webbered would be in a directory
below #vars.pathvars.wbbsourceroot (defaults to , to work
correctly.
Vars::readfromfile
Read some webbers vars from a webber format file that.
webbers vars.
#vars.readfromfile.CODE.file=
#vars.readfromfile.CODE.vars=
where CODE is a generic code to allow multiple file import
file is relative to the current (source code path)
vars is a list of vars, use the extended syntax of Vars::CopyVars, so
#vars.readfromfile.info.file= ./wbbdir.cfg.back
#vars.readfromfile.info.vars= title author? contributor+
Will:
- Set the title vars to the one in the file wbbdir.cfg.bak"
- Change the author variable (if not exists) ,
- concat the contributors
Note all the vars are alphanumeric sorted before processing so
#vars.readfromfile.AAAA.file = ../wbbdir.cfg
#vars.readfromfile.AAAA.vars = author
#vars.readfromfile.BBBB.file = ./wbbdir.cfg
#vars.readfromfile.BBBB.vars = author
Will create the author var with the most specific version if
found.
Vars::regex
Perform Regular expressions actions on webber vars
It will use vars in the format #vars.regex.CODE (where code
is a unique code that identifies the regular expresion).
Example
#vars.regex.AAAA.var= wbbIn
#vars.regex.AAAA.regex= s/XXX/juan/g
Perform a substitituion on on var wbbIn, changing the appareance
of XXX by the name juan