Generated: December 4, 2003, 23:30:54Copyright ©2003, Kurt NÝrmarkThe local LAML software home page

Reference Manual of the HTML4.0 Convenience Library

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

Source file: lib4/html4.0-loose/convenience.scm
LAML Version 22.00 (December 4, 2003, alpha-4)

This library contains a number of convenient functions on top of the basic and the surface library. Some of these are only of historical interest, but important for some of the existing LAML software packages. But most functions are useful and/or powerful. This library corresponds to ../html.scm and a few manually programmed functions in ../html-v1.scm. Recall that ../html.scm is the original hand crafted ad hoc library of the LAML software package, which is obsolete due to this library together with the basis and surface libraries. Some functions in the ../html.scm correspond to HTML tags, and as such they are defined in surface.scm in this directory. Other functions in ../html.scm have the same name as an html tag wihtout really mirroring the tag. Such tags have been renamed in this library. See the section below for a description of these renamings.

Besides the general library, this library requires the html4.0 loose basis library. Notice however, that it does NOT require the html4.0 surface library. It means that it is perfectly possible to use the basis and the convenience library together. This is recommended for CGI programming purposes. (The surface library is not very efficient due to the need for 'parameter sorting and correspondence').

See also the basis and the surface libraries of the html4.0-loose mirror.

Table of Contents:
1. Renamings compared to the original html library.6. HTML input form functions.11. Alphabetical index arrays.
2. Basic HTML extension stuff.7. Page functions.12. Substring Coloring.
3. Convenience variants of the HTML mirror functions.8. Multi column lists.13. Support of imperative printing of tags.
4. Lists and trees.9. Images and image file access.14. Miscelaneous
5. Table functions.10. Indenting, boxing, and framing.

