Unfortunately, the documentation of CoffeeKup I could find was not very clear on how to perform one of the most basic tasks in creating HTML documents:
How do I assign a class to an element?
And here is the answer:
div class: 'myclass', -> div class: 'nested'
Which will result in the HTML document:
<div class='myclass'> <div class='nested'></div> </div>
Or in more succinct form:
div 'myclass', -> div 'nested', ->
Please note the ‘->’ after the declaration of the class for the second div. Without it, CoffeeKup would render ‘nested’ as text and not as element.