comparison doc/manual.tex @ 2075:fde864eacd47

Make 'required' and 'autofocus' attributes Boolean; add a syntax extension for parsing their usual HTML syntax
author Adam Chlipala <adam@chlipala.net>
date Sun, 16 Nov 2014 14:02:17 -0500
parents 6be31671911b
children c647f113ba3e
comparison
equal deleted inserted replaced
2074:e48e09a1f583 2075:fde864eacd47
2346 \textrm{XML pieces} & l &::=& \textrm{text} & \textrm{cdata} \\ 2346 \textrm{XML pieces} & l &::=& \textrm{text} & \textrm{cdata} \\
2347 &&& \texttt{<}g\texttt{/>} & \textrm{tag with no children} \\ 2347 &&& \texttt{<}g\texttt{/>} & \textrm{tag with no children} \\
2348 &&& \texttt{<}g\texttt{>}l^*\texttt{</}x\texttt{>} & \textrm{tag with children} \\ 2348 &&& \texttt{<}g\texttt{>}l^*\texttt{</}x\texttt{>} & \textrm{tag with children} \\
2349 &&& \{e\} & \textrm{computed XML fragment} \\ 2349 &&& \{e\} & \textrm{computed XML fragment} \\
2350 &&& \{[e]\} & \textrm{injection of an Ur expression, via the $\mt{Top}.\mt{txt}$ function} \\ 2350 &&& \{[e]\} & \textrm{injection of an Ur expression, via the $\mt{Top}.\mt{txt}$ function} \\
2351 \textrm{Tag} & g &::=& h \; (x = v)^* \\ 2351 \textrm{Tag} & g &::=& h \; (x [= v])^* \\
2352 \textrm{Tag head} & h &::=& x & \textrm{tag name} \\ 2352 \textrm{Tag head} & h &::=& x & \textrm{tag name} \\
2353 &&& h\{c\} & \textrm{constructor parameter} \\ 2353 &&& h\{c\} & \textrm{constructor parameter} \\
2354 \textrm{Attribute value} & v &::=& \ell & \textrm{literal value} \\ 2354 \textrm{Attribute value} & v &::=& \ell & \textrm{literal value} \\
2355 &&& \{e\} & \textrm{computed value} \\ 2355 &&& \{e\} & \textrm{computed value} \\
2356 \end{array}$$ 2356 \end{array}$$
2357
2358 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.
2357 2359
2358 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. 2360 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.
2359 2361
2360 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}. 2362 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}.
2361 2363