Alphabetic index:
a-name(a-name name)Name the current place by means of an a tag with name attribute
a-tag(a-tag url . anchor)Return an a tag constructructed from the URL and the anchor.
a-tag-target(a-tag-target url anchor target)A variant of a tag which supports a target attribute of the a-tag (where in browser to show the result).
alphabetic-link-array(alphabetic-link-array)Return an 'array' of letter links to #letter
alphabetic-link-array-1(alphabetic-link-array-1 target-file-prefix alphabet . emphasis-letter)Return an 'array' of letter links to (string-append target-file-prefix "-" letter ".html") for all letters in alphabet.
bl(bl lst)A large, red bulleted list.
blockquote-1(blockquote-1 x)Present the string converted x in a blockquote tag.
box(box text [width])Embed text in an invisible (border-less) table with one cell.
br-list(br-list lst)Return a flat list, separate by breaks.
brl(brl lst)A convenient alias for br-list
bullet-list(bullet-list lst bullet-size bullet-color)Render lst as a bulleted list.
center-frame(center-frame indentation text)Embed text into a centered frame
character-entity(character-entity x)If x is a number return a numbered character entity.
checkbox(checkbox name . checked)Return an input tag of type checkbox.
cite-1(cite-1 x)Present x in a blockquote tag.
color-frame(color-frame text color)Embed text into a color frame.
color-frame-width(color-frame-width text color width)As color-frame, but this function supports and extra widht parameter.
colorize-substrings(colorize-substrings str region-color-list)This is an advanced function which make font changes to substrings of str.
con(con . elements)Aggregates the parameters of a html mirror function to a single string.
con-par(con-par . string-list-0)Like con from the general library, but insert a p tag between all strings in string-list Forward compatible with the validating mirror functions.
con-space(con-space . string-list-0)Like con from the general library, but insert a space between all strings in string-list Forward compatible with the validating mirror functions.
copyrightcopyrightThe copyright character entity
copyright-owner(copyright-owner x)Embed x into a copyright indication
definition-list(definition-list lst)Make a definition list.
dl-1(dl-1 list)A convenient alias for definition-list.
doctype-clause(doctype-clause)The HTML4.0 loose document type clause
file-upload(file-upload name)Return an input tag of type file.
font-1(font-1 size color x)Returns a font tag with size and color attributes.
font-color(font-color color x)Like font, but only supports color.
font-rise(font-rise str base-size)Return a html fonted version of str.
font-size(font-size size x)Like font, but only supports size.
form-1(form-1 cgi-url x)Embed x in to form, which activates url upon form completion.
frame-1(frame-1 text)Shown text in a simple frame.
frame-width(frame-width text width)Like frame, but with an extra width parameter.
general-page-messagegeneral-page-messageA message (string) which is presented at the top of every page generated.
h(h i x)Returns h tags, h1 if i=1, h2 if i=2, etc.
hidden-line(hidden-line name value)Return an input tag of type hidden.
horizontal-spacehorizontal-spaceReturn n space special characters
hr-1(hr-1 . size)Return a horizontal rule, a hr tag.
html-appender(html-appender element)Generate a function which appends element.
html-protect(html-protect str)Protect HTML tags such that an HTML document can be shown verbatim in a browser.
image-file(image-file file-name)Return the full path/address of the image file named file-name.
image-file-path(image-file-path)Determination of the actual file path to images in html files.
img-0(img-0 file-name . width)Return an img tag, in which a file on file-name is presented.
img-with-border(img-with-border file-name . width)A variant of img which presents an image with a border
in-danish(in-danish str)Translate the Danish letters in str to a string with appropriate use of HTML character entities.
indent-pixels(indent-pixels p text)Indent text with p pixels
js-call(js-call function-name parameters)Return a Javascript calling form, given function function-name and parameters.
js-string-array(js-string-array elements)Return a manifest javascript array given its elements
kn-internet-image-pathkn-internet-image-pathThe URL where the author of this library keeps a number of images (icons).
laml-home-button(laml-home-button extra-level text-or-image . start-dir)Return an HTML a tag (anchor) which links to the LAML software home page via an small gif icon.
laml-top-banner(laml-top-banner)Return the standard LAML top banner with time of generation, copyright, and home icon
left-middle-right-banner(left-middle-right-banner left middle right)Return a banner with left, middle, and right justified contributions.
left-right-banner(left-right-banner left right)Return a banner with left and right justified contributions.
mail-link(mail-link email-adr . anchor-name)Return a mail link by means of the mailto facility in an a tag.
mini-menu(mini-menu mini-menu-list dark-color)Makes a horizontal menu menu in terms of a table with links.
multi-column-list(multi-column-list columns elements total-width)Return a multi-column list, row major, with columns columns.
multipart-form(multipart-form cgi-url target-directory target-directory-url x)Embed x into a multipart form.
n-column-list(n-column-list n elements total-width)Return an n column list, column-major, of the element list (second parameter).
narrow(narrow separator-fn width . contents-list)Present the contents-list, which is a list of elements, in a narrow column of width, separated with activations of separator-fn.
narrow-with-pixels(narrow-with-pixels p text)Show text in a column, narrowed from both left and right with p pixels
ol-1(ol-1 list)A convenient alias for ordered-list.
ordered-list(ordered-list lst)Return an ol (ordered list) tag.
p-1(p-1 . x)Present a p tag (paragraph).
page(page title body . color-list)Return a simple HTML page with html, head and title tags.
page-1(page-1 title meta-contributions body bg-color text-color link-color vlink-color . optional-parameter-list)Return an HTML page with html, head, meta and title tags.
page-with-keypress-script(page-with-keypress-script title meta-contributions body script-loading script keypress-action bg-color text-color link-color vlink-color . optional-parameter-list)A version of the page and page-1 functions with Javascript scripts as a new fourth to sixth parameter.
password-line(password-line name size value)Return an input tag of type password.
post-page(post-page)Return the part of an HTML page after the body.
post-page-with-comments(post-page-with-comments)Return the part of an HTML page after the body together with trailing laml standard comment and tracing comment.
pre-page(pre-page title . color-list)Return the part of an HTML page before the body.
pre-page-with-keypress-script(pre-page-with-keypress-script title meta-contributions script-loading script keypress-action bg-color text-color link-color vlink-color . optional-par)Return a pre-page, without body and trailing html stuff.
radio-button(radio-button value group-name . checked)Return an input tag of type radio.
reset(reset value)Return an input tag of type reset.
select-1(select-1 name value-list contents-list . selected-value)Return a select tag, defining multiple choice menu.
set-image-file-path!(set-image-file-path! mode)Set the image-file-access variable.
space(space n)Return n space special characters (horizontal space)
submit(submit value [name])Return an input tag of type submit.
table-0(table-0 list-of-list . border)Return a table with elements from list-of-list.
table-1(table-1 border cell-width-list cell-color-list-1 list-of-list . valign)A more versatile variant of table-0.
table-2(table-2 border cell-width-list cell-color-list-1 header-list list-of-list)A variant of table and table-1 which supports a header row.
table-3(table-3 border cell-width-list list-of-list . valign)A transparant variant of table-1 - without specification of a column color list.
table-4(table-4 border cell-width-list row-color-list list-of-list . valign)A variant of table-1 with a row color list instead of a column color list.
table-5(table-5 border cell-width-list list-of-color-list list-of-list . valign)A variant of table-4 that allows individual background coloring of table cells.
text-line(text-line name size value)Return an input tag of type text.
textarea-1(textarea-1 name rows cols contents)Return a textarea form.
timed-page(timed-page title show-time continuation-url meta-contributions body bg-color text-color link-color vlink-color . optional-parameter-list)A variant of page-1 and page-with-keypress-script which includes show-time (in seconds) and continuation-url.
timed-page-with-keypress-script(timed-page-with-keypress-script title show-time continuation-url meta-contributions body script-loading script keypress-action bg-color text-color link-color vlink-color . optional-parameter-list)A combination of time-page and page-with-keypress-script (with timed-page as starting point).
two-column-list(two-column-list elements total-width)Return a two column list, column major.
ul-1(ul-1 list)A convenient alias for unordered-list.
ul-tree(ul-tree tree)Show tree as an indented, bulleted list.
unordered-list(unordered-list lst)Return an ul (uordered list) tag.
vertical-space(vertical-space n)Return n vertical spaces, i.e., n p tags
write-html-page(write-html-page file header body)Write a HTML page consisting of header and body to file.

 

