gabrielflorit / livecoding

livecoding
http://gabrielflorit.github.io/livecoding/
MIT License
176 stars 28 forks source link

Support preprocessors, e.g. jade, sass, coffeescript #106

Open clkao opened 11 years ago

clkao commented 11 years ago

jade and coffeescript compilation can be done in frontend js. sass is probably more tricky.

gabrielflorit commented 11 years ago

Ah yes, that would be useful indeed. Shouldn't be too hard to add. I don't have time to work on this right now, but a good place to start would probably be renderCode in https://github.com/gabrielflorit/livecoding/blob/master/livecoding/static/js/editor/aigua.js#L199 , in case you're interested.

bollwyvl commented 11 years ago

Just tried out integrating CoffeeScript as a separate tab in my fork. Coffee (and the codemirror support) always gets loaded, which is not ideal, and also why I've not made a PR.
At this point, I have enough to do what I wanted to: locally evaluate some d3 stuff I am doing for goodness-of-fit in CoffeeScript. Perhaps this could be used as starting point for the real deal of adding multiple compile-to-(css|js|html) formats, but they way I have done it is not very good.

As you guessed, this was really, really easy. I wired it up to replace the JavaScript source with the compiled source in case you want to pop over and check out the generated JavaScript.

I didn't try doing any of the gist integration in views.py, but that should be humorously short as well.

I guess the challenge in doing compiled source right would be to figure out how to visually offer the user other dialects, with the added option of viewing the generated source.

gabrielflorit commented 11 years ago

Neat, glad you were able to get it working. Agreed - it would be neat to add support for other variations, like TypeScript, LiveScript, etc.

gabrielflorit commented 9 years ago

no longer applicable due to rewrite

bollwyvl commented 9 years ago

Sounds great, looking forward to checking out the rewrite. Would you reconsider accepting PRs for alternate syntaxes? Something like this would offer a lot of bang for the buck, if it could be brought browserside: https://www.npmjs.org/package/transformers On Nov 12, 2014 2:42 AM, "Gabriel Florit" notifications@github.com wrote:

Closed #106 https://github.com/gabrielflorit/livecoding/issues/106.

— Reply to this email directly or view it on GitHub https://github.com/gabrielflorit/livecoding/issues/106#event-191880970.

gabrielflorit commented 9 years ago

Certainly. The previous codebase got too unwieldy, hence the rewrite. I'll reopen the issue and add it to the roadmap.