I don't want too sound negative, but there are a number of reasons this is a less than feasible idea.
First it's overkill. The reason we have a www at all is because HTML and its variants are dead simple. If the client decides that six key sentences should be yellow and emphasized, I go into my template and add a <span class="yellow"><em>Yellow text!</em></span> to my template.
Using your generator, I now have to figure out a whole new way of doing that.
The second point follows: Any first year web monkey can learn to add spans and em's. It takes a bit more effort to understand python. While this might not matter to someone who understands both, it offers much less flexibility to the already available alternative.
Django's template implementation is very, very good. It fits quite well into your average web shop and even fails silently.
I like your desire to scratch your own itch, but I felt I should answer your question.
Er, or you could do <em class="yellow">Yellow Text!</em>. But that's not even the best. What if he wants to change the color later? <em class="specialEmphasis">Special Text!</em>.
CSS classes should be used sparingly and by purpose: they should describe the function of the element, and not the look of the element.
But that's just semantics ;) (har, har).
ASP.net uses code generated html for a lot of things: server controls, some user controls, and so forth. It can be a pain to override them if the markup they generate is crap (and from my experience, the built-in server controls and many of the 3rd party controls generate crap).
First it's overkill. The reason we have a www at all is because HTML and its variants are dead simple. If the client decides that six key sentences should be yellow and emphasized, I go into my template and add a <span class="yellow"><em>Yellow text!</em></span> to my template.
Using your generator, I now have to figure out a whole new way of doing that.
The second point follows: Any first year web monkey can learn to add spans and em's. It takes a bit more effort to understand python. While this might not matter to someone who understands both, it offers much less flexibility to the already available alternative.
Django's template implementation is very, very good. It fits quite well into your average web shop and even fails silently.
I like your desire to scratch your own itch, but I felt I should answer your question.