%	html.s
%
%	Purpose:	HTML definitions for document generation
%	Copyright:	R.A. van Engelen, Leiden University, 1997

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%	HTML document generator
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%	html_document(FileName, Title, HTML)
%	Store HTML in file FileName with title Title.

(html_document(_G2509, _G2510, _G2511) is
intrinsic(module = html, result = nil))
.
% reset_html % Reset HTML generator. Advisable to use after interupting HTML document % generation. reset_html is intrinsic(module = html, result = nil). % output_html(HTML) % Write HTML to standard output. Convenient for checking HTML contents. % It is recomended to try output_html(HTML) first before really producing % a HTML file output_html(_G2509) is intrinsic(module = html, result = nil). % html_prolog_file(FileName) % Create HTML file of a file with Prolog-based contents. html_prolog_file(_G2509) is intrinsic(module = html, result = nil). % html_objects % html_objects(Object) % Command to generate HTML files for all (known) objects. html_objects is external(module = html, result = nil). html_objects(_G2509) is external(module = html, result = nil). % html_width % A counter that controles the maximum width of pretty printed expressions % in HTML html_width isa counter. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % HTML constructs % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % You can create your own HTML constructs very easily by adopting the % following basic rules: % % - An HTML tag `tag' with body Body and list of attributes Atts: % html_`tag'(Atts, Body) % produces <`tag' Atts>Body</`tag'> % % Examples: % html_p(["align" = "center"], "Centered paragraph") % html_textarea(["name" = "greeting"], "Hello World") % % - An HTML tag `tag' with body Body and without attributes: % html_`tag'(Body) % produces <`tag'>Body</`tag'> % % Examples: % html_pre(["Hello", "World"]) % % - An HTML tag `tag' without a body but with attributes: % html_`tag'(Atts, []) % produces <`tag' Atts> without an ending tag % % Examples: % html_body(["background" = "sky.gif"], []) % html_hr(["size" = 4, "width" = "50%"], []) % html_img(["src" = "redball.gif"], []) % % Note: html_`tag'(Atts, "") produces an ending tag! % % - An HTML tag `tag' only: % html_`tag' % produces <`tag'> % % Examples: % html_hr % html_p % % - An HTML list/description `tag' for List with Item and separator Sep % html_`tag'(Item, Sep, List) % when Sep = [] produces <`tag'>Item Elt1 Item Elt2 ... </`tag'> % otherwise produces <`tag'>Item T1 Sep D1 Item T2 Sep D2 ... </`tag'> % for all elements Elt in List and where `Elt = T op D' with dyadic op. % % Examples: % html_ul(html_li, [], ["One", "Two", "Three"]) % html_dl(html_dt, html_dd, [1 = "One", 2 = "Two", 3 = "Three"]) % (in the above, `=' can be replaced by any dyadic operator) % % Attributes is a list of Attr = Value pairs where Attr should be a string % and Value is an expression which is written to an HTML file litterally. % (So "src" = "dot.gif" produces src = "dot.gif" % % Here are the predefined HTML constructs: html_reply is inert. % form reply html_start is inert. % <html> html_end is inert. % </html> html_p is inert. % <p> html_br is inert. % <br> html_hr is inert. % <hr> html_dt is inert. % <dt> html_dd is inert. % <dd> html_li is inert. % <li> html_head(_G2509, _G2510) is inert. html_body(_G2509, _G2510) is inert. html_subdocument(_G2509, _G2510, _G2511) is inert. % create a HTML subdocument with label Label and title Title html_goal(_G2509) is inert. % execute Prolog Goal which should write to standard output html_latex(_G2509) is inert. % expressions occuring in HTML are depicted in LaTeX html_latex(_G2509, _G2510) is inert. % ditto, if necessary truncated to Width html_latex_math(_G2509) is inert. % expressions occuring in HTML are depicted in LaTeX math mode html_latex_math(_G2509, _G2510) is inert. % ditto, if necessary truncated to Width html_label_latex(_G2509, _G2510) is inert. % create a LaTeX image file for X, referenced by Label html_label_latex_math(_G2509, _G2510) is inert. % ditto, in math mode html_nolatex(_G2509) is inert. % disable LaTeX output of expressions in HTML html_comment(_G2509) is inert. % include an (invisable) comment html_label(_G2509, _G2510) is inert. % label HTML using Label (may be a wildcard of the form `_name') html_label(_G2509) is inert. % label Label (may be a wildcard of the form `_name') html_ref(_G2509, _G2510) is inert. % ref to a label Addr or an url (in case Addr must be string) html_title(_G2509) is inert. % title html_pre(_G2509) is inert. % preformatted output html_img(_G2509, _G2510) is inert. html_font(_G2509, _G2510) is inert. html_blink(_G2509) is inert. html_em(_G2509) is inert. % logical emphasized html_strong(_G2509) is inert. % logical strong emphasized html_code(_G2509) is inert. % logical code fragment html_samp(_G2509) is inert. % logical sample output html_kbd(_G2509) is inert. % logical keyboard key html_var(_G2509) is inert. % logical variable html_cite(_G2509) is inert. % logical citation html_b(_G2509) is inert. % physical bold html_i(_G2509) is inert. % physical italics html_u(_G2509) is inert. % physical underline html_tt(_G2509) is inert. % physical typewriter % HTML 3.0 extensions html_big(_G2509) is inert. % big text html_small(_G2509) is inert. % small text html_sub(_G2509) is inert. % subscript html_sup(_G2509) is inert. % superscript % end of HTML 3.0 extensions html_h1(_G2509) is inert. % headings 1 to 6 html_h2(_G2509) is inert. html_h3(_G2509) is inert. html_h4(_G2509) is inert. html_h5(_G2509) is inert. html_h6(_G2509) is inert. html_ul(_G2509, _G2510, _G2511) is inert. % itemized list html_ol(_G2509, _G2510, _G2511) is inert. % enumerated list html_dl(_G2509, _G2510, _G2511) is inert. % description list html_menu(_G2509, _G2510, _G2511) is inert. % menu % Tables and figures html_table(_G2509) is inert. html_fig(_G2509, _G2510) is inert. html_caption(_G2509) is inert. html_caption(_G2509, _G2510) is inert. % caption for tables and figures html_tr(_G2509) is inert. html_th(_G2509) is inert. html_td(_G2509) is inert. html_credit(_G2509) is inert. % credit of figure % Built-in aliases: html_image(_G2509) is inert. % depict an image html_image(_G2509, _G2510) is inert. % depict an image using attributes html_figure(_G2509, _G2510) is inert. % figure html_itemize(_G2509) is inert. % itemization of List html_itemize(_G2509, _G2510) is inert. % itemization of List using Bullet html_enumerate(_G2509) is inert. % enumeration of List html_description(_G2509) is inert. % description of List whose items are of the form `T op D' with dyadic op % Forms: html_form_post(_G2509, _G2510) is inert. % create form (method = post) for contents HTML html_text(_G2509) is inert. % text entry html_checkbox(_G2509, _G2510) is inert. % checkbox (checked when On = on) html_radio(_G2509, _G2510, _G2511) is inert. % radio button with value Value (checked when On = on) html_selection(_G2509, _G2510, _G2511) is inert. % menu of Options list html_options(_G2509) is inert. % creates a list of Options, when `Option = on Item' checks Item % Fortran Code: include fort77. (html_fortran(Code) :=
html_goal({switch(hpf_forall, off), fort77 : fort(Code)}))
.
html_hpf(Code) := html_goal({switch(hpf_forall, on),
fort77 : fort(Code)}).