(index ("informal-rules" 0) ("informal" 278) ("fields" 1030) ("string" 1584) ("password" 1584) ("checkbox" 2056) ("radio" 2617) ("hidden" 3281) ("text" 3504) ("select" 3839) ("submit" 4595))
(def (sig (constant "informal-rules" (id informal-rules))) (p "This constant contains the ruleset which is to be used with " (int-link "sxml-transforms") ". See below for an explanation of the provided rules. This is the only identifier exported by " (tt "sxml-informal") "."))
(def (sig (syntax "(informal options . body)" (id informal))) (p "This is the wrapping rule for all further rules. It creates a " (tt "form") " tag according to the alist " (tt "options") ". The available keys are:") (dl (dt (tt "prefix")) (dd "a string which will be prepended to all of this form's input elements' " (tt "name") " and " (tt "id") " attributes.") (dt (tt "@")) (dd "the SXML attribute list for the resulting form tag, passed verbatim; use this to set the form's " (tt "action") " etc.")) (p "Alternatively " (tt "options") " may be an immediate attribute list if no futher configuration is needed.") (p "The " (tt "body") " should contain the form's input elements (see " (int-link "#input-element-rules" "Input Element Rules") ")."))
(def (sig (syntax "(fields #!optional legend . elements)" (id fields))) (p "This rule should be used inside an " (tt "informal") "'s body to group a set of input " (tt "elements") ". The resulting SXML will wrap them in a " (tt "fieldset") " element, possibly with a " (tt "legend") ". The " (tt "elements") " are then wrapped in an " (tt "ol") " elements, thus " (tt "elements") " must be a list of " (tt "li") " elements. This is sensible because all sxml-informal's input element rules transform into input elements " (tt "li") " wrapped elements."))
(def (sig (procedure "(string name #!key value label error)" (id string)) (procedure "(password name #!key value label error)" (id password))) (p "These rules translate into input elements of the respective types " (tt "text") " or " (tt "password") " wrapped in the element markup described under " (int-link "#input-element-rules" "Input Element Rules") ". The input element expansion is") (pre "   (input (@ (type <type>) (id <name>) (name <name>) (value <value>)))"))
(def (sig (procedure "(checkbox #!key value label error checked)" (id checkbox))) (p "This rule expands into a checkbox input element, followed by its label, wrapped in the element markup described under " (int-link "#input-element-rules" "Input Element Rules") ".  It accepts the following additional keyword arguments:") (dl (dt "checked") (dd "determines whether the checkbox is checked. Default: " (tt "#f"))) (p "The input element expansion is") (pre "   (input (@ (type \"checkbox\") (id <name>) (name <name>) (value <value>) [(checked \"checked\")]))"))
(def (sig (procedure "(radio #!key value suffix label error checked)" (id radio))) (p "This rule expands into a radio button element, followed by its label, wrapped in the element markup described under " (int-link "#input-element-rules" "Input Element Rules") ". It accepts the following additional keyword arguments:") (dl (dt "checked") (dd "determines whether the checkbox is checked. Default: " (tt "#f")) (dt "suffix") (dd "the suffix for this input's " (tt "id") " attribute. Default: " (tt "(conc \"-\" value)"))) (p "The input element expansion is") (pre "   (input (@ (type \"radio\") (id <id>) (name <name>) (value <value>) [(checked \"checked\")]))"))
(def (sig (procedure "(hidden name value)" (id hidden))) (p "This rule expands into a hidden field element without any wrapping like this:") (pre "   (input (@ (type \"hidden\") (id <id>) (name <name>) (value <value>)))"))
(def (sig (procedure "(text name #!key value label error)" (id text))) (p "This rule translates into a " (tt "textarea") " element wrapped in the element markup described under " (int-link "#input-element-rules" "Input Element Rules") ". The textarea element expansion is") (pre "   (textarea (@ (id <name>) (name <name>)) <value>)"))
(def (sig (procedure "(select name #!key options value label error)" (id select))) (p "This rule translates into a " (tt "select") " element wrapped in the element markup described under " (int-link "#input-element-rules" "Input Element Rules") ". It accepts the following additional keyword arguments:") (dl (dt "options") (dd "an alist ((<value> <text>) ...) which is turned into the " (tt "select") "'s " (tt "option") " elements. ") (dt "value") (dd "is used to determine on which " (tt "option") " element the " (tt "selected") " attribute is set by comparing it to the values given in " (tt "options") ".")) (p "The select element expansion is") (pre "   (select (@ (id <name>) (name <name>)) \n    [(option (@ (value <value>)) <text>) ...])\n   "))
(def (sig (procedure "(submit label #!key name)" (id submit))) (p "This rule translates into a submit input element wrapped in the element markup described under " (int-link "#input-element-rules" "Input Element Rules") ". The input element expansion is") (pre "   (input (@ (type \"submit\") (id <name>) (name <name>) (value <label>)))"))
