Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor typo in Rakefile. #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions coffeescript/06_applications.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h2>Stitch it up</h2>
express = require("express")
argv = process.argv.slice(2)

package = stitch.createPackage(
pckg = stitch.createPackage(
# Specify the paths you want Stitch to automatically bundle up
paths: [ __dirname + "/app" ]

Expand All @@ -102,7 +102,7 @@ <h2>Stitch it up</h2>
app.set "views", __dirname + "/views"
app.use app.router
app.use express.static(__dirname + "/public")
app.get "/application.js", package.createServer()
app.get "/application.js", pckg.createServer()

port = argv[0] or process.env.PORT or 9294
console.log "Starting server on port: #{port}"
Expand Down
4 changes: 2 additions & 2 deletions coffeescript/07_the_bad_parts.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h2>Global variables</h2>
})();
</code></pre>

<p>Notice how CoffeeScript initializes variables (using <code>var</code>) automatically in the context their first used. Whilst it's impossible to shadow outer variables, you can still refer to and access them. You need to watch out for this, be careful that you're not reusing the name of an external variable accidentally if you're writing a deeply nested function or class. For example, here we're accidentally overwriting the <code>package</code> variable in a Class function:</p>
<p>Notice how CoffeeScript initializes variables (using <code>var</code>) automatically in the context they're first used. Whilst it's impossible to shadow outer variables, you can still refer to and access them. You need to watch out for this, be careful that you're not reusing the name of an external variable accidentally if you're writing a deeply nested function or class. For example, here we're accidentally overwriting the <code>package</code> variable in a Class function:</p>

<p><span class="csscript"></span></p>

Expand Down Expand Up @@ -491,7 +491,7 @@ <h3>Strict mode usage</h3>
class window.Spine
</code></pre>

<p>Whilst I recommend enabling strict mode, but it's worth noting that script mode doesn't enable any new features that aren't ready possible in JavaScript, and will actually slow down your code a bit by having the VM do more checks at runtime. You may want to develop with strict mode, and deploy to production without it.</p>
<p>Whilst I recommend enabling strict mode, but it's worth noting that strict mode doesn't enable any new features that aren't ready possible in JavaScript, and will actually slow down your code a bit by having the VM do more checks at runtime. You may want to develop with strict mode, and deploy to production without it.</p>

<h2>JavaScript Lint</h2>

Expand Down
4 changes: 2 additions & 2 deletions coffeescript/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require "fileutils"
def generate(page, template = "site/page.ms")
Mustache.render(
File.read(template),
page.merge(:content => RDiscount.new(File.read(page[:src])).to_html),
page.merge(:content => RDiscount.new(File.read(page[:src])).to_html)
)
end

Expand Down Expand Up @@ -41,4 +41,4 @@ task :generate do
end
end

task :default => :generate
task :default => :generate
10 changes: 5 additions & 5 deletions coffeescript/all.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h2>Initial setup</h2>

<p>One of the easiest ways to initially play around with the library is to use it right inside the browser. Navigate to <a href="http://coffeescript.org">http://coffeescript.org</a> and click on the <em>Try CoffeeScript</em> tab. The site uses a browser version of the CoffeeScript compiler, converting any CoffeeScript typed inside the left panel to JavaScript in the right panel.</p>

<p>You can also convert JavaScript back to CoffeeScript using the <a href="http://js2coffee.org/">js2coffee</a> project, especially useful when migration JavaScript projects to CoffeeScript.</p>
<p>You can also convert JavaScript back to CoffeeScript using the <a href="http://js2coffee.org/">js2coffee</a> project, especially useful when migrating JavaScript projects to CoffeeScript.</p>

<p>In fact, you can use the browser-based CoffeeScript compiler yourself, by including <a href="http://jashkenas.github.com/coffee-script/extras/coffee-script.js">this script</a> in a page, marking up any CoffeeScript script tags with the correct <code>type</code>.</p>

Expand Down Expand Up @@ -1252,7 +1252,7 @@ <h2>Stitch it up</h2>
express = require("express")
argv = process.argv.slice(2)

