I have an object of mixed type properties - some strings, some arrays of strings, some objects containing arrays of strings - that can potentially go many levels deep.
I
It's been a while since you asked, but mixin
is your friend, I think. I haven't tried it out, but if mixins support recursion, this should work:
mixin parseObject(obj)
div
- each val, key in obj
- if (typeof val === 'string')
span #{val}
- else if (typeof val === 'object')
mixin parseObject(val)
Then in the body of your .jade file, call mixin parseObject(rootObject)
.