Index < Previous     Next >
General notes [ ^ ]
WPP can handle directives, variables and macros without caring if they are together into a big line or separated.
Remember that a line ending with a single '\' will be joined with the following.
So if you want to split a long directive or a macro you could use the '\' char at the end of every chunk except for the last. However if you need the last '\' for other reasons you could escape it by doubling the '\' into '\\' that will be replaced with the single '\'.
You could also add an extra space after the '\', making it no more the last character of the line.
Source file
...
@A_VAR=I've made this on @DATE@@
@A_MACRO("text", "text @A_VAR@!", "@B_MACRO(\"arg1\", \
  \"arg2\")@ text")@
@INCLUDE @EXTRA_INCL_DIR@/test@
...
Macros can be called within other macros (pay attention to recursive calls!), variables assignments or macro aguments.

Variables are expanded almost everywhere, even into variables assignments or into the arguments of a called macro.

Paths are relative to the template or the output directories. You can't use absolute paths.

Organizing project directories [ ^ ]
Basic scheme (flat)
By default WPP generates output files into the upper level directory (referred as '..'), the basic directory scheme is something like that:
project +
|
+ raw
This scheme is quite simple and can be used succesfully for small sites, single pages, anything with flat structure (i.e. this documentation). A single 'config' file can be placed into the 'raw' directory and the output will be generated into 'project'.
Complex scheme (structured)
A more complex website should usually have a variable number of sections, often each section belongs to a different path. Using '..' for the generated pages could transform the project in a quite messy thing with raw directories mixed to the web pages.
You can use a 'raw' subdirectory for each section, but with large sites you may prefer separating raw sources from html, images and any other kind of files.
In my projects I usually use '../html' for the output path. A simple website structure may look something like that:
project +
|
+ html +
| |
| + images
| |
| + section1
| |
| + section2
|
+ raw +
|
+ section1
|
+ section2
As seen in the previous example a config file can be placed into the main 'raw' directory. For allowing better customization and flexibilty you can place other config files in each subdiectories, they will be merged with the main one only when parsing sources belonging from those directories.

When using this structure I highly suggest to use the macros defined into the standard WPP macros library. I've developed them in order to relativize and check links for images, other html files, ...
At least I suggest you to surround each link (external or not) with the @RURL()@ macro.

Advanced notes [ ^ ]
Using GNU Make
I suggest you to read this article: WPP + make, written by Adam Byrtek.
Adam explains how to write Makefiles to deal with the building process of WPP-based web sites.
^ Top < Previous     Next >