1.   RENAMINGS COMPARED TO THE ORIGINAL HTML LIBRARY.
As mentioned in the introduction, a number of functions in this library have been renamed, as compared with the similar functions in the original html library. It is important to be aware of these renamings if you convert old LAML-based software to the HTML4.0-loose mirror. The renamings are as follows

form -> form-1
select -> select-1
textarea -> textarea-1
ol -> ol-1
ul -> ul-1
table -> table-0 
img -> img-0
hr -> hr-1
font -> font-1
blockquote -> blockquote-1
cite -> cite-1
p -> p-1
frame -> frame-1
A few functions of the old html-v1 mirror are also affected:
html:page -> page-1
html:post-page -> post-page-with-comments
html:pre-page-with-keypress-script -> pre-page-with-keypress-script
html:page-with-keypress-script -> page-with-keypress-script
In addition all calls of functions named html:f must be changed to html4:f.

 

2.   BASIC HTML EXTENSION STUFF.
In this section we implement mirrors of HTML stuff such as comment and character entities. Also there are a number of convenient white space functions (horizontal and vertical). As a special, but very useful function, we include an html-protect function which provides for presentation of verbatim HTML documents in a browser. There is also some basic javascript support in this section.


doctype-clause


Form
(doctype-clause)

Description
The HTML4.0 loose document type clause


character-entity


Form
(character-entity x)

Description
If x is a number return a numbered character entity. if x is a symbol og string, return a named character entity.


copyright


Form
copyright

Description
The copyright character entity


space


Form
(space n)

Description
Return n space special characters (horizontal space)


horizontal-space


Form
horizontal-space

Description
Return n space special characters


vertical-space


Form
(vertical-space n)

Description
Return n vertical spaces, i.e., n p tags


html-protect


Form
(html-protect str)

Description
Protect HTML tags such that an HTML document can be shown verbatim in a browser. Transliterate angle brackets in str to the particular html character entities. With this useful function it is possible to show the html tags in a browser


in-danish


Form
(in-danish str)

Description
Translate the Danish letters in str to a string with appropriate use of HTML character entities.


js-call


Form
(js-call function-name parameters)

Description
Return a Javascript calling form, given function function-name and parameters. Returns a string of the form: function-name(parameters). This function adds commas between the actual Javascript parameters.


js-string-array


Form
(js-string-array elements)

Description
Return a manifest javascript array given its elements


con


Form
(con . elements)

Description
Aggregates the parameters of a html mirror function to a single string. You can think of it as a kind of string concatenation. Forward compatible with the validating mirror functions. It is the intension to use it when concatenating HTML constituents. Returns a list.

See also
similar functionconcatenate


con-par


Form
(con-par . string-list-0)

Description
Like con from the general library, but insert a p tag between all strings in string-list Forward compatible with the validating mirror functions.


con-space


Form
(con-space . string-list-0)

Description
Like con from the general library, but insert a space between all strings in string-list Forward compatible with the validating mirror functions.


 

