visionmedia/jade — pull request #1164 by connec (2013-08-11 01:50:42+00:00)
Title: Coffee expressions

I'm very interested in seeing support for CoffeeScript expressions in Jade, and this PR is more-or-less a minimal experimental implementation to gauge interest and reactions.

This will compile things like following as you would expect:

```coffee
- if 1 is 2
= [ 'one', 'thing' ].join ' '
- else
= [ 'an', 'other' ].join ''

- console.log 'huh'

div= 'ok' ; 'not bad'

div= "this #{'is'} pretty #{'cool'}"

- for own k, v of { a: 1, b: 2, c: 3 }
div(class="class_#{k}") Class #{v}

= "hello #{a}" for a in [1, 2, 3]
```

Notably absent at the moment:
- if else/else, as described above
- interpolations

I think a complete implementation of this should define some concept of a code precompiler that gets invoked wherever code can appear (all interpolations, attributes, and code nodes). The default one would just passthrough, a CoffeeScript one would compile with `coffee-script`, etc. This doesn't solve the if/else if/else issue though...