PAGE Objects in WebLord, the Document Assembly Tool
Logo WebLord v2.2
The Document Assembly Tool

The PAGE Object

A site consists of one or more pages, and every page produces output and has specific provisions for an external command to be executed when the page is complete, which can be used to upload the page to an Internet Service Provider (ISP), for example.

Overview

Pages can define content, one or more subpages, or both
A page defines content with the 'value' property. Subpages are defined with the 'subpages' property. A page that defines subpages but no content is nothing more than a synonym for the group of pages it defines.

Pages are written to a file with the 'output' property
All pages are written to a file specified by the 'output' property, unless they have not changed. Use the force argument to convince WebLord to always write the pages, no matter if they changed or not. The determination whether or not a page has changed is made based on information maintained in the Page Signature Database.

Properties

Property Name Inherited? Description

subpages never

One or both of SUBPAGES and VALUE must be specified for any page.

Functions the same way as the pages property for the SITE object: specify a list of subordinate pages that are grouped to be part of the current page.

If the page specifies only a SUBPAGES property, then the page functions merely as a synonym for one or more subordinate pages. Use this feature to create page groups, even hierarchical page groups!

Example: subpages = Amiga Amiga-News Amiga-Hardware Amiga-Software;


value explicit

One or both of VALUE and SUBPAGES must be specified for any page.

The VALUE property represents the contents of the page. The contents are then written to what the OUTPUT property resolves to.

For HTML pages, the html-page.wl file provides pre-defined header and footer elements that make it especially easy to build well-defined and properly composed HTML pages for the World Wide Web.

Example: value = header body footer;

The header and the footer portions in the example above could be those defined in the html-page.wl file; the body reference might be something defined uniquely by each page.

Note: If a page fails to define a VALUE property, but a parent page defines one that is tagged as inheritable, then the page will use that property; bewarned, however, that the use of inheritable properties can have unexpected side-effects, as VALUE is also used, albeit in a more restrictive sense, by TEXT objects.


output yes

The output property is required for each page, but is freely inherited so that it may be provided in a generic (and easy-to-maintain) manner by any object that is the parent of the current page, even the SITE object.

Example: output = "htdocs/" page.objectname ".html";


pre-exec explicit

This property is evaluated before a page is actually built, and the result is executed as an external command. This ensure that a remote resource is made available, that a previous version of the page is backed up, etc.

For this property to be inheritable from parent objects, it must be marked explicitly inheritable.

Note: the command is necessarily operating system dependent. If you need your definition to be functional across a range of operating systems (using appropriate distributions of WebLord for various platforms) you can use the _OS symbol to construct an object that returns a different command depending on the system on which the definition is being used.


post-exec explicit

This property is evaluated after a page has been built. The result of this property is then executed as an external command.

Use this property to perform post-processing on a completed page, such as HTML syntax checking, contextual formatting, or copying / uploading the page to your Internet Service Provider (ISP).

For this property to be inheritable from parent objects, it must be marked explicitly inheritable.

Note: the command is necessarily operating system dependent. If you need your definition to be functional across a range of operating systems (using appropriate distributions of WebLord for various platforms) you can use the _OS symbol to construct an object that returns a different command depending on the system on which the definition is being used.

See also: ignore-error, post-exec-batch, post-exec-run

ignore-error yes

Some external commands may produce return codes that are merely warnings and should not be considered execution/ processing errors. Any non-zero return code is usually registered as an error.

The 'ignore-error' property, if given, specifies a numeric value that is the maximum return code from an external program that should be ignored. An ignore-error='5'; would therefore ignore return codes 5 or less; only values of 6 and higher would continue to be counted as errors.

See also: post-exec

html-reformat yes

WebLord produces output exactly according to the output of the objects that you combine. It knows nothing about HTML itself, which contributes to WebLord's ability to build documents in any language.

It has been become useful on occasion, however, to "teach" WebLord something specific about HTML. The html-quote-if-required property is one such case.

'html-reformat' is another addition of this type. It performs two or three operations on your page:

  1. Word-wrapping: Text is wrapped somewhere near the 75th column. You may set a different value with the 'html-reformat-width' property. A width of "-1" will disable word-wrapping; the minimum is 20.
  2. Re-indentation: Your HTML is completely reformatted according to the context of various tags. This makes the code human readable, but will likely expand the size of your file, which is a Bad Thing. The indentation level can be controlled with the 'html-reformat-tabsize' property. A value of "0" uses smart indentation (adjusts on an element-by-element basis) for maximum readability; a value from "1" through "8" will use a fixed-width indentation. Values of "1" or "8" are the best compromises where expanded filesize (and wasted bandwidth) are concerned). It is not possible (at this time) to disable context indentation.
  3. Case-conversion: The HTML element names (and the tag names) can be converted to upper or lower case with the 'html-reformat-tagcase' property. A value of "1" or "upper" will convert to upper case. A value of "-1" or "lower" will convert to lower case. A value of "0" will perform no change (the default.) Please note that upper-case characters are less frequent in text than lower-case; lower-case element/tag names produce better compression ratios, both in archives on disk and in transit over high-speed modems. Although a gain from compression might be minimal with small pages, it could be noticable with larger pages or when considering the site as a whole.
  4. HTML 3.2 vs. HTML 4.0 attribute-quoting policy: Prior to HTML 3.2 quoting the values of attributes was only necessary if certain special symbols were embedded in the value. Beginning with HTML 4.0, the quoting of all values has become strongly recommended. Setting 'html-reformat-quotepolicy' to a value of "strict" will ensure that all your values are properly quoted. It should be noted that the addition of quotes will increase the size of your pages, which can increase the time your pages may require in transit.

As the indentation of HTML adds tabs and spaces to the output, your files will grow in size, which is something to be avidly avoided, of course. Please consider the function of your pages to be more important than pretty HTML which many people may not much care about anyway. Use the 'html-reformat' function as a diagnostic tool, not a snazzy pretty-formatter.



This material is Copyright © 1997,1998,1999,2000,2001 RingLord Technologies and Udo Schuermann. All rights reserved. The latest versions of the WebLord software and (this) documentation can be obtained from the WebLord Home Page (the link will only function if you are connected to the internet.)