summaryrefslogtreecommitdiff
path: root/doc/manual.tex
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-11-16 14:02:17 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2014-11-16 14:02:17 -0500
commit53c8e3791551e84d7c2100df885740be5a4871df (patch)
treead2ce8905273af5770bd7217b18c7bb50be994e7 /doc/manual.tex
parent19b8f524ebd699a5110d6691f269405ef2182749 (diff)
Make 'required' and 'autofocus' attributes Boolean; add a syntax extension for parsing their usual HTML syntax
Diffstat (limited to 'doc/manual.tex')
-rw-r--r--doc/manual.tex4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/manual.tex b/doc/manual.tex
index 0550d081..5935ccbf 100644
--- a/doc/manual.tex
+++ b/doc/manual.tex
@@ -2348,13 +2348,15 @@ $$\begin{array}{rrcll}
&&& \texttt{<}g\texttt{>}l^*\texttt{</}x\texttt{>} & \textrm{tag with children} \\
&&& \{e\} & \textrm{computed XML fragment} \\
&&& \{[e]\} & \textrm{injection of an Ur expression, via the $\mt{Top}.\mt{txt}$ function} \\
- \textrm{Tag} & g &::=& h \; (x = v)^* \\
+ \textrm{Tag} & g &::=& h \; (x [= v])^* \\
\textrm{Tag head} & h &::=& x & \textrm{tag name} \\
&&& h\{c\} & \textrm{constructor parameter} \\
\textrm{Attribute value} & v &::=& \ell & \textrm{literal value} \\
&&& \{e\} & \textrm{computed value} \\
\end{array}$$
+When the optional $= v$ is omitted in an XML attribute, the attribute is assigned value $\mt{True}$ in Ur/Web, and it is rendered to HTML merely as including the attribute name without a value. If such a Boolean attribute is manually set to value $\mt{False}$, then it is omitted altogether in generating HTML.
+
Further, there is a special convenience and compatibility form for setting CSS classes of tags. If a \cd{class} attribute has a value that is a string literal, the literal is parsed in the usual HTML way and replaced with calls to appropriate Ur/Web combinators. Any dashes in the text are replaced with underscores to determine Ur identifiers. The same desugaring can be accessed in a normal expression context by calling the pseudo-function \cd{CLASS} on a string literal.
Similar support is provided for \cd{style} attributes. Normal CSS syntax may be used in string literals that are \cd{style} attribute values, and the desugaring may be accessed elsewhere with the pseudo-function \cd{STYLE}.