{"action":"created","issue":{"url":"https://api.github.com/repos/ractivejs/ractive/issues/2226","labels_url":"https://api.github.com/repos/ractivejs/ractive/issues/2226/labels{/name}","comments_url":"https://api.github.com/repos/ractivejs/ractive/issues/2226/comments","events_url":"https://api.github.com/repos/ractivejs/ractive/issues/2226/events","html_url":"https://github.com/ractivejs/ractive/issues/2226","id":111931273,"number":2226,"title":"Support for LiveScript (and other languages) in templates?","user":{"login":"ceremcem","id":6639874,"avatar_url":"https://avatars.githubusercontent.com/u/6639874?v=3","gravatar_id":"","url":"https://api.github.com/users/ceremcem","html_url":"https://github.com/ceremcem","followers_url":"https://api.github.com/users/ceremcem/followers","following_url":"https://api.github.com/users/ceremcem/following{/other_user}","gists_url":"https://api.github.com/users/ceremcem/gists{/gist_id}","starred_url":"https://api.github.com/users/ceremcem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceremcem/subscriptions","organizations_url":"https://api.github.com/users/ceremcem/orgs","repos_url":"https://api.github.com/users/ceremcem/repos","events_url":"https://api.github.com/users/ceremcem/events{/privacy}","received_events_url":"https://api.github.com/users/ceremcem/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ractivejs/ractive/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-16T23:53:56Z","updated_at":"2015-10-17T01:42:12Z","closed_at":null,"body":"[LiveScript](http://livescript.net) is a functional language that's compiled into Javascript with a compiler that is written in Javascript (like Coffee Script). \r\n\r\nLiveScript has a lot of way to get the code shorter and readable. If we have an option to use LiveScript code in Ractive templates, it would be much easier to get the work done and the codebase would be consistent across templates and other javascript* codes for LiveScript users. \r\n\r\nI had an attempt to get the code compiled into Javascript before evaluating in Ractive, but I had no success. If it's easy for you, I'm asking for LiveScript support. Else, I'll try again to get it done whenever I could. "},"comment":{"url":"https://api.github.com/repos/ractivejs/ractive/issues/comments/148875282","html_url":"https://github.com/ractivejs/ractive/issues/2226#issuecomment-148875282","issue_url":"https://api.github.com/repos/ractivejs/ractive/issues/2226","id":148875282,"user":{"login":"fskreuz","id":1582932,"avatar_url":"https://avatars.githubusercontent.com/u/1582932?v=3","gravatar_id":"","url":"https://api.github.com/users/fskreuz","html_url":"https://github.com/fskreuz","followers_url":"https://api.github.com/users/fskreuz/followers","following_url":"https://api.github.com/users/fskreuz/following{/other_user}","gists_url":"https://api.github.com/users/fskreuz/gists{/gist_id}","starred_url":"https://api.github.com/users/fskreuz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fskreuz/subscriptions","organizations_url":"https://api.github.com/users/fskreuz/orgs","repos_url":"https://api.github.com/users/fskreuz/repos","events_url":"https://api.github.com/users/fskreuz/events{/privacy}","received_events_url":"https://api.github.com/users/fskreuz/received_events","type":"User","site_admin":false},"created_at":"2015-10-17T01:42:12Z","updated_at":"2015-10-17T01:42:12Z","body":"Yeah, I think that's not possible. However...\r\n\r\nYou can use a [computed property](http://docs.ractivejs.org/latest/computed-properties) for the `{{# each }}`. For the ternary, you can offload that logic to a data function. Since both are now in the script realm, you can easily write the script portion in another language, and have a tool or loader to compile it.\r\n\r\n```\r\n{{#each notMonkey }}\r\n    <p style=\"background-color: {{ isIn(foo, 'cat') }}\">hello .bar</p>\r\n{{/each}}\r\n\r\n// You can write this in another language\r\ncomponent.exports = {\r\n  ...\r\n  data: {\r\n    isIn: function(array, string){ ... }\r\n  },\r\n  computed: {\r\n    notMonkey: function(){\r\n      return this.get('animals').filter(function(animal){\r\n        return isNot('monkey', animal);\r\n      });\r\n    }\r\n  }\r\n  ...\r\n}\r\n```"}}