1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629
|
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>[ WPP - The Web Preprocessor ] Variables and constants</title>
<link rel="icon" href="images/icon.png" type="" />
<link rel="stylesheet" type="text/css" href="css/wpp.css" />
<meta name="author" content="Marco (LM) Lamberto - lm@sunnyspot.org" />
<meta name="description" content="WPP is a small perl script that allows preprocessing of html files. It's useful for giving an uniform layout to different html pages. It can be used into cgi scripts for dynamic generation of pages." />
<meta name="keywords" content="html, preprocessor, preprocessing, web, perl, script, cgi, the sunny spot" />
<meta name="generator" content="By Hand v1.0 with VIM for Linux + WPP ;)" />
</head>
<body>
<!-- head:start -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="banner">
<td>
<a href="http://the.sunnyspot.org/"><img src="images/tss_logo.gif" width="90" height="32" alt="[ The Sunny Spot ]" /></a>
</td>
<td width="90%">
<b>WPP 2.13.1.33 - The Web Preprocessor</b>
<br/>
Author: <a href="mailto:lm@sunnyspot.org">Marco Lamberto</a>
</td>
<td align='right'>
<a href="http://the.sunnyspot.org/wpp/"><img src="images/pp_by_wpp.gif" width="90" height="32" alt="Preprocessed by WPP" /></a>
</td>
</tr>
<!-- toolbar:start -->
<tr class="toolbar">
<td>
<a href="index.html">Index</a>
</td>
<td colspan="2" align="right">
<a href="manual_3.html">< Previous</a>
<a href="manual_5.html">Next ></a>
</td>
</tr>
<!--toolbar:end -->
</table>
<!-- head:end -->
<!-- contents: start -->
<div class="contents">
<!-- parag:start 'Variables assignment' -->
<div class="parag">
<!-- section: Variables assignment -->
<table class="sectionheader">
<tr valign="middle">
<td>
<a name="VARASSIGN"></a>Variables assignment
</td>
<td align="right">
<a href="#"><img src="images/up.gif" width="14" height="14" alt="[ ^ ]" /></a>
</td>
</tr>
</table>
<!-- subparag:start '' -->
<div class="subparag">
<pre class="syntax">
@NAME=val@
</pre>
Valid names can contain uppercase letters, numbers and the '_' underscore char.
<br/>
The value can contain other variables and macro calls delimitated by the '@'
char.
<br/>
<div class="indented">
<!-- BOX Open -->
<div class='box'>
<img src="images/wm_menu.gif" width="14" height="14" alt="" /> Source file
<div class="boxcontents">
<!-- -->
<pre>
<span class="comment"><!-- assigns to 'FOO_0' the value 'Title' --></span>
@FOO_0=<span class="param">Title</span>@
<span class="comment"><!-- deletes 'FOO_1' if defined --></span>
@FOO_1=@
<span class="comment"><!-- sets 'FOO_0' the value of 'FOO_1' --></span>
@FOO_0=<span class="param">@FOO_1@</span>@
</pre>
<!-- -->
</div>
</div>
<!-- BOX Close -->
</div>
</div>
<!-- subparag:end -->
</div>
<!-- parag:end -->
<!-- parag:start 'Variables substitution' -->
<div class="parag">
<!-- section: Variables substitution -->
<table class="sectionheader">
<tr valign="middle">
<td>
<a name="VARSUBST"></a>Variables substitution
</td>
<td align="right">
<a href="#"><img src="images/up.gif" width="14" height="14" alt="[ ^ ]" /></a>
</td>
</tr>
</table>
<!-- subparag:start '' -->
<div class="subparag">
<pre class="syntax">
@NAME@
</pre>
Simply put the variable name between two '@'.
<div class="indented">
<!-- BOX Open -->
<div class='box'>
<img src="images/wm_menu.gif" width="14" height="14" alt="" /> Source file
<div class="boxcontents">
<!-- -->
<pre>
@FOO1=<span class="param">A</span>@
@FOO2=<span class="param">B</span>@
<span class="comment">Choose '</span>@FOO1@
<span class="comment">' or '</span>@FOO2@<span class="comment">'?</span>
</pre>
<!-- -->
</div>
</div>
<!-- BOX Close -->
</div>
<div class="indented">
<!-- BOX Open -->
<div class='box'>
<img src="images/wm_menu.gif" width="14" height="14" alt="" /> Output file
<div class="boxcontents">
<!-- -->
<pre>
Choose 'A' or 'B'?
</pre>
<!-- -->
</div>
</div>
<!-- BOX Close -->
</div>
</div>
<!-- subparag:end -->
</div>
<!-- parag:end -->
<!-- parag:start 'Environment variables' -->
<div class="parag">
<!-- section: Environment variables -->
<table class="sectionheader">
<tr valign="middle">
<td>
<a name="ENVVARS"></a>Environment variables
</td>
<td align="right">
<a href="#"><img src="images/up.gif" width="14" height="14" alt="[ ^ ]" /></a>
</td>
</tr>
</table>
<!-- subparag:start 'Program Environment' -->
<a name="Program_Environment"></a><span class="black">Program Environment</span>
<div class="subparag">
<pre class="syntax">
@ENV_*@
</pre>
Every variable of the system environment is available by prepending the
'ENV_' prefix (i.e.: PATH will be available as @ENV_PATH@).
</div>
<!-- subparag:end -->
<!-- subparag:start 'CGI-bin QUERY_STRING' -->
<a name="CGI_bin_QUERY_STRING"></a><span class="black">CGI-bin QUERY_STRING</span>
<div class="subparag">
<pre class="syntax">
@QS_*@
</pre>
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.
<br/>
This should help a lot in writing CGI scripts handling data sent throught
HTML forms.
<div class="indented">
<!-- BOX Open -->
<div class='box'>
<img src="images/wm_menu.gif" width="14" height="14" alt="" /> QS_* Vars Example
<div class="boxcontents">
<!-- -->
<pre>
<span class="comment"><!-- Prints the original QUERY_STRING --></span>
@ENV_QUERY_STRING@
<span class="comment"><!-- For this example we suppose that QUERY_STRING is: --></span>
db=00_LINUX&string=window+maker&show_opts=X&lines=-1&nocase=1
<span class="comment"><!-- The QS_* vars: --></span>
@QS_DB@
@QS_STRING@
@QS_SHOW_OPTS@
@QS_LINES@
@QS_NOCASE@
</pre>
<!-- -->
</div>
</div>
<!-- BOX Close -->
</div>
<div class="indented">
<!-- BOX Open -->
<div class='box'>
<img src="images/wm_menu.gif" width="14" height="14" alt="" /> Output file
<div class="boxcontents">
<!-- -->
<pre>
<span class="comment"><!-- Prints the original QUERY_STRING --></span>
db=00_LINUX&string=window+maker&show_opts=X&lines=-1&nocase=1
<span class="comment"><!-- For this example we suppose that QUERY_STRING is: --></span>
db=00_LINUX&string=window+maker&show_opts=X&lines=-1&nocase=1
<span class="comment"><!-- The QS_* vars: --></span>
00_LINUX
window maker
X
-1
1
</pre>
<!-- -->
</div>
</div>
<!-- BOX Close -->
</div>
</div>
<!-- subparag:end -->
</div>
<!-- parag:end -->
<!-- parag:start 'Special variables' -->
<div class="parag">
<!-- section: Special variables -->
<table class="sectionheader">
<tr valign="middle">
<td>
<a name="SPVARS"></a>Special variables
</td>
<td align="right">
<a href="#"><img src="images/up.gif" width="14" height="14" alt="[ ^ ]" /></a>
</td>
</tr>
</table>
<!-- subparag:start 'Date Format' -->
<a name="DATE_FORMAT"></a><span class="black">Date Format</span>
<div class="subparag">
<pre class="syntax">
@DATE_FORMAT=format@
</pre>
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:
<div class="indented">
<table class="tablelist" id="indented">
<tr>
<th>Flag</th>
<th>Description</th>
</tr>
<tr>
<td>%a</td>
<td>The abbreviated weekday name according to the current locale.</td>
</tr>
<tr>
<td>%A</td>
<td>The full weekday name according to the current locale.</td>
</tr>
<tr>
<td>%b</td>
<td>The abbreviated month name according to the current locale.</td>
</tr>
<tr>
<td>%B</td>
<td>The full month name according to the current locale.</td>
</tr>
<tr>
<td>%c</td>
<td>The preferred date and time representation for the current locale.</td>
</tr>
<tr>
<td>%d</td>
<td>The day of the month as a decimal number (range 01 to 31).</td>
</tr>
<tr>
<td>%H</td>
<td>The hour as a decimal number using a 24-hour clock (range 00 to 23).</td>
</tr>
<tr>
<td>%I</td>
<td>The hour as a decimal number using a 12-hour clock (range 01 to 12).</td>
</tr>
<tr>
<td>%j</td>
<td>The day of the year as a decimal number (range 001 to 366).</td>
</tr>
<tr>
<td>%m</td>
<td>The month as a decimal number (range 01 to 12).</td>
</tr>
<tr>
<td>%M</td>
<td>The minute as a decimal number.</td>
</tr>
<tr>
<td>%p</td>
<td>Either `am' or `pm' according to the given time value, or the corresponding strings for the current locale.</td>
</tr>
<tr>
<td>%S</td>
<td>The second as a decimal number.</td>
</tr>
<tr>
<td>%U</td>
<td>The week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week.</td>
</tr>
<tr>
<td>%W</td>
<td>The week number of the current year as a decimal number, starting with the first Monday as the first day of the first week.</td>
</tr>
<tr>
<td>%w</td>
<td>The day of the week as a decimal, Sunday being 0.</td>
</tr>
<tr>
<td>%x</td>
<td>The preferred date representation for the current locale without the time.</td>
</tr>
<tr>
<td>%X</td>
<td>The preferred time representation for the current locale without the date.</td>
</tr>
<tr>
<td>%y</td>
<td>The year as a decimal number without a century (range 00 to 99).</td>
</tr>
<tr>
<td>%Y</td>
<td>The year as a decimal number including the century.</td>
</tr>
<tr>
<td>%Z</td>
<td>The time zone or name or abbreviation.</td>
</tr>
<tr>
<td>%%</td>
<td>A literal `%' character.</td>
</tr>
</table>
</div>
Example:
<div class="indented">
<!-- BOX Open -->
<div class='box'>
<img src="images/wm_menu.gif" width="14" height="14" alt="" /> Source file
<div class="boxcontents">
<!-- -->
@DATE@
<br/>
@DATE_FORMAT=Year: %Y - Month: %m@<br/>
@DATE@
<!-- -->
</div>
</div>
<!-- BOX Close -->
</div>
<div class="indented">
<!-- BOX Open -->
<div class='box'>
<img src="images/wm_menu.gif" width="14" height="14" alt="" /> Output file
<div class="boxcontents">
<!-- -->
2003/06/08 12:49:04
<br/>
<br/>
Year: 2003 - Month: 06
<!-- -->
</div>
</div>
<!-- BOX Close -->
</div>
</div>
<!-- subparag:end -->
</div>
<!-- parag:end -->
<!-- parag:start 'Read-only variables' -->
<div class="parag">
<!-- section: Read-only variables -->
<table class="sectionheader">
<tr valign="middle">
<td>
<a name="ROVARS"></a>Read-only variables
</td>
<td align="right">
<a href="#"><img src="images/up.gif" width="14" height="14" alt="[ ^ ]" /></a>
</td>
</tr>
</table>
<!-- subparag:start '' -->
<div class="subparag">
<div class="indented">
<table class="tablelist">
<tr>
<th>
Variable
</th>
<th>
Description
</th>
</tr>
<tr>
<td>
<pre>
@WPP_VERSION@
</pre>
</td>
<td>
The program version.
</td>
</tr>
<tr>
<td>
<pre>
@INCLUDE@
</pre>
</td>
<td>
Contains the name of the last included template.
</td>
</tr>
<tr>
<td>
<pre>
@FILENAME@
</pre>
</td>
<td>
The bare name without extensions (.raw or .html) and path.
</td>
</tr>
<tr>
<td>
<pre>
@TEMPLATE@
</pre>
</td>
<td>
If evaluated into a template is the template name, otherwise is an empty
string.
</td>
</tr>
<tr>
<td>
<pre>
@DATE@
</pre>
</td>
<td>
Is the modify time of the raw source file.
</td>
</tr>
<tr>
<td>
<pre>
@RCS_DATE@
</pre>
</td>
<td>
RCS <a href="manual_5.html#DATE">$Date$</a> tag value (if you use RCS,
otherwise is the last modify time or, if the source is STDIN, the current
date).
</td>
</tr>
<tr>
<td>
<pre>
@AT@
</pre>
</td>
<td>
The '@' char.
</td>
</tr>
<tr>
<td>
<pre>
@EXTENSION@
</pre>
</td>
<td>
Contains the extension of the output file (default is 'html'). It can be
changed into a config file through the @DEFAULT_EXTENSION@
variable.
</td>
</tr>
<tr>
<td>
<pre>
@RAW_EXTENSION@
</pre>
</td>
<td>
Contains the extension of the input file (default is 'raw'). It can be
changed into a config file through the @DEFAULT_RAW_EXTENSION@
variable.
</td>
</tr>
<tr>
<td>
<pre>
@TMPL_EXTENSION@
</pre>
</td>
<td>
Contains the extension of the template files (default is 'tmpl'). It can be
changed into a config file through the @DEFAULT_TMPL_EXTENSION@
variable.
</td>
</tr>
<tr>
<td>
<pre>
@OUTPUTDIR@
</pre>
</td>
<td>
Contains the output directory. It can be
changed into a config file through the @DEFAULT_OUTPUTDIR@
variable.
</td>
</tr>
<tr>
<td>
<pre>
@OUTPUTSUBDIR@
</pre>
</td>
<td>
Contains the output subdirectory path.<br/>
By running wpp on '@OUTPUTSUBDIR@/ex.raw' the output file will be
placed into '@OUTPUTDIR@/@OUTPUTSUBDIR@/ex.html'.
</td>
</tr>
<tr>
<td>
<pre>
@RAWDIR@
</pre>
</td>
<td>
Contains the directory of the raw sources.
</td>
</tr>
<tr>
<td>
<pre>
@TMPLPATH@
</pre>
</td>
<td>
Contains the templates directory path. It can be
changed into a config file through the @DEFAULT_TMPLPATH@
variable.
</td>
</tr>
<tr id="comment">
<td>
<pre>
@TMPLDIR@
</pre>
</td>
<td>
See @TMPLPATH@.<br/>
Obsolete, use @TMPLPATH@.
</td>
</tr>
</table>
</div>
</div>
<!-- subparag:end -->
</div>
<!-- parag:end -->
</div>
<!-- contents:end -->
<!-- tail:start -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- toolbar:start -->
<tr class="toolbar">
<td>
<a href="#">^ Top</a>
</td>
<td colspan="2" align="right">
<a href="manual_3.html">< Previous</a>
<a href="manual_5.html">Next ></a>
</td>
</tr>
<!--toolbar:end -->
<tr class="banner">
<td width="70%" id="small">
Marco (LM) Lamberto <a href="mailto:lm@sunnyspot.org?subject=WPP - The Web Preprocessor">lm@sunnyspot.org</a>
<br/>
Revised: 2003/03/10 07:38:04
<br/>
<a href="http://wpp.sf.net/manual_4.html">http://wpp.sf.net/manual_4.html</a>
</td>
<td align="right" width="30%">
<a href="http://the.sunnyspot.org/wpp/"><img src="images/pp_by_wpp.gif" width="90" height="32" alt="Preprocessed by WPP" /></a>
<img src="images/null.gif" width="5" height="32" alt="" />
<a href="http://www.gimp.org/"><img src="images/gfx_by_gimp.gif" width="90" height="36" alt="Graphics by GIMP" /></a>
</td>
</tr>
</table>
<!-- tail:end -->
</body>
</html>
|