package = stitch.createPackage(
pckg = stitch.createPackage(
# Specify the paths you want Stitch to automatically bundle up
paths: [ __dirname + "/app" ]

Expand All @@ -1267,7 +1267,7 @@ <h2>Stitch it up</h2>
app.set "views", __dirname + "/views"
app.use app.router
app.use express.static(__dirname + "/public")
app.get "/application.js", package.createServer()
app.get "/application.js", pckg.createServer()

port = argv[0] or process.env.PORT or 9294
console.log "Starting server on port: #{port}"
Expand Down Expand Up @@ -1546,7 +1546,7 @@ <h2>Global variables</h2>
})();
</code></pre>

<p>Notice how CoffeeScript initializes variables (using <code>var</code>) automatically in the context their first used. Whilst it's impossible to shadow outer variables, you can still refer to and access them. You need to watch out for this, be careful that you're not reusing the name of an external variable accidentally if you're writing a deeply nested function or class. For example, here we're accidentally overwriting the <code>package</code> variable in a Class function:</p>
<p>Notice how CoffeeScript initializes variables (using <code>var</code>) automatically in the context they're first used. Whilst it's impossible to shadow outer variables, you can still refer to and access them. You need to watch out for this, be careful that you're not reusing the name of an external variable accidentally if you're writing a deeply nested function or class. For example, here we're accidentally overwriting the <code>package</code> variable in a Class function:</p>

<p><span class="csscript"></span></p>

Expand Down Expand Up @@ -1952,7 +1952,7 @@ <h3>Strict mode usage</h3>
class window.Spine
</code></pre>

<p>Whilst I recommend enabling strict mode, but it's worth noting that script mode doesn't enable any new features that aren't ready possible in JavaScript, and will actually slow down your code a bit by having the VM do more checks at runtime. You may want to develop with strict mode, and deploy to production without it.</p>
<p>Whilst I recommend enabling strict mode, but it's worth noting that strict mode doesn't enable any new features that aren't ready possible in JavaScript, and will actually slow down your code a bit by having the VM do more checks at runtime. You may want to develop with strict mode, and deploy to production without it.</p>

<h2>JavaScript Lint</h2>

Expand Down
6 changes: 3 additions & 3 deletions coffeescript/chapters/06_applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Now to actually boot up the Stitch server. Let's create a file called `index.cof
express = require("express")
argv = process.argv.slice(2)

package = stitch.createPackage(
pckg = stitch.createPackage(
# Specify the paths you want Stitch to automatically bundle up
paths: [ __dirname + "/app" ]

Expand All @@ -75,7 +75,7 @@ Now to actually boot up the Stitch server. Let's create a file called `index.cof
app.set "views", __dirname + "/views"
app.use app.router
app.use express.static(__dirname + "/public")
app.get "/application.js", package.createServer()
app.get "/application.js", pckg.createServer()

port = argv[0] or process.env.PORT or 9294
console.log "Starting server on port: #{port}"
Expand Down Expand Up @@ -244,4 +244,4 @@ For example, when it comes to templating, you can use [Mustache](http://mustache

As for serving up application, [Hem](http://github.com/maccman/hem) is a great choice, supporting both CommonJS and NPM modules and integrating seamlessly with the CoffeeScript MVC framework [Spine](http://spinejs.com). [node-browsify](https://github.com/substack/node-browserify) is another similar project. Or if you want to go lower level with [express](http://expressjs.com/) integration, there's Trevor Burnham's [connect-assets](https://github.com/TrevorBurnham/connect-assets)

You can find a full list of CoffeeScript web framework plugins, on the [project's wiki](https://github.com/jashkenas/coffee-script/wiki/Web-framework-plugins).
You can find a full list of CoffeeScript web framework plugins, on the [project's wiki](https://github.com/jashkenas/coffee-script/wiki/Web-framework-plugins).
6 changes: 0 additions & 6 deletions coffeescript/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
<h1><a href="index.html">The Little Book on CoffeeScript</a></h1>
</header>

<div id="notice">
<p>An <a href="http://shop.oreilly.com/product/0636920024309.do">updated version of the book</a> is now available in Paperback, PDF and Kindle versions from O'Reilly.</p>

<a href="http://shop.oreilly.com/product/0636920024309.do"><img src="site/covers.gif"></a>
</div>

<div id="content">
<ol class="pages">
<li><a href="01_introduction.html">Introduction</a></li>
Expand Down