Project | WXT | Basics | Download | Documentation | Samples

Script: module-element

A module is the targets of building. A module is normally constructed by filling extracts from content-files or fragments into a template. This simple model may be modified in many ways, mainly by means of transformations.

The script may contain any number of modules, and each module may contain any number of modules. The module-tree is defining the structure of the website.

<module name="" 
          id=""
          author=""
          description="" 
          location="" 
          template=""
          transformation=""
          books="">
    ...
</module>
name(mandatory) Any string that represents the Module in tables of contents etc. Available as fragment _name
description(optional) Any string that describes the module. Default is name. Available as fragment _description
id(optional) Any string that identifies the module. Default id is name. Avaliable as fragment: _id. The id is not mandatory, but it is strongly recommanded to give a module an id and to use a value that contains only ascii-letters and _. The id will be used to produce anchors and links and you may want to run WXT from the commandline with specific module ids.
The id must be unique in the context of a script.
author(optional) The id of an author fragment as defined in an author-element in the definitions part of the script. If no author is given it defaults to the default author. The default author may be set in the script as <author id="_defaultauthor" name="anyname"/>. If this is not set it defaults to: "Site author". The author is available as fragment _author within the module.
template(optional) Identification of a template. Either by location or by id (see: Template ).
transformation(optional) A transformation identifier (see: Transformation ). This transformation is applied before the module is saved. You may set parameters to the transformation, by enclosing a comma-separated list of name='value' definitions withinin (). Example for transformation with id T: T(name='ole',address='halden')
location(optional) An absolute URI identifying a filelocation, or an URI relative to the script. The module will be saved to this location. The location value may contain pathfragments.
anchor(deprecated, use pathfragment) An absolute or relative path to a catalog which will serve as anchor, referencecatalog, for this modules and child modules. All relative addresses are considered relative to this anchor. The anchor may contain pathfragments. If the anchor is relative, it is calculated relative to the parent modules anchor. If the module is a rootmodule it is calculated relative to the catalog that contains the script. You can achive the same effect by using pathfragments.
books(optional) A commaseparted string of books that this module is considered to be a part of. Books is a way of grouping modules. Default value is _all. The value _never will prevent the module from appearing in any lists, like modulemap and modulemenu.
output-format(optional) Possible values are xml, html, xhtml and text. This will override the default value ,html, and possible value set as option in the script. It will be effective only for this module.
runbefore(optional) Runs a named Command before this module is built.
runafter(optional) Runs a named Command after this module is built.

A module element may contain any number of the following elements:

and a module may contain one element of type Summary

Examples:

<module name="MyBook" 
          location="{mysections}/section3/myfile.hml"
          template="P"
          books="mylibrary"
          id="mybook"
          description="some temporary stuff" >
    ...
</module>