Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add LiveScript support #367

Closed
wants to merge 1 commit into from

6 participants

@gkz
gkz commented

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

@tlgreg

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

@remy
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.

@phuu
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
Owner
@phuu
Owner

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

@AliMD AliMD referenced this pull request
Closed

LiveScript (feature request) #628

@clkao

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

@remy
Owner

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

@clkao

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

@clkao

@remy any update on this? ;)

@clkao clkao referenced this pull request
Closed

Livscript support #937

@allouis
Owner

Closed as #937 supersedes this

@allouis 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. @gkz

    add livescript support

    gkz authored
This page is out of date. Refresh to see the latest.
View
1  public/js/editors/panel.js
@@ -8,6 +8,7 @@ var editorModes = {
typescript: 'javascript',
markdown: 'markdown',
coffeescript: 'coffeescript',
+ livescript: 'livescript',
less: 'css',
processing: 'text/x-csrc'
};
View
17 public/js/processors/processor.js
@@ -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);
-};
+};
View
5 public/js/vendor/livescript.js
5 additions, 0 deletions not shown
View
1  views/index.html
@@ -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.