I am working on a simple DSL that solves this general problem. It was called htmlgen and is hosted on Github.
I just clicked 2.x with some significant improvements.
Here is an example
use function htmlgen\html as h;
h('
h('h1.title', 'Hello, World'),
h('p',
h('comment', 'link to project'),
h('a', ['href'=>'https://github.com/naomik/htmlgen'], 'See htmlgen on Github')
)
);
Here's the conclusion (the actual output has no spaces)
<div id="wrapper">
<h1 class="title">Hello, World</h1>
<p>
<a href="https://github.com/naomik/htmlgen">See htmlgen on Github</a>
</p>
</div>
, ~ 200 , . .