by nthWave Web Works Elements Docs

Introduction
Overview
Installation
Initiating the Process
Small Site Tutorial
    Elements In Depth
  •ElementsSettings
    Generated Elements
    The Processing Steps
    Using Scripts
    Tips & Annoyances
    Special Elements
    Internal Tools
    displayInfo() Script
Script Examples...
Platform Specific...
Glossary
History
Support

Downloads



Support the
good work:

support email

Elements In Depth : The ElementsSettings file.

The ElementsSettings.txt file is the source of crucial information for Elements to process any site. Editing ElementsSettings values changes those values for all sites. The ElementsSettings.txt file must be located in the same place as the Elements.py module.

All elements in the ElementsSettings file are defined using the "#" character as the elementMarker even if the elementMarker is set to some other character.

Like all elements, the elements defined in ElementsSettings are heirarchy-sensitive. This means that any ElementsSettings value can be redefined in any site or in any sub-directory or page of a site without affecting other pages, directories and sites.

codeBlockMarker | contentExtensions | copyAssets | debugOn | displayPage | firstElement | elementFilePrefix | elementMarker | lineSep | markerStart | markerEnd

Required Elements

codeBlockMarker

Default: .
A multiLineElement (see Glossary) whose name begins with the codeBlockMarker will be treated as Python code. Code in a codeBlock which is illegal in Python will generate an error and not be available to pages. The codeBlockMarker itself can be any single character, but it must be the first part of the element name, immediately after the opening elementMarker.

Example:
#.oneCodeBlock#
def helloWorld:
    return "Hello World"
#


contentExtensions

Default: .html,.htm,.css,.php,.php3,.asp,.jhtml,.inc
A comma delimited list of extensions. Files in the siteSrc (see Glossary) whose extensions are in the list will be processed as content. When accessed in a script, contentExtensions is a Python ListType.

copyAssets

Default: true
If true, any existing siteDest (see Glossary) will be deleted and all asset files (see Glossary) will be copied to the corresponding directory in the siteDest.

If false, any existing siteDest is not deleted and files in the siteSrc (see Glossary) which are not content and not elementFiles will not be copied to the siteDest. Of course if the assets were copied to the siteDest previously, they will still be there. Setting copyAssets to false speeds processing by eliminating the relatively slow process of copying sometimes large assets files.

debugOn

Default: true
If true, messages will be displayed for codeBlock compilation errors, script errors and missing elements.

displayPage

Default: index.html,index.htm,default.html,index.php,index.asp,index.jhtml
A comma delimited list of file names to look for in the siteDest (see Glossary) when processing is finished. The first list item matching an existing file name in the siteDest will be used as the target in an attempt to open a browser window using the Python webbrowser.open(url) command. Internally displayPage is converted to a list. Therefore, when accessed in a script, displayPage is a Python ListType. See The Processing Steps page for more info.

firstElement

Default: {template}
The firstElement is the beginning of the replacement process for the content page. It can be thought of as the template for the page. The firstElement might be the content page itself, a mulitiLineElement, a single line referencing another element, or a script. If the firstElement is the content page, then no template is applied. If it is some other element or script, then that element/script result will usually have some way to pull the content into the replacement process. The simple way to do this is to include {{fileName}} in the firstElement string.

Samples of possible #firstElement values:

#firstElement {{fileName}}
or
#firstElement {topElement}
or
#firstElement {templateScript()}
or
#firstElement#
<html>
<body>
{{fileName}}
</body>
</html>
#
or
#firstElement#
.body,blockquote,ul,td{
font-family: Trebuchet,Verdana,Helvetica,Sans;
font-weight: 400;
font-size: 11px;}
p{
font-family : Trebuchet,Verdana,Helvetica,Sans;
font-size : 11px;
margin-top: 10px;
margin-bottom: 0px;
font-weight : 400;}
#



elementFilePrefix

Default: `
The backtick character, to the left of the numeral 1 on the QWERTY keyboard. The elementFilePrefix is the character that identifies elementFiles. elementFile names must begin with the elementFilePrefix and should not end with an extension which is in the contentExtensions list. The elements of an elementFile apply to all content files in the same directory as the element file and all the children of the directory.

elementMarker

Default: #
Signals an element. Single line elements are in the form: elementMarker, element name, space, element value. All elements must be at the top of the file, before any content. The first non-element line in any file, content or elementFile (see Glossary), signals the end of element gathering. The remainder of the file is treated as a single element whose name is the fileName. The elementFilePrefix and extension are not part of the fileName.

lineSep

Default: unix
Set the line breaks for the content files. Available options are 'unix', 'win', or 'mac'. Choose the platform which will be serving the html or set it to the platform you're using.

markerStart

Default: {
The opening character of all element replacements and script calls.

markerEnd

Default: }
The closing character of all element replacements and script calls.

Custom Elements
The ElementsSettings file can contain any number of additional elements. Anything here will be available to all sites and, yet, can be overridden by any subsequent declaration.

The displayInfo() script and several common html entities are optional elements defined in the ElementsSettings file.



top
























Elements is brought to you by nthWave Web Works
this page was built on Fri May 2 15:31:29 2003