Generated: Monday, November 14, 2011, 09:17:58Copyright ©2011, Kurt NÝrmarkThe local LAML software home page

Reference Manual of the HTML library

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

Source file: lib/html.scm
LAML Version 38.0 (November 14, 2011, full)

This is the library of Scheme functions which mirrors HTML. The set of functions in this library is a rather unsystematic, ad hoc collection. Nevertheless, it has proven quite useful. Much of our current software uses this library heavily.

We have made 'a new and more systematic beginning' with a set of basic HTML mirror functions in the library html-v1. In the future we intend to built op top of this basis.

This library is now obsolete. Use the convenience library together with the basis mirror and surface mirror of HTML4.01 transitional.

Table of Contents:
1. Document type definition.3. Form stuff.5. Uncategorized functions.
2. Table functions.4. Multi column lists.6. Indenting 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)Support of generation of alphabetic indexes.
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.
b(b x)Present x in a b tag (bold)
bl(bl lst)A large, red bulleted list
blockquoteblockquotePresent x in a blockquote tag
box(box text)Embed text in an invisible table with one cell
br(br)Return a br tag (break)
br-list(br-list lst)Return a flat list, separate by breaks
brlbrlA convenient alias for br-list
bullet-list(bullet-list lst bullet-size bullet-color)Render lst as a bulleted list.
center(center x)Present x in a center tag
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(cite 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 a more advanced function which make font changes to substrings of str.
con(con . string-list)Concatenete a number of strings.
con-par(con-par . string-list)Like con, but ensure that there are paragraphs marks in between the concatenated strings.
con-space(con-space . string-list)Like con, but ensure that there are white space in between the concatenated strings.
copyright-owner(copyright-owner x)Embed x into a copyright indication
definition-list(definition-list lst)Make a definition list.
dldlA convenient alias for definition-list
document-type-declaration(document-type-declaration)Return a document type declaration of this mirror.
em(em x)Present x in a em tag (emphasize)
file-upload(file-upload name . optional-parameters)Return an input tag of type file.
font(font size color x)Returns a font tag.
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(form cgi-url x)Embed x in to form, which activates cgi-url upon form completion.
frame(frame text)Shown text in a simple frame
frame-width(frame-width text width)Like frame, but with an extra width parameter.
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(hr . size)Return a horizontal rule, a hr tag.
html-appender(html-appender element)Generate a function which appends element
html-comment(html-comment comment)Return an HTML comment form.
html-protect(html-protect str)Transliterate angle brackets in str to the particular html character entities.
i(i x)Present x in a i tag
image-file(image-file file-name)Return the full path/address f image file named file-name.
image-file-path(image-file-path)Determination of the actual file path to images in html files.
img(img 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
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
kbd(kbd x)Present x in a kbd tag
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-standard-comment(laml-standard-comment)Return the standard LAML comment, to be inserted at the top of every LAML generated page.
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
ololA convenient alias for ordered-list
ordered-list(ordered-list lst)Return an ol (ordered list) tag.
p(p . x)Present a p tag (paragraph).
page(page title body . color-list)Return a simple HTML page with html, head and title tags.
password-line(password-line name size value)Return an input tag of type password.
post-page(post-page)The part of a HTML page after the body.
pre(pre x)Present x in a pre tag
pre-page(pre-page title . color-list)The part of a HTML page before the body.
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(select name value-list contents-list . selected-value)Return a select tag, defining a 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)
strong(strong x)Present x in a strong tag
submit(submit value [name])Return an input tag of type submit.
table(table 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.
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 variant of table-1, but without 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.
text-line(text-line name size value)Return an input tag of type text.
textarea(textarea name rows cols contents)Return a textarea form.
tracing-comment(tracing-comment)The result of this function is inserted as an HTML comment on each html page generated.
two-column-list(two-column-list elements total-width)Return a two column list, column major.
u(u x)Present x in a u tag (underline)
ululA 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.   DOCUMENT TYPE DEFINITION.
This section contains document-type-declaration, that returns the appropriate document type declaration of this mirror.


document-type-declaration


Form
(document-type-declaration)

Description
Return a document type declaration of this mirror.


 

2.   TABLE FUNCTIONS.
A set of functions which generate HTML tables from Scheme list-of-list structures.


table


Form
(table 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.


table-1


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

Description
A more versatile variant of table. A variant of table which requires border (an integer, 0 if no border), a list of cell widths, a list of column colors, the table contens (list-of-list), and an optional valign parameter


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 variant of table-1, but without 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.


 

3.   FORM STUFF.
A number of functions which supports the work with (input) forms in Scheme.


form


Form
(form cgi-url x)

Description
Embed x in to form, which activates cgi-url upon form completion.


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.


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 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 of symbol which identifies the hidden line. Value is the string contents of the hidden line


file-upload


Form
(file-upload name . optional-parameters)

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 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


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

Description
Return a select tag, defining a 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.


textarea


Form
(textarea 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.


 

4.   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 columens Internally, a HTML table with zero border is formed and returned.


 

5.   UNCATEGORIZED FUNCTIONS.
The rest of the functions are not yet categorized.


tracing-comment


Form
(tracing-comment)

Description
The result of this function is inserted as an HTML comment on each html page generated. Redefine this function for your own tracing. As of here, it returns the empty string.


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.


pre-page


Form
(pre-page title . color-list)

Description
The part of a HTML page before the body. A html-v1 version of this function should be provided for.


post-page


Form
(post-page)

Description
The part of a HTML page after the body. A html-v1 version of this function should be provided for.


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.


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.


ol


Form
ol

Description
A convenient alias for ordered-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.


br-list


Form
(br-list lst)

Description
Return a flat list, separate by breaks


brl


Form
brl

Description
A convenient alias for br-list


ul


Form
ul

Description
A convenient alias for unordered-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


Form
dl

Description
A convenient alias for definition-list


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.


bl


Form
(bl lst)

Description
A large, red bulleted 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.


kbd


Form
(kbd x)

Description
Present x in a kbd tag


hr


Form
(hr . size)

Description
Return a horizontal rule, a hr tag.


img


Form
(img file-name . width)

Description
Return an img tag, in which a file on file-name is presented. An optional width parameter is supported.


img-with-border


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

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


h


Form
(h i x)

Description
Returns h tags, h1 if i=1, h2 if i=2, etc.


i


Form
(i x)

Description
Present x in a i tag


strong


Form
(strong x)

Description
Present x in a strong tag


pre


Form
(pre x)

Description
Present x in a pre tag


center


Form
(center x)

Description
Present x in a center tag


font


Form
(font size color x)

Description
Returns a font tag. size is a number and color is a rgb list of three, decimal integers or a color symbol.


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


b


Form
(b x)

Description
Present x in a b tag (bold)


u


Form
(u x)

Description
Present x in a u tag (underline)


em


Form
(em x)

Description
Present x in a em tag (emphasize)


cite


Form
(cite x)

Description
Present x in a blockquote tag


blockquote


Form
blockquote

Description
Present x in a blockquote tag


p


Form
(p . x)

Description
Present a p tag (paragraph). If no parameter is given, just return a p tag without content. If a parameter is given, return x embedded in a p tag.


br


Form
(br)

Description
Return a br tag (break)


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-comment


Form
(html-comment comment)

Description
Return an HTML comment form. I.e, embed comment into the HTML comment characters


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).


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


 

6.   INDENTING AND FRAMING.
Here is a number of functions of indentation and framing


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


Form
(frame text)

Description
Shown text in a simple frame


box


Form
(box text)

Description
Embed text in an invisible table with one cell


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


html-protect


Form
(html-protect str)

Description
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


colorize-substrings


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

Description
This is a more 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 is a list of three integers: a rgb list. 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.



con


Form
(con . string-list)

Description
Concatenete a number of strings. Con is an alias of string-append. It is the intension to use it when concatenating HTML constituents.

See also
similar functionconcatenate


con-space


Form
(con-space . string-list)

Description
Like con, but ensure that there are white space in between the concatenated strings.


con-par


Form
(con-par . string-list)

Description
Like con, but ensure that there are paragraphs marks in between the concatenated strings. like con, but insert a p tag between all strings in string-list


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-owner


Form
(copyright-owner x)

Description
Embed x into a copyright indication


laml-standard-comment


Form
(laml-standard-comment)

Description
Return the standard LAML comment, to be inserted at the top of every LAML generated page.


alphabetic-link-array


Form
(alphabetic-link-array)

Description
Support of generation of alphabetic indexes. 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


html-appender


Form
(html-appender element)

Description
Generate a function which appends element


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


kn-internet-image-path


Form
kn-internet-image-path

Description
The URL where the author of this library keeps a number of images (icons).


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 defined external to this library. The value of image-file-access can be changed via procedure set-image-file-access! One of the following symbols: 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 f 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


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 functions adds commas between the actual Javascript parameters.


js-string-array


Form
(js-string-array elements)

Description
Return a manifest javascript array given its elements


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


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.


Generated: Monday, November 14, 2011, 09:17:58
This documentation has been extracted automatically from the Scheme source file by means of the Schemedoc tool