commit f641dfd3200137cedbaa77d15ea5b166b35b5e31 Author: Max Rottenkolber Date: Wed Dec 2 23:38:50 2015 +0100 Updates to API documentation of MPC, MACRO-HTML and TEXP. diff --git a/software/macro-html/widgets.mk2 b/software/macro-html/widgets.mk2 index 712eb49..53d2882 100644 --- a/software/macro-html/widgets.mk2 +++ b/software/macro-html/widgets.mk2 @@ -3,11 +3,11 @@ HTML widget functions. All widgets print to {\*standard-output\*}. - < html-widget-document \(Function\) + < html‑widget‑document \(Function\) *Syntax:* - — Function: *html-widget-document* _title_ _body_ {&key} _stylesheets_ + — Function: *html‑widget‑document* _title_ _body_ {&key} _stylesheets_ _scripts_ _feeds_ _encoding_ _viewport_ *Arguments and Values:* @@ -44,11 +44,11 @@ > - < html-widget-form \(Function\) + < html‑widget‑form \(Function\) *Syntax:* - — Function: *html-widget-form* _action_ _fields_ {&key} _method_ + — Function: *html‑widget‑form* _action_ _fields_ {&key} _method_ _description_ *Arguments and Values:* @@ -76,11 +76,11 @@ > - < html-widget-head \(Function\) + < html‑widget‑head \(Function\) *Syntax:* - — Function: *html-widget-head* _title_ {&key} _stylesheets_ _scripts_ + — Function: *html‑widget‑head* _title_ {&key} _stylesheets_ _scripts_ _feeds_ _encoding_ _viewport_ *Arguments and Values:* @@ -113,11 +113,11 @@ > - < html-widget-input \(Function\) + < html‑widget‑input \(Function\) *Syntax:* - — Function: *html-widget-input* _name_ _label_ {&optional} _type_ + — Function: *html‑widget‑input* _name_ _label_ {&optional} _type_ *Arguments and Values:* @@ -137,11 +137,11 @@ > - < html-widget-list \(Function\) + < html‑widget‑list \(Function\) *Syntax:* - — Function: *html-widget-list* _list_ {&key} _type_ _to-string_ + — Function: *html‑widget‑list* _list_ {&key} _type_ _to‑string_ *Arguments and Values:* @@ -170,11 +170,11 @@ > - < html-widget-meta \(Function\) + < html‑widget‑meta \(Function\) *Syntax:* - — Function: *html-widget-meta* {&key} _content-type_ _encoding_ + — Function: *html‑widget‑meta* {&key} _content‑type_ _encoding_ *Arguments and Values:* @@ -192,18 +192,18 @@ > - < html-widget-select \(Function\) + < html‑widget‑select \(Function\) *Syntax:* - — Function: *html-widget-select* _name_ _label_ _options_ {&key} + — Function: *html‑widget‑select* _name_ _label_ _options_ {&key} _multiple_ - _options_::= {'\(}〚↓_option-group_\* \| ↓_option_\*〛{\)} + _options_::= {'\(}{\{}↓_option-group_ \| ↓_option_{\}}\*{\)} - _option-group_::= {\(}{:group} _label_ 〚↓_option_\*〛{\)} + _option-group_::= {\(}{:group} _label_ {\{}↓_option_{\}}\*{\)} - _option_::= {\(}_value_ _label_ 〚{:selected}〛{\)} + _option_::= {\(}_value_ _label_ {\[}{:selected}{\]}{\)} *Arguments and Values:* @@ -224,11 +224,11 @@ > - < html-widget-table \(Function\) + < html‑widget‑table \(Function\) *Syntax:* - — Function: *html-widget-table* _head_ _body_ + — Function: *html‑widget‑table* _head_ _body_ *Arguments and Values:* @@ -244,11 +244,11 @@ > - < html-widget-textarea \(Function\) + < html‑widget‑textarea \(Function\) *Syntax:* - — Function: *html-widget-textarea* _name_ _label_ _initial-text_ + — Function: *html‑widget‑textarea* _name_ _label_ _initial‑text_ *Arguments and Values:* commit 3cfc34b21cfd6aae4e723628d42210cc2242bc7d Author: Max Rottenkolber Date: Tue Jul 28 01:43:35 2015 +0200 Update software/macro-html/widgets.mk2. diff --git a/software/macro-html/widgets.mk2 b/software/macro-html/widgets.mk2 index 9a0f26b..712eb49 100644 --- a/software/macro-html/widgets.mk2 +++ b/software/macro-html/widgets.mk2 @@ -8,7 +8,7 @@ *Syntax:* — Function: *html-widget-document* _title_ _body_ {&key} _stylesheets_ - _scripts_ _feeds_ _encoding_ + _scripts_ _feeds_ _encoding_ _viewport_ *Arguments and Values:* @@ -19,23 +19,27 @@ _stylesheets_—a _list_ of _stylesheet designators_. A _stylesheet designator_ is a _property list_ with the keys {:href} and {:media} - reflecting the attributes of a {style} element. + reflecting they keys of a {stylesheet} link. _scripts_—a _list_ of _strings_ designating URIs to Javascript programs. - _feeds_—a _list_ of _strings_ designating URIs to syndication feeds - \(e.g. RSS or Atom\). + _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_ and an _encoding_. The _body_ _function_ is called - to produce the document body. + _scripts_, _feeds_, _encoding_ and _viewport_. The _body_ _function_ is + called to produce the document body. > @@ -77,7 +81,7 @@ *Syntax:* — Function: *html-widget-head* _title_ {&key} _stylesheets_ _scripts_ - _feeds_ _encoding_ + _feeds_ _encoding_ _viewport_ *Arguments and Values:* @@ -85,21 +89,26 @@ _stylesheets_—a _list_ of _stylesheet designators_. A _stylesheet designator_ is a _property list_ with the keys {:href} and {:media} - reflecting the attributes of a {style} element. + reflecting they keys of a {stylesheet} link. _scripts_—a _list_ of _strings_ designating URIs to Javascript programs. - _feeds_—a _list_ of _strings_ designating URIs to syndication feeds - \(e.g. RSS or Atom\). + _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_ and an _encoding_. + declaring _title_, _stylesheets_, _scripts_, _feeds_, _encoding_ and + _viewport_. > commit e264f0a8f74f97d565e4750ff52b02be4165a5c0 Author: Max Rottenkolber Date: Sun Jul 26 22:13:58 2015 +0200 Fix ill-formatted sections in software/macro-html/widgets.mk2 diff --git a/software/macro-html/widgets.mk2 b/software/macro-html/widgets.mk2 index 355e34e..9a0f26b 100644 --- a/software/macro-html/widgets.mk2 +++ b/software/macro-html/widgets.mk2 @@ -209,7 +209,7 @@ _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 + _multiple_ is true, the {select} element will allow for multiple selections. > @@ -225,9 +225,12 @@ _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. + _body_—a _list_ of _lists_. + + *Description:* + + {html-widget-table} produces a {table} element with _head_ as its table + head _body_ as its rows. > commit cf190a67e30b88fc7d827c2607ed3292d723afa4 Author: Max Rottenkolber Date: Sun Jul 26 20:44:03 2015 +0200 Add macro-html documentation. diff --git a/software/macro-html/widgets.mk2 b/software/macro-html/widgets.mk2 new file mode 100644 index 0000000..355e34e --- /dev/null +++ b/software/macro-html/widgets.mk2 @@ -0,0 +1,253 @@ +< 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_ + + *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 the attributes of a {style} element. + + _scripts_—a _list_ of _strings_ designating URIs to Javascript + programs. + + _feeds_—a _list_ of _strings_ designating URIs to syndication feeds + \(e.g. RSS or Atom\). + + _encoding_—a _keyword_ denoting a character encoding. The default is + {:utf-8}. + + *Description:* + + {html-widget-document} produces a complete HTML document including a + {head} section including elements declaring _title_, _stylesheets_, + _scripts_, _feeds_ and an _encoding_. 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_ + + *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 the attributes of a {style} element. + + _scripts_—a _list_ of _strings_ designating URIs to Javascript + programs. + + _feeds_—a _list_ of _strings_ designating URIs to syndication feeds + \(e.g. RSS or Atom\). + + _encoding_—a _keyword_ denoting a character encoding. The default is + {:utf-8}. + + *Description:* + + {html-widget-head} produces a {head} section including elements + declaring _title_, _stylesheets_, _scripts_, _feeds_ and an _encoding_. + + > + + + < 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_. + + > + +> +