I am beginning to think that while HAML and hamlet have the right idea, the actual hamlet syntax is more noisy than is required. In particular, I would much rather have white space (and quotes where needed) than exclamation marks. Here is one possible alternative: https://github.com/stonean/slim
I actually think the ideal syntax would allow compatibility with existing html- this has always been the main weakness of these newer systems. And especially until a proper converter is built, this will always be a point of pain. Compatibility would also help remove part of the criticism that Yesod is off in its own little world.
Instead of '%body' why not '<body'. A closing angle bracket is allowed for the tag- '<body>'. The 'attribute="name"' style would be kept although the quotes are optional- '<body class=page1', or '<body class="page1">' would also be acceptable for compatibility and closing over white space. Of course, the id and class shortcuts would be available- '<body.page1'
Content on the same line would use a closing angle bracket- '<body class=page1>content
If the previous tag has no inner text on its line and the next indented line does not start with a '#', '<', or '.' then it is the inner text of the previous tag.
<body.page1
text
#id.class
Alternatively, a div with a class or id could still require the opening angle bracket- '<#id.class'
<body.page1
text
<#id.class
And the advantage is that it looks much more similar to html, and has easier compatibility. Given
<body class="page1">
text
<div id="id" class="class"></div>
</body>
The only thing that needs be done for the html to be parsed is consistent indentation and removal of closing tags. However, for the div above it would be possible to even keep the closing tag. It is up to the developer whether to spend the time to compact things even more once the html can be parsed.
The other syntax that I like is removing the opening angle bracket and requiring an '=' to denote where text is- the main problem is that this is a divergence from normal html, and working in html compatibility would be more complex.
body.page1
= text
#id.clas