3.   CONVENIENCE VARIANTS OF THE HTML MIRROR FUNCTIONS.
The functions in this section are either quite close to the HTML mirror functions or very simple.


a-tag


Form
(a-tag url . anchor)

Description
Return an a tag constructructed from the URL and the anchor. If no anchor is provided uses the url as anchor text.


a-tag-target


Form
(a-tag-target url anchor target)

Description
A variant of a tag which supports a target attribute of the a-tag (where in browser to show the result).


a-name


Form
(a-name name)

Description
Name the current place by means of an a tag with name attribute


mail-link


Form
(mail-link email-adr . anchor-name)

Description
Return a mail link by means of the mailto facility in an a tag.


hr-1


Form
(hr-1 . size)

Description
Return a horizontal rule, a hr tag.


h


Form
(h i x)

Description
Returns h tags, h1 if i=1, h2 if i=2, etc. If i is higher than 6, use size 6.


font-1


Form
(font-1 size color x)

Description
Returns a font tag with size and color attributes. size is a number or the symbol normal. color is a rgb list of three, decimal integers or a color symbol from the color library. Corresponds to the old function font in the ad hoc html library.


font-size


Form
(font-size size x)

Description
Like font, but only supports size. size is a number and color is a rgb list of three, decimal integers or a color symbol.


font-color


Form
(font-color color x)

Description
Like font, but only supports color. color is a rgb list of three, decimal integers


cite-1


Form
(cite-1 x)

Description
Present x in a blockquote tag. This has nothing to do with the html cite tag. Corresponds to the old function cite in the ad hoc html library.


blockquote-1


Form
(blockquote-1 x)

Description
Present the string converted x in a blockquote tag. Corresponds to the old function blockquote in the ad hoc html library. Don't use it - this function is only included to serve old LAML tools.


p-1


Form
(p-1 . x)

Description
Present a p tag (paragraph). If no parameter is given, just return a p tag without contens. If a parameter is given, return x embedded in a p tag. Corresponds to the old function p in the ad hoc html library. Don't use it - this function is only included to serve old LAML tools. Use p from the surface library instead.


html-appender


Form
(html-appender element)

Description
Generate a function which appends element. As an example use, (html-appender (p)) is a function of one parameter, which appends a p tag to the argument of the function.


font-rise


Form
(font-rise str base-size)

Description
Return a html fonted version of str. Initial letter is sized base-size+1. The rest is size base-size


 

4.   LISTS AND TREES.
In this section there are various convenient functions which renders lists and trees.


ordered-list


Form
(ordered-list lst)

Description
Return an ol (ordered list) tag. The elements in list becomes the elements. li tags are inserted automatically by this function. A natural Scheme variant of the ol HTML mirror function, in which the items are represented as a Lisp list.


ol-1


Form
(ol-1 list)

Description
A convenient alias for ordered-list. A natural Scheme variant of the ol HTML mirror function, in which the items are represented as a Lisp list. Corresponds to the old function ol in the ad hoc html library.

See also
see alsoordered-list    


unordered-list


Form
(unordered-list lst)

Description
Return an ul (uordered list) tag. The elements in list becomes the elements. Li tags are inserted automatically by this function. A natural Scheme variant of the ul HTML mirror function, in which the items are represented as a Lisp list.


br-list


Form
(br-list lst)

Description
Return a flat list, separate by breaks. The parameter lst is a list of items.


brl


Form
(brl lst)

Description
A convenient alias for br-list

See also
see alsobr-list    


ul-1


Form
(ul-1 list)

Description
A convenient alias for unordered-list. A natural Scheme variant of the ul HTML mirror function, in which the items are represented as a Lisp list. Corresponds to the old function ul in the ad hoc html library.

See also
see alsounordered-list    


definition-list


Form
(definition-list lst)

Description
Make a definition list. lst is a list of lists. Each inner list must be of length two, dt and dd respectively. I.e. definition terms and the defintion proper, resp. As a special case supported, the inner list can be of lenght one, in which case the dd is considered empty


dl-1


Form
(dl-1 list)

Description
A convenient alias for definition-list. A natural Scheme variant of the dl HTML mirror function


bullet-list


Form
(bullet-list lst bullet-size bullet-color)

