{"action":"created","issue":{"url":"https://api.github.com/repos/riot/compiler/issues/14","labels_url":"https://api.github.com/repos/riot/compiler/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/riot/compiler/issues/14/comments","events_url":"https://api.github.com/repos/riot/compiler/issues/14/events","html_url":"https://github.com/riot/compiler/issues/14","id":115086207,"number":14,"title":"Give access to riot.compiler(tag,true) unpacked results","user":{"login":"nippur72","id":2598443,"avatar_url":"https://avatars.githubusercontent.com/u/2598443?v=3","gravatar_id":"","url":"https://api.github.com/users/nippur72","html_url":"https://github.com/nippur72","followers_url":"https://api.github.com/users/nippur72/followers","following_url":"https://api.github.com/users/nippur72/following{/other_user}","gists_url":"https://api.github.com/users/nippur72/gists{/gist_id}","starred_url":"https://api.github.com/users/nippur72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nippur72/subscriptions","organizations_url":"https://api.github.com/users/nippur72/orgs","repos_url":"https://api.github.com/users/nippur72/repos","events_url":"https://api.github.com/users/nippur72/events{/privacy}","received_events_url":"https://api.github.com/users/nippur72/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-04T16:01:44Z","updated_at":"2015-11-20T17:22:42Z","closed_at":null,"body":"It was discussed [here](https://github.com/riot/riot/issues/1097) and also [here](https://github.com/riot/riot/issues/1273).\r\n\r\nIn brief, there is need for a `riot.compile()` function that compiles HTML-only templates (no code) and that returns the result of the compilation in a manageable format.\r\n\r\nThis is to support the scenario of template files separated from code (opposed to .tag files) as some of us are doing for ES6 / TypeScript (see [RiotTS](https://github.com/nippur72/RiotTS)).\r\n\r\nCurrently we use an hack to extract the results from `riot.compile(tag,true)`, but it would be nice if there was a specific compiler API method.\r\n\r\nThe current hack is this:\r\n```javascript\r\nvar compiled = riot.compile(template,true);\r\nvar r = compiled.indexOf(\"riot.tag(\");\r\nvar stripped = compiled.substr(r+9);\r\nvar x = stripped.lastIndexOf(\", function(opts) {\");\r\nstripped = stripped.substr(0,x);\r\nvar compiledResultArray = eval(\"[\"+stripped+\"]\");\r\n```"},"comment":{"url":"https://api.github.com/repos/riot/compiler/issues/comments/158465223","html_url":"https://github.com/riot/compiler/issues/14#issuecomment-158465223","issue_url":"https://api.github.com/repos/riot/compiler/issues/14","id":158465223,"user":{"login":"nippur72","id":2598443,"avatar_url":"https://avatars.githubusercontent.com/u/2598443?v=3","gravatar_id":"","url":"https://api.github.com/users/nippur72","html_url":"https://github.com/nippur72","followers_url":"https://api.github.com/users/nippur72/followers","following_url":"https://api.github.com/users/nippur72/following{/other_user}","gists_url":"https://api.github.com/users/nippur72/gists{/gist_id}","starred_url":"https://api.github.com/users/nippur72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nippur72/subscriptions","organizations_url":"https://api.github.com/users/nippur72/orgs","repos_url":"https://api.github.com/users/nippur72/repos","events_url":"https://api.github.com/users/nippur72/events{/privacy}","received_events_url":"https://api.github.com/users/nippur72/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T17:22:42Z","updated_at":"2015-11-20T17:22:42Z","body":":+1: fantastic"}}