{"action":"created","issue":{"url":"https://api.github.com/repos/eduardolundgren/gulp-soynode/issues/12","repository_url":"https://api.github.com/repos/eduardolundgren/gulp-soynode","labels_url":"https://api.github.com/repos/eduardolundgren/gulp-soynode/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/eduardolundgren/gulp-soynode/issues/12/comments","events_url":"https://api.github.com/repos/eduardolundgren/gulp-soynode/issues/12/events","html_url":"https://github.com/eduardolundgren/gulp-soynode/issues/12","id":184962961,"number":12,"title":"Allow soynode.render parameters to be functions that receive file buffer as argument","user":{"login":"Robert-Frampton","id":2466445,"avatar_url":"https://avatars.githubusercontent.com/u/2466445?v=3","gravatar_id":"","url":"https://api.github.com/users/Robert-Frampton","html_url":"https://github.com/Robert-Frampton","followers_url":"https://api.github.com/users/Robert-Frampton/followers","following_url":"https://api.github.com/users/Robert-Frampton/following{/other_user}","gists_url":"https://api.github.com/users/Robert-Frampton/gists{/gist_id}","starred_url":"https://api.github.com/users/Robert-Frampton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Robert-Frampton/subscriptions","organizations_url":"https://api.github.com/users/Robert-Frampton/orgs","repos_url":"https://api.github.com/users/Robert-Frampton/repos","events_url":"https://api.github.com/users/Robert-Frampton/events{/privacy}","received_events_url":"https://api.github.com/users/Robert-Frampton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-24T21:42:45Z","updated_at":"2016-10-25T00:12:06Z","closed_at":null,"body":"Currently this is how `soynode.render` receives arguments.\r\n\r\n```js\r\n  var rendered = soynode.render(\r\n    namespace + '.soyweb',\r\n    optionsInternal.renderSoyWebContext,\r\n    optionsInternal.renderSoyWebInjectedData,\r\n    optionsSoynode.locales ? optionsSoynode.locales[0] : null\r\n  );\r\n```\r\n\r\nIt would be nice if `renderSoyWebContext` (and possibly the other args) could be a function that receives the `file` buffer as an argument and returns the value. That way you could do something like the following...\r\n\r\n```js\r\nreturn gulp.src('src/**/*.soy', {\r\n\t.pipe(frontMatter())\r\n\t.pipe(soynode({\r\n\t\trenderSoyWeb: true,\r\n\t\trenderSoyWebContext: function(file) {\r\n\t\t\treturn {\r\n\t\t\t\tfrontMatter: file.frontMatter\r\n\t\t\t}\r\n\t\t}\r\n\t}))\r\n\t.pipe(gulp.dest('dist'));\r\n```\r\n\r\nThis is a pattern I've seen with many other [gulp plugins](https://www.npmjs.com/package/gulp-consolidate#data) for templates, and it would nice to use here."},"comment":{"url":"https://api.github.com/repos/eduardolundgren/gulp-soynode/issues/comments/255901099","html_url":"https://github.com/eduardolundgren/gulp-soynode/issues/12#issuecomment-255901099","issue_url":"https://api.github.com/repos/eduardolundgren/gulp-soynode/issues/12","id":255901099,"user":{"login":"eduardolundgren","id":113087,"avatar_url":"https://avatars.githubusercontent.com/u/113087?v=3","gravatar_id":"","url":"https://api.github.com/users/eduardolundgren","html_url":"https://github.com/eduardolundgren","followers_url":"https://api.github.com/users/eduardolundgren/followers","following_url":"https://api.github.com/users/eduardolundgren/following{/other_user}","gists_url":"https://api.github.com/users/eduardolundgren/gists{/gist_id}","starred_url":"https://api.github.com/users/eduardolundgren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduardolundgren/subscriptions","organizations_url":"https://api.github.com/users/eduardolundgren/orgs","repos_url":"https://api.github.com/users/eduardolundgren/repos","events_url":"https://api.github.com/users/eduardolundgren/events{/privacy}","received_events_url":"https://api.github.com/users/eduardolundgren/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T00:12:05Z","updated_at":"2016-10-25T00:12:05Z","body":"/cc @mairatma Could you analyze this request? Sounds fair request."}}
{"actor":{"display_login":"eduardolundgren"}}