XEPHOS ######################################################################### ## ## / .--. | LOOKsystems Limited ## / / / | Admiralty House ## '-- '--' | 2 Bank Place ## .--. / , | Falmouth ## / / /\' | Cornwall ## '--' / \ | TR11 4AT ## ## Project : Xephos Journey Planner ## Module : Sample Timetable Layout Script ## Created : 19th November 2001 ## File : layout-script ## ## Author : Adrian Philip Look ## State : Development ## Version : 0.00 ## ## Subject to copyright ## ######################################################################### CLASS STANDARD ######################################################################### ## ## TIMETABLE LOCALE ## ## Locales currently supported are: ## ## UK English ## FR French ## DEFINE LOCALE UK ######################################################################### ## ## DOCUMENT HTML DEFINITIONS ## ## * DOCUMENT TYPE document definition ## (tag will not be output if this is not defined) ## ## * DOCUMENT TITLE document definition ## * DOCUMENT HEAD STYLE document tag parameters ## * DOCUMENT HEAD document definition ## ## * DOCUMENT BODY STYLE document tag parameters ## DEFINE DOCUMENT TYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" DEFINE DOCUMENT TITLE Sample Xephos GBBTT Style Timetable DEFINE DOCUMENT HEAD STYLE SCRIPT DOCUMENT HEAD DEFINE DOCUMENT BODY STYLE BGCOLOR=#FFFFFF ######################################################################### ## ## TIMETABLE HTML SCRIPTS ## ## * SCRIPTS ## ## The TABLE, SECTION and BLOCK scripts below are the primary means ## by which the HTML output of each timetable can tailored. ## ## Each script contains a mixture of pure HTML and various commands. ## Together these determine how the 'timetable', each 'section' and ## each 'timeblock' are output. ## ## * COMMANDS ## ## Commands are delineated by the @ symbol. These commands will then ## be expanded into context sensitive information. ## ## A list of currently supported commands is given below: ## ## @@ outputs a single @ symbol ## ## @BLOCK@ see 'block body' ## @BLOCK HEAD@ not used, reserved for future expansion ## @BLOCK BODY@ output timeblock data ## @BLOCK TAIL@ not used, reserved for future expansion ## @BLOCK HEADING@ output timeblock heading ## @BLOCK VALIDITY@ output timeblock validity ## @BLOCK COLUMNS@ output number of timeblock columns (including namebank) ## @BLOCK WIDTH@ output timeblock pixel width (returns '100%' if not known) ## ## @DOCUMENT WIDTH@ output document pixel width (returns '100%' if not known) ## ## @MODE@ output primary timetable transport mode ## @MODE 1@ output first timetable transport mode ## @MODE 2@ output second timetable transport mode ## ..etc ## ## @OPERATOR CODE@ output default operator code ## @OPERATOR CODE 1@ output first operator code ## @OPERATOR CODE 2@ output second operator code ## ..etc ## ## @OPERATOR NAME@ output default operator name ## @OPERATOR NAME 1@ output first operator name ## @OPERATOR NAME 2@ output second operator name ## ..etc ## ## @ROUTE STRIP@ output textual route strip (if appropriate) ## ## @SECTION@ see 'section body' ## @SECTION HEAD@ not used, reserved for future expansion ## @SECTION BODY@ output section data ## @SECTION TAIL@ not used, reserved for future expansion ## @SECTION TITLE@ output section title ## @SECTION DESCRIPTION@ output section description ## @SECTION VALIDITY@ output section validity ## ## @TABLE@ see 'table body' ## @TABLE HEAD@ not used, reserved for future expansion ## @TABLE BODY@ output timetable data ## @TABLE TAIL@ not used, reserved for future expansion ## @TABLE CODE@ output timetable code ## @TABLE TITLE@ output timetable time ## @TABLE DESCRIPTION@ output timetable description ## @TABLE MODE@ output timetable primary transport mode ## @TABLE PHONE@ output timetable enquiry phone number ## @TABLE OPERATOR@ output timetable primary operator name ## @TABLE NOTES@ output timetable notes ## @TABLE VALIDITY@ output timetable validity ## @TABLE COLUMNS@ output timetable columns (ie. widest timeblock) ## @TABLE WIDTH@ output timetable pixel width (ie. widest timeblock) ## ## @VARIABLE foo@ output variable 'foo' defined in this script ## @$foo@ output variable 'foo' defined in this script ## ## @!foo@ output dictionary 'foo' (see example below) ## SCRIPT TABLE
 @TABLE CODE@   @TABLE DESCRIPTION@
