Skip to content
Browse files

docs for CoffeeScript 0.5.2, which is now out.

  • Loading branch information...
1 parent 22674bc commit 05d95acfc3056e7bf8a1cf83cafe8cdeb2cd1b32 @jashkenas jashkenas committed
Showing with 86 additions and 8 deletions.
  1. +41 −2 documentation/index.html.erb
  2. +1 −1 extras/coffee-script.js
  3. +41 −2 index.html
  4. +1 −1 lib/coffee-script.js
  5. +1 −1 package.json
  6. +1 −1 src/coffee-script.coffee
View
43 documentation/index.html.erb
@@ -60,6 +60,7 @@
<a href="#comparisons">Chained Comparisons</a>
<a href="#strings">Multiline Strings and Heredocs</a>
<a href="#cake">Cake, and Cakefiles</a>
+ <a href="#scripts">"text/coffeescript" Script Tags</a>
<a href="#resources">Resources</a>
<a href="#change_log">Change Log</a>
</div>
@@ -107,7 +108,7 @@ alert reverse '!tpircseeffoC'</textarea>
<p>
<b>Latest Version:</b>
- <a href="http://github.com/jashkenas/coffee-script/tarball/0.5.1">0.5.1</a>
+ <a href="http://github.com/jashkenas/coffee-script/tarball/0.5.2">0.5.2</a>
</p>
<h2>
@@ -152,7 +153,7 @@ alert reverse '!tpircseeffoC'</textarea>
<a href="http://nodejs.org/">Node.js</a>, 0.1.30 or higher. Then clone the CoffeeScript
<a href="http://github.com/jashkenas/coffee-script">source repository</a>
from GitHub, or download the latest
- release: <a href="http://github.com/jashkenas/coffee-script/tarball/0.5.1">0.5.1</a>.
+ release: <a href="http://github.com/jashkenas/coffee-script/tarball/0.5.2">0.5.2</a>.
To install the CoffeeScript compiler system-wide
under <tt>/usr/local</tt>, open the directory and run:
</p>
@@ -726,6 +727,34 @@ coffee --print app/scripts/*.coffee > concatenation.js</pre>
<%= code_for('cake_tasks') %>
<h2>
+ <span id="scripts" class="bookmark"></span>
+ "text/coffeescript" Script Tags
+ </h2>
+
+ <p>
+ While it's not recommended for serious use, CoffeeScripts may be included
+ directly within the browser using <tt>&lt;script type="text/coffeescript"&gt;</tt>
+ tags. The codebase includes a compressed and minified version of the compiler
+ (<a href="extras/coffee-script.js">Download current version here, 43k when gzipped</a>).
+ Include <tt>coffee-script.js</tt> on the page <b>after</b> any <tt>text/coffeescript</tt> tags
+ with inline CoffeeScript, and it will compile and evaluate them in order.
+ </p>
+
+ <p>
+ In fact, the little bit of glue script that runs "Try CoffeeScript" above,
+ as well as jQuery for the menu, is implemented in just this way.
+ View source and look at the bottom of the page to see the example.
+ Including the script also gives you access to <tt>CoffeeScript.compile()</tt>
+ so you can pop open Firebug and try compiling some strings.
+ </p>
+
+ <p>
+ The usual caveats about CoffeeScript apply &mdash; your inline scripts will
+ run within a closure wrapper, so if you want to expose global variables or
+ functions, attach them to the <tt>window</tt> object.
+ </p>
+
+ <h2>
<span id="resources" class="bookmark"></span>
Resources
</h2>
@@ -752,6 +781,15 @@ coffee --print app/scripts/*.coffee > concatenation.js</pre>
<span id="change_log" class="bookmark"></span>
Change Log
</h2>
+
+ <p>
+ <b class="header" style="margin-top: 20px;">0.5.2</b>
+ Added a compressed version of the compiler for inclusion in web pages as
+ <br /><tt>extras/coffee-script.js</tt>. It'll automatically run any script tags
+ with type <tt>text/coffeescript</tt> for you. Added a <tt>--stdio</tt> option
+ to the <tt>coffee</tt> command, for piped-in compiles.
+ </p>
+
<p>
<b class="header" style="margin-top: 20px;">0.5.1</b>
@@ -954,6 +992,7 @@ coffee --print app/scripts/*.coffee > concatenation.js</pre>
false
$(document.body).click -> close_menus()
+
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
View
2 extras/coffee-script.js
1 addition, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
View
43 index.html
@@ -46,6 +46,7 @@
<a href="#comparisons">Chained Comparisons</a>
<a href="#strings">Multiline Strings and Heredocs</a>
<a href="#cake">Cake, and Cakefiles</a>
+ <a href="#scripts">"text/coffeescript" Script Tags</a>
<a href="#resources">Resources</a>
<a href="#change_log">Change Log</a>
</div>
@@ -93,7 +94,7 @@
<p>
<b>Latest Version:</b>
- <a href="http://github.com/jashkenas/coffee-script/tarball/0.5.1">0.5.1</a>
+ <a href="http://github.com/jashkenas/coffee-script/tarball/0.5.2">0.5.2</a>
</p>
<h2>
@@ -249,7 +250,7 @@
<a href="http://nodejs.org/">Node.js</a>, 0.1.30 or higher. Then clone the CoffeeScript
<a href="http://github.com/jashkenas/coffee-script">source repository</a>
from GitHub, or download the latest
- release: <a href="http://github.com/jashkenas/coffee-script/tarball/0.5.1">0.5.1</a>.
+ release: <a href="http://github.com/jashkenas/coffee-script/tarball/0.5.2">0.5.2</a>.
To install the CoffeeScript compiler system-wide
under <tt>/usr/local</tt>, open the directory and run:
</p>
@@ -1606,6 +1607,34 @@
</pre><br class='clear' /></div>
<h2>
+ <span id="scripts" class="bookmark"></span>
+ "text/coffeescript" Script Tags
+ </h2>
+
+ <p>
+ While it's not recommended for serious use, CoffeeScripts may be included
+ directly within the browser using <tt>&lt;script type="text/coffeescript"&gt;</tt>
+ tags. The codebase includes a compressed and minified version of the compiler
+ (<a href="extras/coffee-script.js">Download current version here, 43k when gzipped</a>).
+ Include <tt>coffee-script.js</tt> on the page <b>after</b> any <tt>text/coffeescript</tt> tags
+ with inline CoffeeScript, and it will compile and evaluate them in order.
+ </p>
+
+ <p>
+ In fact, the little bit of glue script that runs "Try CoffeeScript" above,
+ as well as jQuery for the menu, is implemented in just this way.
+ View source and look at the bottom of the page to see the example.
+ Including the script also gives you access to <tt>CoffeeScript.compile()</tt>
+ so you can pop open Firebug and try compiling some strings.
+ </p>
+
+ <p>
+ The usual caveats about CoffeeScript apply &mdash; your inline scripts will
+ run within a closure wrapper, so if you want to expose global variables or
+ functions, attach them to the <tt>window</tt> object.
+ </p>
+
+ <h2>
<span id="resources" class="bookmark"></span>
Resources
</h2>
@@ -1632,6 +1661,15 @@
<span id="change_log" class="bookmark"></span>
Change Log
</h2>
+
+ <p>
+ <b class="header" style="margin-top: 20px;">0.5.2</b>
+ Added a compressed version of the compiler for inclusion in web pages as
+ <br /><tt>extras/coffee-script.js</tt>. It'll automatically run any script tags
+ with type <tt>text/coffeescript</tt> for you. Added a <tt>--stdio</tt> option
+ to the <tt>coffee</tt> command, for piped-in compiles.
+ </p>
+
<p>
<b class="header" style="margin-top: 20px;">0.5.1</b>
@@ -1834,6 +1872,7 @@
false
$(document.body).click -> close_menus()
+
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
View
2 lib/coffee-script.js
@@ -32,7 +32,7 @@
return this.pos;
}
};
- exports.VERSION = '0.5.1';
+ exports.VERSION = '0.5.2';
// Compile CoffeeScript to JavaScript, using the Coffee/Jison compiler.
exports.compile = function compile(code, options) {
return (parser.parse(lexer.tokenize(code))).compile(options);
View
2 package.json
@@ -3,5 +3,5 @@
"description": "Unfancy JavaScript",
"keywords": ["javascript", "language"],
"author": "Jeremy Ashkenas",
- "version": "0.5.1"
+ "version": "0.5.2"
}
View
2 src/coffee-script.coffee
@@ -24,7 +24,7 @@ parser.lexer: {
showPosition: -> @pos
}
-exports.VERSION: '0.5.1'
+exports.VERSION: '0.5.2'
# Compile CoffeeScript to JavaScript, using the Coffee/Jison compiler.
exports.compile: (code, options) ->

0 comments on commit 05d95ac

Please sign in to comment.
Something went wrong with that request. Please try again.