Closed DylanPiercey closed 8 years ago
Thanks for the feedback. Jade style templates are on my roadmap and the more people who request them the more of a priority it becomes.
Much like with Haml, the Jade support will be a subset of the full Jade language so if there are any code examples of Jade features you definitely need add them to the issue. I'll update this issue with progress as it happens, but not sure how soon it can be "done".
Similar to haml it would be nice to have jades "each" and perhaps the inline if/else. However I'd be perfectly content to write the template in unberfered code ie: - for elem in list.
Currently I can't get my jade templates to use unbuffered coffeescript but if this was possible it would be a great starting point.
I may look through the runtime / compiler later today to see if there is any way I can help.
One place to start may be https://github.com/inductor-labs/hamlet-parser/blob/master/source/haml.jisonlex
And creating a jade lexer that returns the same tokens. Let me know if you have any trouble and I'll try and update docs to make it easier for contributors.
Thanks for the resource. Can't say I've ever looked at a lexer before, but I will try to learn as much as I can to eventually help with this. Unfortunately I'm swamped until September but do you have any resources I can look at to learn more about jison and such? I feel like a jade implementation will greatly increase the popularity of the project.
This has been in since a while ago, sorry I haven't updated the issue! We're actually using the jade syntax in production on some projects so I think it should be pretty good now.
If you have a templates
folder with .jade
files in it, then this command will compile them:
./node_modules/.bin/hamlet -d templates -r "require('hamlet.coffee')"
I love hamlet and have been using it in some little demo's lately and it's integration with coffee-script is top-notch.
However I feel like you could reach a broader audience if you also supported jade templates. Many nodejs developers use jade templates, and I for one even compile jade templates for static sites. I'd love to use hamlet in production however it'd be hard to switch my codebase from jade.