concordusapps / grunt-haml

Process HAML templates to precompiled JavaScript or rendered HTML.
https://npmjs.org/package/grunt-haml
MIT License
41 stars 28 forks source link

Placement: global doesn't seem to be the default anymore #7

Closed paulkoegel closed 11 years ago

paulkoegel commented 11 years ago

using grunt-haml v0.3.1 with readme from "Mon Jan 28 2013 23:23:38."

Docu

Placement Type: string Default: global

which gave me: define(function() {

whereas when adding the placement option with placement: 'global' i got the desired: (function() { var _ref;

if ((_ref = window.HAML) == null) { window.HAML = {}; }

window.HAML

mehcode commented 11 years ago

Good catch. Thanks for letting me know. Fixed and published as v0.3.2.

paulkoegel commented 11 years ago

sure, no problem! thanks so much for this great project. another thing that confused me at first was that this project can create both JS-template-functions as well as HTML files. maybe this could be explained right at the start of the documentation / the repo descriptions. moreover, a more prominent brief example that you can write JS/coffeescript code in your HAML files - no matter what they'll be compiled to - would be helpful. took me a while to find out about all this, there are so many hits for grunt and haml sometimes you get confused about what each project actually does... i'm very happy right now with grunt-haml ;)

mehcode commented 11 years ago

sure, no problem! thanks so much for this great project.

Not at all. We're all just scratching our own itch. This started as just grunt-haml-coffee but it wasn't difficult at all to extend it a bit to support JavaScript so grunt-haml and this one merged.

Just for future reference, searching via http://gruntjs.com/plugins and only two haml plugins show up. This one and another for ruby. I just posted https://github.com/elfsternberg/grunt-ruby-haml/issues/4 so hopefully we'll merge and there will only be one on there.

this project can create both JS-template-functions as well as HTML files. maybe this could be explained right at the start of the documentation / the repo descriptions. moreover, a more prominent brief example that you can write JS/coffeescript code in your HAML files - no matter what they'll be compiled to - would be helpful.

Haha. Yeah. This project allows a lot. You can wrap templates in AMD, inject dependencies into your AMD templates using the dependencies option, write in both javascript and coffeescript, compile to HTML or javascript, etc. There are a handful of more features coming too Livescript and directive support (partials and template inheritance). I really need to get some more examples / call outs up. Thanks for the input.

i'm very happy right now with grunt-haml ;)

Good stuff. Let me know if any problems come up.