darioteixeira / lambdoc

Lambdoc is a library providing support for semantically complex documents in Ocsigen web applications
GNU General Public License v2.0
17 stars 1 forks source link

Consider a different way to distinguish class names from named style parameters #33

Open darioteixeira opened 9 years ago

darioteixeira commented 9 years ago

Presently, two different specifications fall under the style parameters umbrella: attaching an arbitrary classname to an element, and configuration using element-specific named parameters of the form key=value. The presence of the equal sign is used to distinguish one from the other.

29 is just one example of why it would be useful if a different mechanism were used to distinguish between the two uses. Two alternatives come to mind:

1) Break apart style parameters into two distinct parameter categories, each with different markers. Unfortunately, we already make use of square, round, angle, and curly brackets, and users will frown upon the adoption of exotic Unicode characters. Digraphs are a way around this conundrum, but suffer from ugliness and should only be adopted as a last resort. Another idea is to use double quotes as markers, though they're not much prettier than digraphs.

2) Keep the two uses of style parameters under the same umbrella, but use something other the equal sign to distinguish between them. One possibility is to require classnames to be quoted or double-quoted.