I'm setting up templates for HTML emails, and many of my tables look like this:
table( align='center', border='0', cellpadding='0', cellspacing='0', width='100%' )
To save time and improve readability, I thought it would be sweet if I could write something more like this:
- var tableAttrs = "align='center', border='0', cellpadding='0', cellspacing='0', width='100%'"
table( tableAttrs )
The above outputs tableAttrs="tableAttrs"
, or #{="#{" tableAttrs="tableAttrs" }="}"
if interpolated.
I've also tried a simple mixin which I did not expect to support nesting, and was not disappointed:
mixin table()
table( align='center', border='0', cellpadding='0', cellspacing='0', width='100%' )
+table()
tbody...
If my goal is possible or not possible, I'd love to know!