Description
Render lst as a bulleted list. Both parameters must be symbols. Bullet-size is either 'small or 'large. Bullet-color is either 'red, 'green, 'yellow, 'blue, or 'cyan. Depends on the presence of appropriate gif files in images directory. In order to use this function you must specify where to find the bullet images; This is done by setting image-file-access via the function set-image-file-path!


bl


Form
(bl lst)

Description
A large, red bulleted list. A convenient special version of bullet-list.


ul-tree


Form
(ul-tree tree)

Description
Show tree as an indented, bulleted list. A tree is a list. The first element of the list is the root. The tail of the list is the list of subtrees. A subtree, which is a leaf, can be given as a symbol, string or number
Example   (a (b c d) (e (f g) h))

              a
            /   \
           b     e
          / \   / \
         c  d  f   h
               |
               g


 

5.   TABLE FUNCTIONS.
In this section there is a number of table functions which maps a list of rows (list of lists) to an HTML table.


table-0


Form
(table-0 list-of-list . border)

Description
Return a table with elements from list-of-list. The sublists of list represent the rows in the table. The border is an optional parameter. Corresponds to the old function table in the ad hoc html library.

Parameters
list-of-listthe list of table row lists.


table-1


Form
(table-1 border cell-width-list cell-color-list-1 list-of-list . valign)

Description
A more versatile variant of table-0. A variant of table-0 which requires border (an integer, 0 if no border), a list of cell widths, a list of column colors, the table contents (list-of-list - list of rows), and an optional valign parameter. The valign parameter corresponds to the HTML valign attribute, the possible value of which are "top", "middle", "bottom", and "baseline" (a string).


table-2


Form
(table-2 border cell-width-list cell-color-list-1 header-list list-of-list)

Description
A variant of table and table-1 which supports a header row.


table-3


Form
(table-3 border cell-width-list list-of-list . valign)

Description
A transparant variant of table-1 - without specification of a column color list. The cell color becomes identical with the background.


table-4


Form
(table-4 border cell-width-list row-color-list list-of-list . valign)

Description
A variant of table-1 with a row color list instead of a column color list. The length of row-color-list must be the same as the length of each row list in list-of-list.


table-5


Form
(table-5 border cell-width-list list-of-color-list list-of-list . valign)

Description
A variant of table-4 that allows individual background coloring of table cells. The parameter list-of-color-list is a list of row colors, whereas row-color-list in table-4 is a fixed list of colors that apply to a row. Thus, the structure of list-of-color-list is identical to the structure of list-of-list.

See also
similar functiontable-4    


left-middle-right-banner


Form
(left-middle-right-banner left middle right)

Description
Return a banner with left, middle, and right justified contributions.


left-right-banner


Form
(left-right-banner left right)

Description
Return a banner with left and right justified contributions.


laml-top-banner


Form
(laml-top-banner)

Description
Return the standard LAML top banner with time of generation, copyright, and home icon


mini-menu


Form
(mini-menu mini-menu-list dark-color)

Description
Makes a horizontal menu menu in terms of a table with links. The table is made on the basis of parameter mini-menu-list, which is a list of menu entries. A menu entry is a list of anchor-text and URL pairs (lists of two strings). Dark-color must be some dark color.


 

6.   HTML INPUT FORM FUNCTIONS.
A number of convenient functions which supports the work with HTML input forms.


form-1


Form
(form-1 cgi-url x)

Description
Embed x in to form, which activates url upon form completion. Corresponds to the old function form in the ad hoc html library.


multipart-form


Form
(multipart-form cgi-url target-directory target-directory-url x)

Description
Embed x into a multipart form. Activate cgi-url when the form is submitted. A multipart form is used for file uploading. Files are written into target-directory when uploaded. The parameter target-directory-url gives the URL of the directory, in which the file is uploaded. This is used for subsequent WWW retrival of the file.

See also
accompanying functionmultipart-decode


checkbox


Form
(checkbox name . checked)

Description
Return an input tag of type checkbox. The name is a string or symbol which identifies the checkbox. Checked is an optional boolean parameter. If checked is #t, the checkbox will be checked initially. Returns the string true to the form processing application if checked.


radio-button


Form
(radio-button value group-name . checked)

Description
Return an input tag of type radio. checked is a boolean parameter, i.e. true or false (in Scheme sense).


text-line


Form
(text-line name size value)

Description
Return an input tag of type text. The name is a string of symbol which identifies the text line. Size is the text line width in character positions. Value is the initial value on the text line.


hidden-line


Form
(hidden-line name value)

