macro-html.widgets
HTML widget functions. All widgets print to {\*standard-output\*}.
< html‑widget‑document \(Function\)
*Syntax:*
— Function: *html‑widget‑document* _title_ _body_ {&key} _stylesheets_
_scripts_ _feeds_ _encoding_ _viewport_
*Arguments and Values:*
_title_—a _string_.
_body_—a _function designator_ for a _function_ that prints the
document body to {\*standard-output\*}.
_stylesheets_—a _list_ of _stylesheet designators_. A _stylesheet
designator_ is a _property list_ with the keys {:href} and {:media}
reflecting they keys of a {stylesheet} link.
_scripts_—a _list_ of _strings_ designating URIs to Javascript
programs.
_feeds_—a _list_ of _feed designators_. A _feed designator_ is a
_property list_ with the keys {:href}, {:type} and {:title} refecting
the keys of an {alternate} link.
_encoding_—a _keyword_ denoting a character encoding. The default is
{:utf-8}.
_viewport_—a _string_ denoting the value of a {viewport} meta
attribute. the default is {"width=device-width, initial-scale=1"}.
*Description:*
{html-widget-document} produces a complete HTML document including a
{head} section including elements declaring _title_, _stylesheets_,
_scripts_, _feeds_, _encoding_ and _viewport_. The _body_ _function_ is
called to produce the document body.
>
< html‑widget‑form \(Function\)
*Syntax:*
— Function: *html‑widget‑form* _action_ _fields_ {&key} _method_
_description_
*Arguments and Values:*
_action_—a _string_ denoting a _form action_¹.
_fields_—a _function designator_ for a _function_ that prints the
form's inputs to {\*standard-output\*}.
_method_—one of {"GET"} or {"POST"}. The default is {"GET"}.
_description_—a _string_. The default is {"Submit"}.
*Description:*
{html-widget-form} produces a {form} element with _fields_. The
resulting form will be bound to _action_ and use _method_. It will also
contain a submit button labeled with _description_.
*See Also:*
+ 1. [Form
action](http://www.w3.org/TR/html5/forms.html\#attr-fs-action)
>
< html‑widget‑head \(Function\)
*Syntax:*
— Function: *html‑widget‑head* _title_ {&key} _stylesheets_ _scripts_
_feeds_ _encoding_ _viewport_
*Arguments and Values:*
_title_—a _string_.
_stylesheets_—a _list_ of _stylesheet designators_. A _stylesheet
designator_ is a _property list_ with the keys {:href} and {:media}
reflecting they keys of a {stylesheet} link.
_scripts_—a _list_ of _strings_ designating URIs to Javascript
programs.
_feeds_—a _list_ of _feed designators_. A _feed designator_ is a
_property list_ with the keys {:href}, {:type} and {:title} refecting
the keys of an {alternate} link.
_encoding_—a _keyword_ denoting a character encoding. The default is
{:utf-8}.
_viewport_—a _string_ denoting the value of a {viewport} meta
attribute. the default is {"width=device-width, initial-scale=1"}.
*Description:*
{html-widget-head} produces a {head} section including elements
declaring _title_, _stylesheets_, _scripts_, _feeds_, _encoding_ and
_viewport_.
>
< html‑widget‑input \(Function\)
*Syntax:*
— Function: *html‑widget‑input* _name_ _label_ {&optional} _type_
*Arguments and Values:*
_name_, _label_—_strings_.
_type_—a _string_ denoting an _input type_¹. The default is {"text"}.
*Description:*
{html-widget-input} produces an {input} element of _type_ with _name_
preceded by _label_.
*See Also:*
+ [Input type](http://www.w3.org/TR/html5/forms.html\#attr-input-type)
>
< html‑widget‑list \(Function\)
*Syntax:*
— Function: *html‑widget‑list* _list_ {&key} _type_ _to‑string_
*Arguments and Values:*
_list_—a _list_.
_type_—one of {:ordered}, {:unordered} and {:definitions}. The default
is {:unordered}.
_to-string_—a _function designator_. The default is {identity}.
*Description:*
{html-widget-list} produces an ordered, unordered or definition list
containing the items in _list_. _To-string_ is called on list items
before they are included in the list.
If _type_ is {:ordered} or {:unordered} an ordered or unordered list is
produced respectively, containing the elements of _list_.
If _type_ is {:definitions} a definition list is produced. _List_ must
be a _list_ of two-element _lists_, the first and second elements being
definition title and definition description respectively. {To-string}
will be called with two arguments: {:title} or {:description} depending
on the value type and the respective value of the two-element _list_.
>
< html‑widget‑meta \(Function\)
*Syntax:*
— Function: *html‑widget‑meta* {&key} _content‑type_ _encoding_
*Arguments and Values:*
_content-type_—a _string_ denoting a MIME type. The default is
{"text/html"}.
_encoding_—a _keyword_ denoting a character encoding. The default is
{:utf-8}.
*Description:*
{html-widget-meta} produces a {meta} element declaring the
_content-type_ and _encoding_ of a HTML document.
>
< html‑widget‑select \(Function\)
*Syntax:*
— Function: *html‑widget‑select* _name_ _label_ _options_ {&key}
_multiple_
_options_::= {'\(}{\{}↓_option-group_ \| ↓_option_{\}}\*{\)}
_option-group_::= {\(}{:group} _label_ {\{}↓_option_{\}}\*{\)}
_option_::= {\(}_value_ _label_ {\[}{:selected}{\]}{\)}
*Arguments and Values:*
_name_, _label_, _value_—_strings_.
_multiple_—a _generalized boolean_. The default is _false_.
*Description:*
{html-widget-select} produces a {select} element _name_ preceded by
_label_ containing {option} elements as declared in _options_.
_Option-groups_ can be used to produce {optgroup} elements accordingly.
If an _option_ declaration contains {:selected} as its third element,
the resulting {option} element will be selected by default. If
_multiple_ is true, the {select} element will allow for multiple
selections.
>
< html‑widget‑table \(Function\)
*Syntax:*
— Function: *html‑widget‑table* _head_ _body_
*Arguments and Values:*
_head_—a _list_.
_body_—a _list_ of _lists_.
*Description:*
{html-widget-table} produces a {table} element with _head_ as its table
head _body_ as its rows.
>
< html‑widget‑textarea \(Function\)
*Syntax:*
— Function: *html‑widget‑textarea* _name_ _label_ _initial‑text_
*Arguments and Values:*
_name_, _label_, _initial-text_—_strings_.
*Description:*
{html-widget-text-area} produces a {textarea} element with _name_ and
_initial-text_ preceded by _label_.
>
>