@TABLE TITLE@ 
@ROUTE STRIP@

@TABLE BODY@

 @TABLE VALIDITY@ 
 @TABLE PHONE@ 
@TABLE NOTES@

This web page was automatically generated by Xephos Internet, © LOOKsystems Limited 2001.
SCRIPT SECTION @SECTION BODY@ SCRIPT BLOCK @BLOCK BODY@ ######################################################################### ## ## TIMETABLE LAYOUT ## ## * TABLE TAGS TRUE timetable
tags will be output ## FALSE timetable
tags will not be output ## ## * TABLE STYLE specifies additional tag parameters ## ## * TABLE CELLSPACING specifies timetable cell spacing ## * TABLE CELLPADDING specifies timetable cell padding ## * TABLE BORDER specifies timetable border ## ## * TABLE SIZE TRUE timetable
WIDTH tag parameter will be output ## FALSE timetable
WIDTH tag parameter will not be output ## ## * NAMEBANK WIDTH specifies namebank pixel width ## ## * COLUMN WIDTH specifies default column width ## ## * EVERY COLUMN WIDTH specifies every column width (uses default if not specified) ## * PATTERN COLUMN WIDTH specifies pattern column width (uses default if not specified) ## * TIME COLUMN WIDTH specifies time column width (uses default if not specified) ## ## * COLUMN WRAPPING TRUE enables column wrapping using parameters below ## DOCUMENT enables column wrapping using document width ## FALSE disables column wrapping ## ## * MAXIMUM COLUMNS specifies the maximum number of timeblock columns ## * ORPHAN COLUMNS specifies the minimum number of columns for non-orphaned timeblocks ## * WIDOW COLUMNS specifies the maximum number of columns donated by widowed timeblocks ## * MINIMUM COLUMNS specifies the minimum number of columns (dispite document width) ## ## * MAXIMUM WIDTH specifies the maximum timeblock pixel width ## * MINIMUM WIDTH specifies the mimimum timeblock pixel width ## ## * COLUMN WRAP SPACER specifies how timeblock portions are separted (default:
) ## ## * BLOCK DIVIDER specifies how timeblocks are separated (default:
) ## ## * SECTION DIVIDER specifies how sections are separated (default:
) ## DEFINE TABLE TAGS TRUE DEFINE TABLE STYLE CLASS="standard" DEFINE TABLE CELLSPACING 0 DEFINE TABLE CELLPADDING 0 DEFINE TABLE BORDER 0 DEFINE TABLE SIZE TRUE DEFINE NAMEBANK WIDTH 300 DEFINE COLUMN WIDTH 50 DEFINE COLUMN WRAPPING TRUE DEFINE MAXIMUM COLUMNS 15 DEFINE ORPHAN COLUMNS 3 DEFINE WIDOW COLUMNS 1 DEFINE MINIMUM WIDTH 1050 DEFINE COLUMN WRAP SPACER
DEFINE BLOCK DIVIDER
DEFINE SECTION DIVIDER
######################################################################### ## ## TIMETABLE ROW STYLES ## ## * TOP ROW STYLE specifies the top row tag parameters ## ## * ROW STYLES specifies subsequent row tag parameters ## ## note: a pattern of several rows can be ## specified which will be replicated down ## all of the timetable rows ## DEFINE TOP ROW STYLE ALIGN=CENTER VALIGN=BOTTOM CLASS="jnote" SCRIPT ROW STYLES ALIGN=CENTER ######################################################################### ## ## TIMETABLE BLOCK LEGEND ## ## * BLOCK LEGEND STYLE specifies the block legend
tag parameters ## ## * INITIAL BLOCK LEGEND STYLE specifies initial tag parameters (see above) ## * SUBSEQUENT BLOCK LEGEND STYLE specifies subsequent tag parameters (see above) ## ## * BLOCK LEGEND FORMAT specifies how the block legend will be output. ## the following macros can be used: ## ## %h block heading ## ## uppercase equivalents substitute normal spaces ## with non-breaking-spaces ie. &nsbp; ## ## * INITIAL BLOCK LEGEND FORMAT specifies initial block legend output (see above) ## * SUBSEQUENT BLOCK LEGEND FORMAT specifies subsequent block legend output (see above) ## DEFINE BLOCK LEGEND STYLE CLASS="legend" ALIGN=LEFT DEFINE BLOCK LEGEND FORMAT @!BLOCK HEADING@ ######################################################################### ## ## TIMETABLE STOPS ## ## * INTERMEDIATE POINTS TRUE output all stops ## FALSE output timing points only ## ## * PASSING POINTS TRUE output all stops ## FALSE only output stops with times ## ## * STOP STYLE specifies stop tag parameters ## ## * TIMEPOINT STOP STYLE specifies timepoint stop tag parameters ## ## * INTERMEDIATE STOP STYLE specifies intermediate stop tag parameters ## ## * STOP FORMAT specifies how stop names will be output. ## the following macros can be used: ## ## %a stop alias ## ## uppercase equivalents substitute normal spaces ## with non-breaking-spaces ie. &nsbp; ## ## * TIMEPOINT STOP FORMAT as per stop format (but for timepoint stops only) ## ## * INTERMEDIATE STOP FORMAT as per stop format (but for intermediate stops only) ## DEFINE INTERMEDIATE POINTS FALSE DEFINE PASSING POINTS FALSE DEFINE TIMEPOINT STOP FORMAT %a DEFINE INTERMEDIATE STOP FORMAT %a ######################################################################### ## ## TIMETABLE SEQUENCES ## ## * EXPAND SEQUENCES TRUE output journeys only ## FALSE output journeys & sequences ## ## * EVERY COLUMN FORMAT specifies how a every sequence column will be output. ## the following macros can be used: ## ## %i time interval (long form) ## %s standard 'locale' output (long form) ## %u time units (long form) ## ## %I time interval (short form) ## %S standard 'locale' output (short form) ## %U time units (short form) ## ## * PATTERN COLUMN FORMAT specifies how a pattern sequence column will be output. ## the following macros can be used: ## ## %s standard 'locale' output ## ## * EVERY COLUMN STYLE specifies every column tag parameters ## ## * PATTERN COLUMN STYLE specifies pattern column tag parameters ## ## * SEQUENCE COLUMN STYLE specifies every & pattern column tag parameters ## ## * EXPAND EVERY STYLE TRUE apply every style to corresponding 'master' columns ## FALSE do not apply every style to corresponding 'master' columns ## ## * EXPAND PATTERN STYLE TRUE apply pattern style to corresponding 'master' columns ## FALSE do not pattern every style to corresponding 'master' columns ## ## * EXPAND SEQUENCE STYLE TRUE apply every & patterns styles to corresponding 'master' columns ## FALSE do not every & pattern every styles to corresponding 'master' columns ## ## * EVERY COLUMN SPACER specifies intra-word spacing for every column text ## ## * PATTERN COLUMN SPACER specifies intra-word spacing for pattern column text ## ## * SEQUENCE COLUMN SPACER specifies intra-word spacing for every & pattern column texts ## ## * PATTERN SYMBOL specifies how the pattern symbol will be output ## (note: this can be used to output text or graphics) ## DEFINE EXPAND SEQUENCES FALSE DEFINE SEQUENCE COLUMN STYLE BGCOLOR=@!ROUTE COLOUR@ DEFINE EXPAND SEQUENCE STYLE TRUE DEFINE EVERY COLUMN FORMAT %S DEFINE EVERY COLUMN SPACER
DEFINE PATTERN COLUMN FORMAT then
these
times DEFINE PATTERN SYMBOL ¶ ######################################################################### ## ## TIMETABLE TIMES ## ## * TIME STYLE specifies time
tag parameters ## ## * TIMEPOINT TIME STYLE specifies timepoint time tag parameters ## ## * INTERMEDIATE TIME STYLE specifies intermediate time tag parameters ## ## * TIME FORMAT specifies how journeys time will be output. ## the following macros can be used: ## ## %h 24 hour clock hour ## %t 24 hour clock time (with separator & notes) ## %m minutes ## %n notes ## %s note spaces ## ## %H 12 hour clock hour ## %T 12 hour clock time (with separator & notes) ## %M minutes ## %N notes ## %S note spaces ## ## * TIMEPOINT TIME FORMAT as per time format (but for timepoints time only) ## ## * INTERMEDIATE TIME FORMAT as per time format (but for intermediate times only) ## ## * TIME SEPARATOR specifies hours and minutes separator ## (note: NONE = no separator) ## ## * NULL TIME specifies how null times are output ## (note: this can be used to output text or graphics) ## ## * LEADING NULL TIME specifies how leading null times are output ## (note: this can be used to output text or graphics) ## ## * INTERMEDIATE NULL TIME specifies how intermediate null times are output ## (note: this can be used to output text or graphics) ## ## * TRAILING NULL TIME specifies how trailing null times are output ## (note: this can be used to output text or graphics) ## DEFINE TIMEPOINT TIME FORMAT %t DEFINE INTERMEDIATE TIME FORMAT %t DEFINE TIME SEPARATOR NONE DEFINE NULL TIME ------ ######################################################################### ## ## TIMETABLE NOTES ## ## * COLUMN NOTE FORMAT specifies how a column note will be output. ## the following macros can be used: ## ## %c column text notes ## %d day mask ## %o operator code ## %p pattern symbol ## %s standard notes ='%p %d %c %v' ## %v validity notes ## ## uppercase equivalents output a ' ' to be output ## if an appropriate note is not defined ## ## * COLUMN NOTE SPACER specifies how column notes are separated ## (note: SPACE = normal space) ## ## * TRANSFORM NOTE CODES specifies how specific note codes will be output ## (note: this can be used to output text or graphics) ## ## * KEY NOTE FORMAT specifies how a key note will be output. ## the following macros can be used: ## ## %c note code ## %n note explanation ## ## uppercase equivalents substitute normal spaces ## with non-breaking-spaces ie. &nsbp; ## ## * CLIP KEY NOTES TRUE output explanations for used notes ## FALSE output explanation for all notes ## ## * HIDE KEY NOTES specifies which note explanations will *not* be output ## DEFINE COLUMN NOTE FORMAT %s DEFINE COLUMN NOTE SPACER SPACE SCRIPT TRANSFORM NOTE CODES Sch § NSch N§ DEFINE KEY NOTE FORMAT %c - %n    DEFINE CLIP KEY NOTES TRUE SCRIPT HIDE KEY NOTES Sch NSch ######################################################################### ## ## DICTIONARIES ## ## This facility provides a simple, yet powerful, method of implementing ## 'context sensitive' html timetables. Dictionary lookups can transform ## the result of any script command into any html output. ## ## All dicitionary definitions must appear at the end of a script. ## ## Each definition is started by specifing the dictionaty name within ## square brackets: ## ## [ ] ## ## The script command to be transformed is defined thus: ## ## DEFINE @COMMAND@ ## ## Each dictionary entry is then defined: ## ## DEFINE ## DEFINE ## DEFINE ## ..etc ## ## A default output, which is used when a command result is not defined ## in the dictionary, can be defined thus: ## ## DEFINE @DEFAULT@ ## ## Where the default is required to output the 'command result', ## rather than some static html output, the following default ## definition should be used: ## ## DEFINE @DEFAULT@ @RESULT@ ## ## If a default is not specified, then command results not defined in ## the dictionary will generate no html output. ## ## Each dictionary definition is ended by starting a new dictionary ## or, in the case of the last dictionary, by using the [ END ] marker. ## ## See examples below for more details. ## [ MODE SYMBOL ] ## ## EXAMPLE 1 - MODE SYMBOL ## ## This dictionary is used to transform a @MODE@ command into an ## associated mode graphic. ## ## (Not used in this script.) ## DEFINE @COMMAND@ MODE DEFINE WALK DEFINE BUS DEFINE COACH DEFINE RAIL DEFINE FERRY DEFINE TRAM DEFINE AIR DEFINE LONDON UNDERGROUND [ ROUTE COLOUR ] ## ## EXAMPLE 2 - ROUTE COLOUR ## ## This dictionary is used to transform a @TABLE CODE@ command ## into an associated html colour. ## ## This is used in the script above to define the table banner ## and sequence block colours on a table-by-table basis. ## DEFINE @COMMAND@ TABLE CODE DEFINE @DEFAULT@ #FFFFBB DEFINE C152 #FFFFFF DEFINE CC17 #FFFFFF DEFINE CC03 #DDFFDD DEFINE CC20 #FFDDDD DEFINE DU12 #DDDDFF [ BLOCK HEADING ] ## ## EXAMPLE 3 - BLOCK HEADING ## ## This dictionary is used to transform the text from a @BLOCK HEADING@ ## command into a different format. ## ## This is used int the script above to modifiy the timeblock legend ## depending on the timeblock heading (day of the week). ## DEFINE @COMMAND@ BLOCK HEADING DEFINE @DEFAULT@ @CONTEXT@ DEFINE SATURDAY
Saturday
DEFINE SUNDAY
SUNDAY
[ END ]