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

Include relative path in name #15

Closed leahciMic closed 11 years ago

leahciMic commented 11 years ago

If includePath is true, this will include the relative path to the source haml in the automatically generated name.

Example: window.HAML['path/to/haml'] = ... # includePath true window.HAML['haml'] = ... # includePath false

mehcode commented 11 years ago

Looks fine to me. Seems like a helpful addition. Good work. :+1:


To be consistent, would target = 'coffee' benefit from this or is there an option in haml-coffee that means the same thing?

leahciMic commented 11 years ago

I've added a wrapHtmlInJs option, which allows html to be put into JS variables as well, matching the style of the global placement. (I should have ideally broken that into a separate PR, let me know if you require that).

I've had a look at haml-coffee and I'm now passing the name to it, it should use this and be consistent.

I'll have to double check this though.

mehcode commented 11 years ago

Merged this all in. Good stuff here. :+1:

Changed wrapHtmlInJs to precompile. Check https://github.com/concordusapps/grunt-haml#precompile


Published as 0.6.0