Description
Return an input tag of type hidden. The name is a string or symbol which identifies the hidden line. Value is the string contents of the hidden line.


file-upload


Form
(file-upload name)

Description
Return an input tag of type file. Such an input tag is used for file uploading. The name of the uploading is name.


password-line


Form
(password-line name size value)

Description
Return an input tag of type password. The name is a string of symbol which identifies the password. Size is the line width in character positions. Value is the initial contents of the password field (not very useful...).


submit


Form
(submit value [name])

Description
Return an input tag of type submit. Renders a button. Value is the string label of the button. If the optional parameter name is given it identifies a particular submit button with a name, value pair in the submitted data.


reset


Form
(reset value)

Description
Return an input tag of type reset. Value is the string label of the button.


select-1


Form
(select-1 name value-list contents-list . selected-value)

Description
Return a select tag, defining multiple choice menu. Name is a string or symbol which identifies the selection. Value-list is a list of the values to be returned upon selection. Contents-list is the list of contents to be shown in the menu. Selected-value is an optional value, which is to be selected initially. This value should be a member of value-list. Corresponds to the old function select in the ad hoc html library.


textarea-1


Form
(textarea-1 name rows cols contents)

Description
Return a textarea form. Rows is the number of rows of the text area. Cols is the number of columns measured in characters. Contents is the initial contents of the text area. Corresponds to the old function textarea in the ad hoc html library.


 

7.   PAGE FUNCTIONS.
A number of convenient functions which make the overall elements of an HTML page.


page


Form
(page title body . color-list)

Description
Return a simple HTML page with html, head and title tags. Also include the value of the parameter-less function (laml-standard-comment) as an initial html-comment. The optional color-list must consist of a background color, text color, link color and visited link color.


page-1


Form
(page-1 title meta-contributions body bg-color text-color link-color vlink-color . optional-parameter-list)

