Permalink
Browse files

Merge branch 'integration'

  • Loading branch information...
2 parents 33c094d + 2f6a03c commit 8053a04490eacffc7b7dc2e448e830ce9f0d0ebe @tj tj committed Sep 2, 2010
Showing with 31 additions and 11 deletions.
  1. +7 −1 Makefile
  2. +14 −0 Readme.md
  3. BIN book.epub
  4. +5 −5 book.html
  5. BIN book.mobi
  6. BIN book.pdf
  7. +4 −4 chapters/buffers.html
  8. +1 −1 chapters/events.html
View
@@ -23,7 +23,7 @@ MD = pages/index.md \
HTML = $(MD:.md=.html)
-all: book.html book.pdf
+all: book.html book.pdf book.mobi book.epub
book.pdf: $(HTML)
htmldoc $(HTML) $(PDF_FLAGS) --outfile $@
@@ -36,6 +36,12 @@ book.html: pages/head.html pages/tail.html $(HTML)
| sed -E 's/<h1>([^ ]+) - /<h1>/' \
> $@
+book.mobi:
+ ebook-convert book.html book.mobi --output-profile kindle
+
+book.epub:
+ ebook-convert book.html book.epub
+
view: book.pdf
open book.pdf
View
@@ -25,6 +25,20 @@ Required by `make book.html`:
$ gem install ronn
$ make book.html
+## EPUB
+
+Required by `make book.epub`:
+Requires [Calibre](http://calibre-ebook.com/)
+
+ $ make book.epub
+
+## MOBI
+
+Required by `make book.mobi`:
+Requires [Calibre](http://calibre-ebook.com/)
+
+ $ make book.mobi
+
## References
Contents of this eBook currently reference the following software versions:
View
BIN book.epub
Binary file not shown.
View
@@ -523,7 +523,7 @@ <h3 id="errno">errno</h3>
</div>
<div class='mp'>
<h1>Events</h1>
-<p> Events are crucial to node, and used greatly throughout core and 3rd-party modules. Node's core library <em>events</em> supplies us with a single constructor, <em>EventEmitter</em>.</p>
+<p> The concept of an "event" is crucial to node, and used greatly throughout core and 3rd-party modules. Node's core module <em>events</em> supplies us with a single constructor, <em>EventEmitter</em>.</p>
<h2 id="Emitting-Events">Emitting Events</h2>
@@ -598,7 +598,7 @@ <h2 id="Removing-Event-Listeners">Removing Event Listeners</h2>
</div>
<div class='mp'>
<h1>Buffers</h1>
-<p> To handle binary data, node provides us the <code>Buffer</code> object. Buffer instances represent memory allocated independently to that of V8's heap. There are several ways to constructor a <code>Buffer</code> instance, and many ways you can manipulate it's data.</p>
+<p> To handle binary data, node provides us with the global <code>Buffer</code> object. Buffer instances represent memory allocated independently to that of V8's heap. There are several ways to construct a <code>Buffer</code> instance, and many ways you can manipulate it's data.</p>
<p>The simplest way to construct a <code>Buffer</code> from a string is to simply pass a string as the first argument. As you can see by the log output, we now have a buffer object containing 5 bytes of data represented in hexadecimal.</p>
@@ -637,7 +637,7 @@ <h2 id="Removing-Event-Listeners">Removing Event Listeners</h2>
// =&gt; "Hello"
</code></pre>
-<p>The <code>.length</code> property of a buffer instance contains the byte length of the stream, compared to JavaScript strings which will simply return the number of characters. For example the ellipsis character '…' consists of three bytes, however the buffer will respond with the byte length, and not the character length.</p>
+<p>The <code>.length</code> property of a buffer instance contains the byte length of the stream, opposed to JavaScript strings which will simply return the number of characters. For example the ellipsis character '…' consists of three bytes, however the buffer will respond with the byte length, and not the character length.</p>
<pre><code>var ellipsis = new Buffer('…', 'utf8');
@@ -651,9 +651,9 @@ <h2 id="Removing-Event-Listeners">Removing Event Listeners</h2>
// =&gt; &lt;Buffer e2 80 a6>
</code></pre>
-<p>When working with JavaScript strings, we can also pass a string through the <code>Buffer.byteLength()</code> method to determine it's byte length.</p>
+<p>When dealing with JavaScript strings, we may pass it to the <code>Buffer.byteLength()</code> method to determine it's byte length.</p>
-<p>The api is written in such a way that it is Array-like, so for example we can work with "slices" of a <code>Buffer</code> by passing offsets to the <code>slice()</code> method:</p>
+<p>The api is written in such a way that it is String-like, so for example we can work with "slices" of a <code>Buffer</code> by passing offsets to the <code>slice()</code> method:</p>
<pre><code>var chunk = buf.slice(4, 9);
console.log(chunk.toString());
View
BIN book.mobi
Binary file not shown.
View
BIN book.pdf
Binary file not shown.
View
@@ -1,6 +1,6 @@
<div class='mp'>
<h1>Buffers</h1>
-<p> To handle binary data, node provides us the <code>Buffer</code> object. Buffer instances represent memory allocated independently to that of V8's heap. There are several ways to constructor a <code>Buffer</code> instance, and many ways you can manipulate it's data.</p>
+<p> To handle binary data, node provides us with the global <code>Buffer</code> object. Buffer instances represent memory allocated independently to that of V8's heap. There are several ways to construct a <code>Buffer</code> instance, and many ways you can manipulate it's data.</p>
<p>The simplest way to construct a <code>Buffer</code> from a string is to simply pass a string as the first argument. As you can see by the log output, we now have a buffer object containing 5 bytes of data represented in hexadecimal.</p>
@@ -39,7 +39,7 @@
// =&gt; "Hello"
</code></pre>
-<p>The <code>.length</code> property of a buffer instance contains the byte length of the stream, compared to JavaScript strings which will simply return the number of characters. For example the ellipsis character '…' consists of three bytes, however the buffer will respond with the byte length, and not the character length.</p>
+<p>The <code>.length</code> property of a buffer instance contains the byte length of the stream, opposed to JavaScript strings which will simply return the number of characters. For example the ellipsis character '…' consists of three bytes, however the buffer will respond with the byte length, and not the character length.</p>
<pre><code>var ellipsis = new Buffer('…', 'utf8');
@@ -53,9 +53,9 @@
// =&gt; &lt;Buffer e2 80 a6>
</code></pre>
-<p>When working with JavaScript strings, we can also pass a string through the <code>Buffer.byteLength()</code> method to determine it's byte length.</p>
+<p>When dealing with JavaScript strings, we may pass it to the <code>Buffer.byteLength()</code> method to determine it's byte length.</p>
-<p>The api is written in such a way that it is Array-like, so for example we can work with "slices" of a <code>Buffer</code> by passing offsets to the <code>slice()</code> method:</p>
+<p>The api is written in such a way that it is String-like, so for example we can work with "slices" of a <code>Buffer</code> by passing offsets to the <code>slice()</code> method:</p>
<pre><code>var chunk = buf.slice(4, 9);
console.log(chunk.toString());
View
@@ -1,6 +1,6 @@
<div class='mp'>
<h1>Events</h1>
-<p> Events are crucial to node, and used greatly throughout core and 3rd-party modules. Node's core library <em>events</em> supplies us with a single constructor, <em>EventEmitter</em>.</p>
+<p> The concept of an "event" is crucial to node, and used greatly throughout core and 3rd-party modules. Node's core module <em>events</em> supplies us with a single constructor, <em>EventEmitter</em>.</p>
<h2 id="Emitting-Events">Emitting Events</h2>

0 comments on commit 8053a04

Please sign in to comment.