1 @code{(require 'html-form)}
5 Returns a string with character substitutions appropriate to
6 send @var{txt} as an @dfn{attribute-value}.
7 @cindex attribute-value
11 Returns a string with character substitutions appropriate to
12 send @var{txt} as an @dfn{plain-text}.
16 @defun html:meta name content
17 Returns a tag of meta-information suitable for passing as the
18 third argument to @code{html:head}. The tag produced is @samp{<META
19 NAME="@var{name}" CONTENT="@var{content}">}. The string or symbol @var{name} can be
20 @samp{author}, @samp{copyright}, @samp{keywords}, @samp{description},
21 @samp{date}, @samp{robots}, @dots{}.
24 @defun html:http-equiv name content
25 Returns a tag of HTTP information suitable for passing as the
26 third argument to @code{html:head}. The tag produced is @samp{<META
27 HTTP-EQUIV="@var{name}" CONTENT="@var{content}">}. The string or symbol @var{name} can be
28 @samp{Expires}, @samp{PICS-Label}, @samp{Content-Type},
29 @samp{Refresh}, @dots{}.
32 @defun html:meta-refresh delay uri
35 @defunx html:meta-refresh delay
37 Returns a tag suitable for passing as the third argument to
38 @code{html:head}. If @var{uri} argument is supplied, then @var{delay} seconds after
39 displaying the page with this tag, Netscape or IE browsers will fetch
40 and display @var{uri}. Otherwise, @var{delay} seconds after displaying the page with
41 this tag, Netscape or IE browsers will fetch and redisplay this page.
44 @defun html:head title backlink tags @dots{}
47 @defunx html:head title backlink
49 @defunx html:head title
51 Returns header string for an HTML page named @var{title}. If @var{backlink} is a string,
52 it is used verbatim between the @samp{H1} tags; otherwise @var{title} is
53 used. If string arguments @var{tags} ... are supplied, then they are
54 included verbatim within the @t{<HEAD>} section.
57 @defun html:body body @dots{}
58 Returns HTML string to end a page.
61 @defun html:pre line1 line @dots{}
62 Returns the strings @var{line1}, @var{lines} as @dfn{PRE}formmated plain text
64 (rendered in fixed-width font). Newlines are inserted between @var{line1},
65 @var{lines}. HTML tags (@samp{<tag>}) within @var{lines} will be visible verbatim.
68 @defun html:comment line1 line @dots{}
69 Returns the strings @var{line1} as HTML comments.
74 @defun html:form method action body @dots{}
75 The symbol @var{method} is either @code{get}, @code{head}, @code{post},
76 @code{put}, or @code{delete}. The strings @var{body} form the body of the
77 form. @code{html:form} returns the HTML @dfn{form}.
81 @defun html:hidden name value
82 Returns HTML string which will cause @var{name}=@var{value} in form.
85 @defun html:checkbox pname default
86 Returns HTML string for check box.
89 @defun html:text pname default size @dots{}
90 Returns HTML string for one-line text box.
93 @defun html:text-area pname default-list
94 Returns HTML string for multi-line text box.
97 @defun html:select pname arity default-list foreign-values
98 Returns HTML string for pull-down menu selector.
101 @defun html:buttons pname arity default-list foreign-values
102 Returns HTML string for any-of selector.
105 @defun form:submit submit-label command
108 @defunx form:submit submit-label
110 The string or symbol @var{submit-label} appears on the button which submits the form.
111 If the optional second argument @var{command} is given, then @code{*command*=@var{command}}
112 and @code{*button*=@var{submit-label}} are set in the query. Otherwise,
113 @code{*command*=@var{submit-label}} is set in the query.
116 @defun form:image submit-label image-src
117 The @var{image-src} appears on the button which submits the form.
121 Returns a string which generates a @dfn{reset} button.
125 @defun form:element pname arity default-list foreign-values
126 Returns a string which generates an INPUT element for the field
127 named @var{pname}. The element appears in the created form with its
128 representation determined by its @var{arity} and domain. For domains which
142 If the foreign-key table has a field named @samp{visible-name}, then
143 the contents of that field are the names visible to the user for
144 those choices. Otherwise, the foreign-key itself is visible.
146 For other types of domains:
162 @defun form:delimited pname doc aliat arity default-list foreign-values
165 Returns a HTML string for a form element embedded in a line of a
166 delimited list. Apply map @code{form:delimited} to the list returned by
167 @code{command->p-specs}.
170 @defun command->p-specs rdb command-table command
173 The symbol @var{command-table} names a command table in the @var{rdb} relational database.
174 The symbol @var{command} names a key in @var{command-table}.
176 @code{command->p-specs} returns a list of lists of @var{pname}, @var{doc}, @var{aliat},
177 @var{arity}, @var{default-list}, and @var{foreign-values}. The
178 returned list has one element for each parameter of command @var{command}.
180 This example demonstrates how to create a HTML-form for the @samp{build}
184 (require (in-vicinity (implementation-vicinity) "build.scm"))
185 (call-with-output-file "buildscm.html"
189 (html:head 'commands)
191 (sprintf #f "<H2>%s:</H2><BLOCKQUOTE>%s</BLOCKQUOTE>\\n"
193 (html:plain ((comtab 'get 'documentation) 'build)))
196 (or "http://localhost:8081/buildscm" "/cgi-bin/build.cgi")
197 (apply html:delimited-list
198 (apply map form:delimited
199 (command->p-specs build '*commands* 'build)))