Generated: July 25, 2005, 15:34:25 Copyright © 2005 , Kurt Nørmark The local LAML software home page

Reference Manual of the LAML Calendar Tool - XHTML

Kurt Nørmark © normark@cs.auc.dk Department of Computer Science Aalborg University Denmark

Source file: tools/calendar/xml-in-laml/calendar.scm/

This is a tool for generation of calendars, which can be shown in an Internet Browser. The stuff in this file relies on the XHTML 1.0 transitional mirror together with the XHTML convenience library. Thus, in order to use this calendar tool, you should load libraries in the following way:
  (laml-style "simple-xhtml1.0-transitional-validating") 
  (lib-load "xhtml1.0-convenience.scm") 
(load (string-append laml-dir "tools/calendar/xml-in-laml/calendar.scm"))

It is also possible to use this calendar tool with the HTML4.01 validating mirror. In this case you should load:

  (laml-style "simple-html4.01-transitional-validating")   
(load (string-append laml-dir "tools/calendar/xml-in-laml/calendar.scm"))
The main function of the tool is calendar. Besides this function, it is important to understand the input format of appointments in the calendar. Also, there are a number of constants, which affect the appearance of the calendar.

This tools requires input (appointments). The tool assumes that the calendar input is the Scheme variabel calendar-events. In other words, you must define this variable. Below, we explain the calendar events format

Besides the general LAML stuff (laml.scm) and the XHTML mirror libraries (mentioned above) this tools requires the libraries color.scm, time.scm and file-read.scm (all from lib). The required libraries are not loaded by the tool itself. Notice however, that the loading example given above also includes loading of color, time and file-read (by means of simple-xhtml1.0-transitional-validating).

The font size of the calendar entries are controlled by CSS. You can either link to a CSS file, or embed a CSS clause in the head of your HTML element. The following CSS clauses is an example:

  (style 'type "text/css" "TABLE.calendar-table TD { font-size: 7pt; }")

Table of Contents:
1. About the format of calendar input. 3. Calendar parameters.
2. Event selection functions. 4. The main calendar function.

Alphabetic index:
calendar (calendar year from-month number-of-months . show-today) Return a HTML calendar for year, from-months, and running through number-of-months.
calendar-background-color calendar-background-color The background color of the calendar.
event-brief-text (event-brief-text e) Return the brief textual description of a calendar appointment.
event-color (event-color e) Return the color of a calendar appointment.
event-end-time (event-end-time e) Return the end time of a calendar appointment.
event-long-text (event-long-text e) Return the long textual description of a calendar appointment.
event-start-time (event-start-time e) Return the start time of a calendar appointment.
event-url (event-url e) Return the url of a calendar appointment.
month-width month-width The width of a month.
week-calendar (week-calendar t0) Make a week calendar for the week that contains the time t0 (a second count).
week-separator-of-calendar week-separator-of-calendar Week separators: Whether thin og thick (symbols).


1 About the format of calendar input.
The calendar input must be present in a variable named calendar-events. calendar-events must be defined externally to the calendar tool. Calendar-events is a list of appointments. A single appointment is, in turn, a list. Thus calendar-events is a list of lists.

The detailed format of an appointment is the following:

   (start-time end-time brief-description long-description color url) 
Start-time and end-time are integers (a number of seconds since january 1, 1970). The function time-encoding from the time library is useful for construction of these numbers.

Brief-description is a string, the contents of which goes into the calendar. Long-description is a longer description of the event. Currently, this information is not used.

Color is a RGB color list (a list of three integers). You can use the color constans of the html Scheme library, if you want to.

Finally, url is the url, to which we link from the calendar entry. If it is the empty string, no link will be made.



2 Event selection functions.
The event selector functions define accessors into a calendar appointment.

event-start-time
Form (event-start-time e)
Description Return the start time of a calendar appointment.

event-end-time
Form (event-end-time e)
Description Return the end time of a calendar appointment.

event-brief-text
Form (event-brief-text e)
Description Return the brief textual description of a calendar appointment.

event-long-text
Form (event-long-text e)
Description Return the long textual description of a calendar appointment.

event-color
Form (event-color e)
Description Return the color of a calendar appointment.

event-url
Form (event-url e)
Description Return the url of a calendar appointment.


3 Calendar parameters.
In this section we find a number of variables which control the calendar appearance.

week-separator-of-calendar
Form week-separator-of-calendar
Description Week separators: Whether thin og thick (symbols).

month-width
Form month-width
Description The width of a month. Default value is 150.

calendar-background-color
Form calendar-background-color
Description The background color of the calendar. A color can be constructed by use of the function make-color from the LAML color library. The default background color is white.


4 The main calendar function.
In this section we find the most important function at all, the calendar function which generates a calendar.

calendar
Form (calendar year from-month number-of-months . show-today)
Description Return a HTML calendar for year, from-months, and running through number-of-months. This is the absolute main function of the tool. As an example, (calendar 1999 2 3) will produce a calendar of February, March, and April in 1999. If the optional parameter show-today is #t, the current date is shown in red.
Precondition The variable calendar-events must be defined prior to the call of this function
See also calendar events SECTION1

week-calendar
Form (week-calendar t0)
Description Make a week calendar for the week that contains the time t0 (a second count).

Generated: July 25, 2005, 15:34:25
Generated by LAML SchemeDoc using LAML Version 28.0 (July 25, 2005, full)