Closed khaliddermoumi closed 8 years ago
would you be interested in creating a PR to add support for this?
Hi! I have played around a bit and figured out it isn't really difficult getting this done with the existing code, by using a programmatic approach. Like this:
npm install yamljs // add --save-dev or --save
(...)
var yaml = require('yamljs');
var templateData = yaml.load('./template-data.yml');
(...)
'compile-handlebars': {
mytarget: {
files: [{
....
}],
templateData: templateData
}
}
It may still be nice to have YAML support out of the box, would save the coding. YAML is great because then you can comment your data, comment out unused stuff you don't want to delete, and generally the handling of strings is better, plus you get a lot of other extra features. What do you think?
I'd be happy to review a PR adding support for this, but since I don't use yaml, and we are using alce for parsing, which supports comments in JSON, I don't have a lot of incentive to create this myself.
lemme know if you want to PR it!
Well I think let's see if someone else is interested. If many people wait for this to happen, it may be worthwhile. Otherwise just close this issue.
I don't think many folks would go aroudn to find this issue just to plus one it. It should be fairly trivial to add (if input file ends in .yml or something, convert to JSON via parser, then continue as needed)
So, if y'all wanna add it, sweet. i'll merge. I'll close this out until then, though
This is a feature request.
It would be very nice to have YAML support for template data, not just JSON, because JSON is very poor for document-like data (data with human readable texts in it f. e.). YAML is far better for this, XML would be another alternative that beats JSON in this respect.
Anyway, thx for this good tool!