WPP 2.13.1.35 - The Web Preprocessor
Author: Marco Lamberto |
||
Index | < Previous Next > |
Variables assignment |
@NAME=val@Valid names can contain uppercase letters, numbers and the '_' underscore char.
<!-- assigns to 'FOO_0' the value 'Title' --> @FOO_0=Title@ <!-- deletes 'FOO_1' if defined --> @FOO_1=@ <!-- sets 'FOO_0' the value of 'FOO_1' --> @FOO_0=@FOO_1@@
Variables substitution |
@NAME@Simply put the variable name between two '@'.
@FOO1=A@ @FOO2=B@ Choose '@FOO1@ ' or '@FOO2@'?
Choose 'A' or 'B'?
Environment variables |
@ENV_*@Every variable of the system environment is available by prepending the 'ENV_' prefix (i.e.: PATH will be available as @ENV_PATH@).
@QS_*@If QUERY_STRING enviroment variable is defined (@ENV_QUERY_STRING@) will be decoded and splitted into variables, one for each field. Fields names are translated into valid names: uppercase with every char non alphanumeric transformed into an underscore char ('_') and the 'QS_' prefix.
<!-- Prints the original QUERY_STRING --> @ENV_QUERY_STRING@ <!-- For this example we suppose that QUERY_STRING is: --> db=00_LINUX&string=window+maker&show_opts=X&lines=-1&nocase=1 <!-- The QS_* vars: --> @QS_DB@ @QS_STRING@ @QS_SHOW_OPTS@ @QS_LINES@ @QS_NOCASE@
<!-- Prints the original QUERY_STRING --> db=00_LINUX&string=window+maker&show_opts=X&lines=-1&nocase=1 <!-- For this example we suppose that QUERY_STRING is: --> db=00_LINUX&string=window+maker&show_opts=X&lines=-1&nocase=1 <!-- The QS_* vars: --> 00_LINUX window maker X -1 1
Special variables |
@DATE_FORMAT=format@This variable holds the @DATE@ and @RCS_DATE@ output format. It can be assigned to any string value. Ordinary characters placed in the format string are copied to it without conversion. Conversion specifiers are introduced by a `%' character, and are replaced as follows:
Flag | Description |
---|---|
%a | The abbreviated weekday name according to the current locale. |
%A | The full weekday name according to the current locale. |
%b | The abbreviated month name according to the current locale. |
%B | The full month name according to the current locale. |
%c | The preferred date and time representation for the current locale. |
%d | The day of the month as a decimal number (range 01 to 31). |
%H | The hour as a decimal number using a 24-hour clock (range 00 to 23). |
%I | The hour as a decimal number using a 12-hour clock (range 01 to 12). |
%j | The day of the year as a decimal number (range 001 to 366). |
%m | The month as a decimal number (range 01 to 12). |
%M | The minute as a decimal number. |
%p | Either `am' or `pm' according to the given time value, or the corresponding strings for the current locale. |
%S | The second as a decimal number. |
%U | The week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week. |
%W | The week number of the current year as a decimal number, starting with the first Monday as the first day of the first week. |
%w | The day of the week as a decimal, Sunday being 0. |
%x | The preferred date representation for the current locale without the time. |
%X | The preferred time representation for the current locale without the date. |
%y | The year as a decimal number without a century (range 00 to 99). |
%Y | The year as a decimal number including the century. |
%Z | The time zone or name or abbreviation. |
%% | A literal `%' character. |
Read-only variables |
Variable | Description |
---|---|
@WPP_VERSION@ |
The program version. |
@INCLUDE@ |
Contains the name of the last included template. |
@FILENAME@ |
The bare name without extensions (.raw or .html) and path. |
@TEMPLATE@ |
If evaluated into a template is the template name, otherwise is an empty string. |
@DATE@ |
Is the modify time of the raw source file. |
@RCS_DATE@ |
RCS $Date$ tag value (if you use RCS, otherwise is the last modify time or, if the source is STDIN, the current date). |
@AT@ |
The '@' char. |
@EXTENSION@ |
Contains the extension of the output file (default is 'html'). It can be changed into a config file through the @DEFAULT_EXTENSION@ variable. |
@RAW_EXTENSION@ |
Contains the extension of the input file (default is 'raw'). It can be changed into a config file through the @DEFAULT_RAW_EXTENSION@ variable. |
@TMPL_EXTENSION@ |
Contains the extension of the template files (default is 'tmpl'). It can be changed into a config file through the @DEFAULT_TMPL_EXTENSION@ variable. |
@OUTPUTDIR@ |
Contains the output directory. It can be changed into a config file through the @DEFAULT_OUTPUTDIR@ variable. |
@OUTPUTSUBDIR@ |
Contains the output subdirectory path. By running wpp on '@OUTPUTSUBDIR@/ex.raw' the output file will be placed into '@OUTPUTDIR@/@OUTPUTSUBDIR@/ex.html'. |
@RAWDIR@ |
Contains the directory of the raw sources. |
@TMPLPATH@ |
Contains the templates directory path. It can be changed into a config file through the @DEFAULT_TMPLPATH@ variable. |
@TMPLDIR@ |
See @TMPLPATH@. Obsolete, use @TMPLPATH@. |
^ Top | < Previous Next > | |
Marco (LM) Lamberto lm@sunnyspot.org
Revised: 2003/03/10 07:38:04 http://wpp.sf.net/manual_4.html |