Skip to content

Commit a63ce6e

Browse files
committed
Merge branch 'json-api-v0.6' into v0.6
2 parents 4065b24 + 4ca3fd0 commit a63ce6e

File tree

106 files changed

+3076
-2275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+3076
-2275
lines changed

Makefile

+15-30
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,15 @@ test-npm-publish: all
7878
out/Release/node: all
7979

8080
apidoc_sources = $(wildcard doc/api/*.markdown)
81-
apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html))
81+
apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \
82+
$(addprefix out/,$(apidoc_sources:.markdown=.json))
8283

83-
apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets out/doc/about out/doc/community out/doc/logos
84+
apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets out/doc/about out/doc/community out/doc/logos out/doc/images
8485

8586
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
8687

88+
doc_images = $(addprefix out/,$(wildcard doc/images/* doc/*.jpg doc/*.png))
89+
8790
website_files = \
8891
out/doc/index.html \
8992
out/doc/v0.4_announcement.html \
@@ -92,35 +95,14 @@ website_files = \
9295
out/doc/sh_javascript.min.js \
9396
out/doc/sh_vim-dark.css \
9497
out/doc/sh.css \
95-
out/doc/logo.png \
9698
out/doc/favicon.ico \
9799
out/doc/pipe.css \
98100
out/doc/about/index.html \
99-
out/doc/close-downloads.png \
100101
out/doc/community/index.html \
101-
out/doc/community/not-invented-here.png \
102102
out/doc/logos/index.html \
103-
out/doc/microsoft-logo.png \
104-
out/doc/ryan-speaker.jpg \
105-
out/doc/download-logo.png \
106-
out/doc/ebay-logo.png \
107-
out/doc/footer-logo-alt.png \
108-
out/doc/footer-logo.png \
109-
out/doc/icons-interior.png \
110-
out/doc/icons.png \
111-
out/doc/home-icons.png \
112-
out/doc/joyent-logo_orange_nodeorg-01.png \
113-
out/doc/linkedin-logo.png \
114-
out/doc/logo-light.png \
115-
out/doc/mac_osx_nodejs_installer_logo.png \
116-
out/doc/microsoft-logo.png \
117-
out/doc/platform-icons.png \
118-
out/doc/sponsored.png \
119-
out/doc/twitter-bird.png \
120-
out/doc/community-icons.png \
121-
out/doc/yahoo-logo.png
122-
123-
doc docs: out/Release/node $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs)
103+
$(doc_images)
104+
105+
doc: node $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/
124106

125107
$(apidoc_dirs):
126108
mkdir -p $@
@@ -129,10 +111,13 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
129111
cp $< $@
130112

131113
out/doc/%: doc/%
132-
cp $< $@
114+
cp -r $< $@
115+
116+
out/doc/api/%.json: doc/api/%.markdown
117+
out/Release/node tools/doc/generate.js --format=json $< > $@
133118

134-
out/doc/api/%.html: doc/api/%.markdown out/Release/node $(apidoc_dirs) $(apiassets) tools/doctool/doctool.js
135-
out/Release/node tools/doctool/doctool.js doc/template.html $< > $@
119+
out/doc/api/%.html: doc/api/%.markdown
120+
out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
136121

137122
out/doc/%:
138123

@@ -197,7 +182,7 @@ $(TARBALL): out/doc
197182
cp doc/node.1 $(TARNAME)/doc/node.1
198183
cp -r out/doc/api $(TARNAME)/doc/api
199184
rm -rf $(TARNAME)/deps/v8/test # too big
200-
rm -rf $(TARNAME)/doc/logos/*.{png,eps} # too big
185+
rm -rf $(TARNAME)/doc/images # too big
201186
tar -cf $(TARNAME).tar $(TARNAME)
202187
rm -rf $(TARNAME)
203188
gzip -f -9 $(TARNAME).tar

doc/about/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<body class="alt int" id="about">
2222
<div id="intro" class="interior">
2323
<a href="/" title="Go back to the home page">
24-
<img id="logo" src="../logo-light.png" alt="node.js">
24+
<img id="logo" src="http://nodejs.org/images/logo-light.png" alt="node.js">
2525
</a>
2626
</div>
2727
<div id="content" class="clearfix">
@@ -102,7 +102,7 @@ <h1>Node's goal is to provide an easy way to build scalable
102102
<p>But what about multiple-processor concurrency? Aren't
103103
threads necessary to scale programs to multi-core computers?
104104
You can start new processes via <code><a
105-
href="http://nodejs.org/docs/latest/api/child_processes.html#child_process.fork">child_process.fork()</a></code>
105+
href="http://nodejs.org/docs/latest/api/child_process.html#child_process.fork">child_process.fork()</a></code>
106106
these other processes will be scheduled in parallel. For load
107107
balancing incoming connections across multiple processes use
108108
<a href="http://nodejs.org/docs/latest/api/cluster.html">the

doc/api/_toc.markdown

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
## Table of Contents
2-
1+
* [About these Docs](documentation.html)
32
* [Synopsis](synopsis.html)
43
* [Globals](globals.html)
54
* [STDIO](stdio.html)
@@ -9,8 +8,8 @@
98
* [Process](process.html)
109
* [Utilities](util.html)
1110
* [Events](events.html)
12-
* [Buffers](buffers.html)
13-
* [Streams](streams.html)
11+
* [Buffer](buffer.html)
12+
* [Stream](stream.html)
1413
* [Crypto](crypto.html)
1514
* [TLS/SSL](tls.html)
1615
* [String Decoder](string_decoder.html)
@@ -26,7 +25,7 @@
2625
* [Readline](readline.html)
2726
* [REPL](repl.html)
2827
* [VM](vm.html)
29-
* [Child Processes](child_processes.html)
28+
* [Child Processes](child_process.html)
3029
* [Assertion Testing](assert.html)
3130
* [TTY](tty.html)
3231
* [ZLIB](zlib.html)
@@ -35,4 +34,3 @@
3534
* [Cluster](cluster.html)
3635
* Appendixes
3736
* [Appendix 1: Recommended Third-party Modules](appendix_1.html)
38-
* [Appendix 2: Deprecated API's](appendix_2.html)

doc/api/addons.markdown

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Addons
1+
# Addons
22

33
Addons are dynamically linked shared objects. They can provide glue to C and
44
C++ libraries. The API (at the moment) is rather complex, involving
@@ -24,7 +24,7 @@ compiling your module, you don't need to worry about linking to any of these
2424
libraries.
2525

2626

27-
### Hello world
27+
## Hello world
2828

2929
To get started let's make a small Addon which is the C++ equivalent of
3030
the following Javascript code:
@@ -129,7 +129,7 @@ In cases where there is more than one `.cc` file, simply add the file name to th
129129
obj.source = ['addon.cc', 'myexample.cc']
130130

131131

132-
#### Function arguments
132+
### Function arguments
133133

134134
The following pattern illustrates how to read arguments from JavaScript
135135
function calls and return a result. This is the main and only needed source
@@ -172,7 +172,7 @@ You can test it with the following JavaScript snippet:
172172
console.log( 'This should be eight:', addon.add(3,5) );
173173

174174

175-
#### Callbacks
175+
### Callbacks
176176

177177
You can pass JavaScript functions to a C++ function and execute them from
178178
there. Here's `addon.cc`:
@@ -209,7 +209,7 @@ To test it run the following JavaScript snippet:
209209
});
210210

211211

212-
#### Object factory
212+
### Object factory
213213

214214
You can create and return new objects from within a C++ function with this
215215
`addon.cc` pattern, which returns an object with property `msg` that echoes
@@ -245,7 +245,7 @@ To test it in JavaScript:
245245
console.log(obj1.msg+' '+obj2.msg); // 'hello world'
246246

247247

248-
#### Function factory
248+
### Function factory
249249

250250
This pattern illustrates how to create and return a JavaScript function that
251251
wraps a C++ function:
@@ -286,7 +286,7 @@ To test:
286286
console.log(fn()); // 'hello world'
287287

288288

289-
#### Wrapping C++ objects
289+
### Wrapping C++ objects
290290

291291
Here we will create a wrapper for a C++ object/class `MyObject` that can be
292292
instantiated in JavaScript through the `new` operator. First prepare the main
@@ -381,7 +381,7 @@ Test it with:
381381
console.log( obj.plusOne() ); // 13
382382

383383

384-
#### Factory of wrapped objects
384+
### Factory of wrapped objects
385385

386386
This is useful when you want to be able to create native objects without
387387
explicitly instantiating them with the `new` operator in JavaScript, e.g.
@@ -507,7 +507,7 @@ Test it with:
507507
console.log( obj2.plusOne() ); // 23
508508

509509

510-
#### Passing wrapped objects around
510+
### Passing wrapped objects around
511511

512512
In addition to wrapping and returning C++ objects, you can pass them around
513513
by unwrapping them with Node's `node::ObjectWrap::Unwrap` helper function.

doc/api/all.markdown

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1+
@include documentation
12
@include synopsis
23
@include globals
34
@include stdio
45
@include timers
56
@include modules
67
@include addons
78
@include process
8-
@include constants
99
@include util
10-
@include freelist
1110
@include events
12-
@include buffers
13-
@include streams
11+
@include buffer
12+
@include stream
1413
@include crypto
1514
@include tls
1615
@include string_decoder
@@ -26,14 +25,11 @@
2625
@include readline
2726
@include repl
2827
@include vm
29-
@include child_processes
28+
@include child_process
3029
@include assert
3130
@include tty
3231
@include zlib
3332
@include os
3433
@include debugger
3534
@include cluster
36-
37-
# Appendixes
3835
@include appendix_1
39-
@include appendix_2

doc/api/appendix_1.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Appendix 1 - Third Party Modules
1+
# Appendix 1 - Third Party Modules
22

33
There are many third party modules for Node. At the time of writing, August
44
2010, the master repository of modules is

doc/api/appendix_2.markdown

Whitespace-only changes.

doc/api/assert.markdown

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
## Assert
1+
# Assert
22

33
This module is used for writing unit tests for your applications, you can
44
access it with `require('assert')`.
55

6-
### assert.fail(actual, expected, message, operator)
6+
## assert.fail(actual, expected, message, operator)
77

88
Throws an exception that displays the values for `actual` and `expected` separated by the provided operator.
99

10-
### assert(value, message), assert.ok(value, [message])
10+
## assert(value, message), assert.ok(value, [message])
1111

1212
Tests if value is a `true` value, it is equivalent to `assert.equal(true, value, message);`
1313

14-
### assert.equal(actual, expected, [message])
14+
## assert.equal(actual, expected, [message])
1515

1616
Tests shallow, coercive equality with the equal comparison operator ( `==` ).
1717

18-
### assert.notEqual(actual, expected, [message])
18+
## assert.notEqual(actual, expected, [message])
1919

2020
Tests shallow, coercive non-equality with the not equal comparison operator ( `!=` ).
2121

22-
### assert.deepEqual(actual, expected, [message])
22+
## assert.deepEqual(actual, expected, [message])
2323

2424
Tests for deep equality.
2525

26-
### assert.notDeepEqual(actual, expected, [message])
26+
## assert.notDeepEqual(actual, expected, [message])
2727

2828
Tests for any deep inequality.
2929

30-
### assert.strictEqual(actual, expected, [message])
30+
## assert.strictEqual(actual, expected, [message])
3131

3232
Tests strict equality, as determined by the strict equality operator ( `===` )
3333

34-
### assert.notStrictEqual(actual, expected, [message])
34+
## assert.notStrictEqual(actual, expected, [message])
3535

3636
Tests strict non-equality, as determined by the strict not equal operator ( `!==` )
3737

38-
### assert.throws(block, [error], [message])
38+
## assert.throws(block, [error], [message])
3939

4040
Expects `block` to throw an error. `error` can be constructor, regexp or
4141
validation function.
@@ -72,11 +72,11 @@ Custom error validation:
7272
"unexpected error"
7373
);
7474

75-
### assert.doesNotThrow(block, [error], [message])
75+
## assert.doesNotThrow(block, [error], [message])
7676

7777
Expects `block` not to throw an error, see assert.throws for details.
7878

79-
### assert.ifError(value)
79+
## assert.ifError(value)
8080

8181
Tests if value is not a false value, throws if it is a true value. Useful when
8282
testing the first argument, `error` in callbacks.

0 commit comments

Comments
 (0)