Description
Return an HTML page with html, head, meta and title tags. This function is a more elaborate version of the page function from above. This function assumes that the functions tracing-comment and meta-tag-clauses are defined. The function meta-tag-clauses must return a property list of meta-descriptors, which represents the standard meta clauses of this page. The parameter meta-contributions is a property list of meta descriptors: (key val key val ...). Meta-tag-clauses and meta-contributions go into a HTML meta-tag in the beginning of the generated document. Tracing-comment must return a string. Tracing-comment is meant to let us trace the LAML source files etc. Tracing-comment is defaulted to return the empty string. The first part of the string output is the standard DOCTYPE. The keys must be symbols, the values must be strings. The last four parameters must consist of a background color, text color, link color and visited link color (all color RGB lists). Corresponds to the old function html:page in the html-v1 library. The first optional parameter addresses a css-style-file-list (defaulted to #f). The second optional parameter gives the kind of body (css class) of the body of the page. The third optional parameter gives the id of the body, for the purpose individual of CSS styling of the body.


page-with-keypress-script


Form
(page-with-keypress-script title meta-contributions body script-loading script keypress-action bg-color text-color link-color vlink-color . optional-parameter-list)

Description
A version of the page and page-1 functions with Javascript scripts as a new fourth to sixth parameter. The parameter script-loading can either be static or dynamic (symbols). If static, include the script in the html document. If dynamic, refer to the script in the a javascript subdirectory. The parameter script is a list of two file path components (prefix-static-part js-filename), both strings. If script-loading is static (string-append prefix-static-part js-filename) is the name of the script file, the contents of which must be included inline. If script-loading is dynamic js-filename is the name of a file in the html/javascript directory, including extension. The parameter keypress-action is supposed to be an activation of a Javascript function defined in script. The optional parameter is either single-press or double-press (a symbol). Determines whether advancement to next page is via single or double mouse click. Default optional parameter is double-pres. This works in concert with the the loaded script. Uses the function read-text-file from the file-read library. In addition to key press events, single or double click mouse press is also supported (advancement to a designated next page).' The second optional parameter addresses a css-style-file-list (defaulted to #f). The third optional parameter gives the kind of body (css class) of the body of the page. The fourth optional parameter gives the id of the body, for the purpose individual of CSS styling of the body.


timed-page


Form
(timed-page title show-time continuation-url meta-contributions body bg-color text-color link-color vlink-color . optional-parameter-list)

Description
A variant of page-1 and page-with-keypress-script which includes show-time (in seconds) and continuation-url. An empty string in continuation-url serves as 'no continuation'. The first optional parameter addresses a css-style-file-list (defaulted to #f). The second optional parameter gives the kind of body (css class) of the body of the page. The third optional parameter gives the id of the body, for the purpose individual of CSS styling of the body.


timed-page-with-keypress-script


Form
(timed-page-with-keypress-script title show-time continuation-url meta-contributions body script-loading script keypress-action bg-color text-color link-color vlink-color . optional-parameter-list)

Description
A combination of time-page and page-with-keypress-script (with timed-page as starting point). There are three extra parameters compared to timed-page: script-loading script keypress-action.


write-html-page


Form
(write-html-page file header body)

Description
Write a HTML page consisting of header and body to file. File is without extension. This function adds the html extension


general-page-message


Form
general-page-message

Description
A message (string) which is presented at the top of every page generated. The default value is the empty string. Must be redefined or re-assigned after the loading of this file. The message is supposed to end with a proper line terminator, such as (br) or (p).

See also
functions using this variablepage    page-1    page-with-keypress-script    


 

8.   MULTI COLUMN LISTS.
The functions in this section return multi-column lists. Given a list of elements the functions return a table in which the elements have been arranged in a number of columns. The first function, multi-column-list, arranges the elements in row major order. The two last functions arrange the the elements in column major order. These are the most advanced functions due to the way tables are organized in HTML.


multi-column-list


Form
(multi-column-list columns elements total-width)

Description
Return a multi-column list, row major, with columns columns. Columns (the first parameter) must be at least 2. The total width (sum of column widths) is given as the last parameter. Internally, a HTML table with zero border is formed and returned.


two-column-list


Form
(two-column-list elements total-width)

Description
Return a two column list, column major. total-width (sum of column widths) is the width you want the resulting table to have. Internally, a HTML table with zero border is formed and returned.


n-column-list


Form
(n-column-list n elements total-width)

Description
Return an n column list, column-major, of the element list (second parameter). This is a generalized version of two-column-list. total-width (sum of column widths) is the width you want the resulting table to have. n is the number of columns. Internally, a HTML table with zero border is formed and returned.


 

9.   IMAGES AND IMAGE FILE ACCESS.
The functions in this section determine how images are accessed from this and other libraries.


kn-internet-image-path


Form
kn-internet-image-path

Description
The URL where the author of this library keeps a number of images (icons). This variable is used if image-file-access is the symbol net.


image-file-path


Form
(image-file-path)

Description
Determination of the actual file path to images in html files. This function depends on the variable image-file-access, which MUST be defined external to this library. The value of image-file-access can be changed via the procedure set-image-file-access! One of the following symbols apply: local, parent, net, sub-directory, or fixed. Default is local. local means that images are taken from the current directory. parent means that images are tagen from ../images. sub-directory means that images are taken from ./images. fixed means that images are taken from fixed-image-directory (a variable which must be defined external to this library). Finally, net means that images are taken from kn-internet-image-path (a variable).


set-image-file-path!


Form
(set-image-file-path! mode)

Description
Set the image-file-access variable. mode is symbol, either local, parent, sub-directory, net, or fixed. Relative to the hmtl directory, where the target files are written.


image-file


Form
(image-file file-name)

Description
Return the full path/address of the image file named file-name. Relies of the setting of the variable image-file-access via the procedure set-image-file-path! File name must include file extension


img-0


Form
(img-0 file-name . width)

Description
Return an img tag, in which a file on file-name is presented. An optional width parameter is supported. Corresponds to the old function img in the ad hoc html library.


img-with-border


Form
(img-with-border file-name . width)

Description
A variant of img which presents an image with a border


laml-home-button


Form
(laml-home-button extra-level text-or-image . start-dir)

Description
Return an HTML a tag (anchor) which links to the LAML software home page via an small gif icon. If possible, a relative URL is used as the href attribute. The parameter extra-level is an extra level to add. Normally, extra-level is 0 (zero). As an example, extra-level should be 1 in case HTML files are organized in a sub-directory relative to the laml source file. Text-or-image is either the symbol 'text or 'image, or a string. If 'text, a textual anchor is used. if 'image, a small 'laml house' is used as image. If text-or-image is a string it is a name of an image file in the laml image directory (including file name extension, excluding any file path). The optional start-dir gives the directory, in which the home button is to be placed; It defaults to (startup-directory).


 

10.   INDENTING, BOXING, AND FRAMING.
Here is a number of functions of indentation and frame making.


indent-pixels


Form
(indent-pixels p text)

Description
Indent text with p pixels


narrow-with-pixels


Form
(narrow-with-pixels p text)

Description
Show text in a column, narrowed from both left and right with p pixels


frame-1


Form
(frame-1 text)

Description
Shown text in a simple frame. Has nothing to do with HTML frames. Corresponds to the old function frame in the ad hoc html library.


box


Form
(box text [width])

Description
Embed text in an invisible (border-less) table with one cell. The optional parameter, width, can be used to control the width of the table cell (defaults to "*").


narrow


Form
(narrow separator-fn width . contents-list)

Description
Present the contents-list, which is a list of elements, in a narrow column of width, separated with activations of separator-fn.


color-frame


Form
(color-frame text color)

Description
Embed text into a color frame. It is the background which is colored.


color-frame-width


Form
(color-frame-width text color width)

Description
As color-frame, but this function supports and extra widht parameter. This is an integer: the with of the frame in pixels.


frame-width


Form
(frame-width text width)

Description
Like frame, but with an extra width parameter. This is an integer: the with of the frame in pixels.


center-frame


Form
(center-frame indentation text)

Description
Embed text into a centered frame


 

11.   ALPHABETICAL INDEX ARRAYS.
The alphabetic index arrays are useful for presentation of alphabets linking to separate pages in a large index.


alphabetic-link-array


Form
(alphabetic-link-array)

Description
Return an 'array' of letter links to #letter


alphabetic-link-array-1


Form
(alphabetic-link-array-1 target-file-prefix alphabet . emphasis-letter)

Description
Return an 'array' of letter links to (string-append target-file-prefix "-" letter ".html") for all letters in alphabet. This is a generalized version of alphabetic-link-array. target-file-prefix is a prefix of the file names, in which the index files are located. alphabet is a list of letters, for which to generate index links from the alphabet arrays. Some letters may be missing from the alphabet compared with a complete alphabet. emphasis-letter is an optional letter which we emphasize in the link array


 

12.   SUBSTRING COLORING.
The function colorize-substring in this section is able to colorize specified substrings of a given string.


colorize-substrings


Form
(colorize-substrings str region-color-list)

Description
This is an advanced function which make font changes to substrings of str. Surround substrings of str, as specified by the third parameter, in font tags. Region-color-list is a list of coloring descriptors.

Each color descriptor is of the form: (from-string to-string color face multiplicity).

Face and multiplicity are optional. From-string and to-strings delimits and identifies a substring of str to colorize etc. Color can be given by any format accepted by rgb-color-encoding. We support the following face symbols: italic, bold, typewriter, underlined, plain (default bold). Multiplicity is an integer telling how many times to to attempt the colorization on str (default 1).

NB: In strange situations, the fontification of an early region-color-element may affect the searching for latter region-color-elements. This is not an error, but a consequence of the way font tags are puted into str.



 

13.   SUPPORT OF IMPERATIVE PRINTING OF TAGS.
In some special situations it may be desirable to generate or print fragments of an HTML element in terms of indidual start and end tags. Here we provide for functions which allow us to generate the initial and the final portions of an HTML document in separation from each other.


pre-page


Form
(pre-page title . color-list)

Description
Return the part of an HTML page before the body.


pre-page-with-keypress-script


Form
(pre-page-with-keypress-script title meta-contributions script-loading script keypress-action bg-color text-color link-color vlink-color . optional-par)

Description
Return a pre-page, without body and trailing html stuff. Used for imperative output of an HTML page. Usage: First call this function, then output the body, and then call post-page or post-page-with-comments. Corresponds to the old function html:pre-page-with-keypress-script in the html-v1 library. With respect to the parameters see the function page-with-keypress-script.


post-page


Form
(post-page)

Description
Return the part of an HTML page after the body. This includes the end body and the end html tags.


post-page-with-comments


Form
(post-page-with-comments)

Description
Return the part of an HTML page after the body together with trailing laml standard comment and tracing comment. This includes the end body and the end html tags. Furthermore the laml standard comment and the tracing comment is printed as HTML comments. Corresponds to the old function html:post-page in the html-v1 library.


 

14.   MISCELANEOUS


copyright-owner


Form
(copyright-owner x)

Description
Embed x into a copyright indication


Generated: December 4, 2003, 23:30:54
This documentation has been extracted automatically from the Scheme source file by means of the Schemedoc tool