


## make-html.pkg
# Compiled by:
# src/lib/html/html.lib# This is a collection of constructors for building some of the common
# kinds of HTML elements.
package make_html: (weak)
api {
block_list: List( html::Block ) -> html::Block;
text_list: List( html::Text ) -> html::Text;
make_h: ((Int, html::Pcdata)) -> html::Block;
make_p: html::Text -> html::Block;
make_ul: List( html::List_Item ) -> html::Block;
make_ol: List( html::List_Item ) -> html::Block;
make_dl: List { dt: List( html::Text ), dd: html::Block } -> html::Block;
hr: html::Block;
br: html::Text;
make_li: html::Block -> html::List_Item;
mk_a_href: { href: html::Url, content: html::Text } -> html::Text;
mk_a_name: { name: html::Cdata, content: html::Text } -> html::Text;
make_tr: List( html::Table_Cell ) -> html::Tr;
make_th: html::Block -> html::Table_Cell;
mk_th_colspan: { colspan: Int, content: html::Block } -> html::Table_Cell;
make_td: html::Block -> html::Table_Cell;
mk_td_colspan: { colspan: Int, content: html::Block } -> html::Table_Cell;
}
{
fun block_list [b] => b;
block_list bl => html::BLOCK_LIST bl;
end;
fun text_list [t] => t;
text_list tl => html::TEXT_LIST tl;
end;
fun make_h (n, header)
=
html::HN { n, align=>NULL, content=>html::PCDATA header };
fun make_p content
=
html::PP { align=>NULL, content };
fun make_ul items
=
html::UL { compact=>FALSE, type=>NULL, content=>items };
fun make_ol items
=
html::OL { compact=>FALSE, type=>NULL, start => NULL, content=>items };
fun make_dl items
=
html::DL { compact=>FALSE, content=>items };
hr = html::HR { align=>NULL, noshade=>FALSE, size=>NULL, width=>NULL };
br = html::BR { clear => NULL };
fun make_li blk
=
html::LI { type=>NULL, value=>NULL, content=>blk };
fun mk_a_href { href, content } = html::AX {
href => THE href,
title => NULL,
name => NULL,
rel => NULL,
reverse => NULL,
content
};
fun mk_a_name { name, content } = html::AX {
href => NULL,
title => NULL,
name => THE name,
rel => NULL,
reverse => NULL,
content
};
fun make_tr content = html::TR {
align => NULL,
valign => NULL,
content
};
fun make_th content = html::TH {
nowrap => FALSE,
rowspan => NULL,
colspan => NULL,
align => NULL,
valign => NULL,
width => NULL,
height => NULL,
content
};
fun mk_th_colspan { colspan, content } = html::TH {
nowrap => FALSE,
rowspan => NULL,
colspan => THE colspan,
align => NULL,
valign => NULL,
width => NULL,
height => NULL,
content
};
fun make_td content = html::TD {
nowrap => FALSE,
rowspan => NULL,
colspan => NULL,
align => NULL,
valign => NULL,
width => NULL,
height => NULL,
content
};
fun mk_td_colspan { colspan, content } = html::TD {
nowrap => FALSE,
rowspan => NULL,
colspan => THE colspan,
align => NULL,
valign => NULL,
width => NULL,
height => NULL,
content
};
};


