Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add LiveScript support #367

Closed
wants to merge 1 commit into from

6 participants

George Zahariev Gergely Tarjan Remy Sharp Tom Ashworth Chia-liang Kao Fabien O'Carroll
George Zahariev
gkz commented

Add support for the LiveScript language: http://livescript.net

Gergely Tarjan

:+1: I personally would really like to see LiveScript on jsbin, so hope this gets merged in. :)

Remy Sharp
Owner

I'd actually like to see this as a plugin to jsbin - something that you could load as a user and it would permanently affect jsbin. This way it doesn't mean we're accepting all kinds of preprocessors - but allows for communities to extend jsbin themselves.

The problem is server side - what do we do? If you share a url that's processed using LiveScript - and a user doesn't have the plugin, it won't render.

Hmm...need to think about this...

I know we need some kind of advanced settings control panel - but I've not quite worked out what the ui looks like yet.

Tom Ashworth
Owner

@gkz The first example from http://livescript.net doesn't work when I stick it in jsbin (on your livescript branch). What's up with that?

@remy Since this is mergable, and assuming it works, is there any reason this can't be added with a plugin system something to think about later?

Remy Sharp
Owner
Tom Ashworth
Owner

@remy Understood, but is there a reason it's not going to be merged since a plugin system is a bit far off?

Ali Mihandoost AliMD referenced this pull request
Closed

LiveScript (feature request) #628

Chia-liang Kao

A rebased livescript branch with syntax highlighting support is at https://github.com/clkao/jsbin/tree/livescript

Remy Sharp
Owner

Bit slow here, but does livescript work on the server side - i.e. is there a module that adds to `module.exports?

Chia-liang Kao

yes, it can be required and used in node land as well.

Chia-liang Kao

@remy any update on this? ;)

Chia-liang Kao clkao referenced this pull request
Closed

Livscript support #937

Fabien O'Carroll
Owner

Closed as #937 supersedes this

Fabien O'Carroll allouis closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 9, 2012
  1. George Zahariev

    add livescript support

    gkz authored
This page is out of date. Refresh to see the latest.
1  public/js/editors/panel.js
View
@@ -8,6 +8,7 @@ var editorModes = {
typescript: 'javascript',
markdown: 'markdown',
coffeescript: 'coffeescript',
+ livescript: 'livescript',
less: 'css',
processing: 'text/x-csrc'
};
17 public/js/processors/processor.js
View
@@ -83,7 +83,7 @@ var processors = jsbin.processors = {
coffeescript: function (ready) {
return new Processor(jsbin.static + '/js/vendor/coffee-script.js', function () {
$.getScript(jsbin.static + '/js/vendor/codemirror2/coffeescript.js', ready);
- }, function (source) {
+ }, function (source) {
var renderedCode = '';
try {
renderedCode = CoffeeScript.compile(source, {
@@ -95,6 +95,19 @@ var processors = jsbin.processors = {
return renderedCode;
});
},
+ livescript: function (ready) {
+ return new Processor(jsbin.static + '/js/vendor/livescript.js', ready, function (source) {
+ var renderedCode = '';
+ try {
+ renderedCode = LiveScript.compile(source, {
+ bare: true
+ });
+ } catch (e) {
+ console && console.error(e.message);
+ }
+ return renderedCode;
+ });
+ },
typescript: function (ready) {
return new Processor(jsbin.static + '/js/vendor/typescript.min.js', ready, function (source) {
var noop = function () {};
@@ -257,4 +270,4 @@ processors.set = function (panelId, preprocessor, callback) {
processors.reset = function (panelId) {
processors.set(panelId);
-};
+};
5 public/js/vendor/livescript.js
View
5 additions, 0 deletions not shown
1  views/index.html
View
@@ -213,6 +213,7 @@
<div class="dropdownmenu processorSelector" data-type="javascript">
<a href="#javascript">JavaScript</a>
<a href="#coffeescript">CoffeeScript</a>
+ <a href="#livescript">LiveScript</a>
<a href="#processing">Processing</a>
<a href="#traceur">Traceur</a>
<a href="#typescript">TypeScript</a>
Something went wrong with that request. Please try again.